Hania Code

Hania Code

Hania Code is the coding capability inside Hania. It lets an agent read, edit, and search files, and run commands, on a real computer - your own laptop or a server. You start a coding conversation with the hania terminal client, and you can pick the same conversation up in the console.

It is not a separate product. Hania Code runs on the same platform as the rest of Hania, so it uses the same billing, the same workspaces, the same model registry, and the same approvals. An agent that answers your customers on Monday can fix your deploy script on Tuesday.

How it works

The agent loop, the language model calls, and billing all run on Hania's server. The file and shell work happens on your computer, carried out by hania in the folder you started it from (or, on a paired server, by the background runner). Each message tells Hania which computer and folder the conversation is working in, and the conversation keeps them for its later turns.

An agent gets Hania Code from its settings: turn on Use Hania Code on the agent's Tools tab. It works for both Agents and Autonomous Agents. See Hania Code settings.

When the agent wants to change a file or run a command, the change is shown to you first and waits for your approval - in the terminal as an inline card, in the console as an approval card in the conversation. How much it asks about is set by the agent's mode, and rules can allow or deny specific changes. See approvals.

Where it works

FromHow it works
The terminalThis is where a coding conversation starts. Install hania, sign in with an API key, and run it in a project folder. Your computer registers itself with Hania the first time. See the terminal client.
The consoleYou can continue a conversation that was started in hania, approvals included, while hania or hania runner is running on that computer. The same goes for a conversation bound to a paired server through the API. A conversation started in the console can't use Hania Code yet.
The APIAn integration can send a coding turn to a paired server by naming the server and a folder. See the Hania Code API.
Runs and teamsScheduled runs, Run now, runs started through the API or by the Hania Assistant, agents started from a collection by a rule or an @mention, and team members' turns in a team all work on the computer where hania is open with that agent, in the folder it was started from. See runs and teams below.

Everywhere else, the agent still has Hania Code, but it has no computer to work on, so every action fails. That's the case for conversations started in the console, the website widget, messaging channels such as WhatsApp, Slack, Telegram, Messenger and Instagram, runs started by an incoming email, post-call runs, and work an agent hands to another agent while it's working. Voice calls never get Hania Code.

Runs and teams

A run doesn't need a computer of its own. When a run or a team member's turn starts, Hania looks for a hania window that's open with that agent right now, and works on that window's computer, in its folder. If several are open, the one used most recently wins. A team's shared chat never codes; its members do, each in its own work thread.

If no window is open with the agent, its coding actions fail with "no Hania Code session is open for this agent", and the agent tells you to open hania with it on the computer, in the folder to work in. If the computer goes offline partway through, the actions fail with a message saying so. If that window closes but hania is still running elsewhere on the same computer, the work carries on there, in the same folder.

Runs happen with nobody watching, so the unattended rules apply. Reading and searching files always works. Running commands and changing files are blocked unless the agent has Allow destructive actions in autonomous runs turned on, and then each one waits for approval in the Review queue, following the agent's mode.

The run's conversation remembers the computer and folder it used, and the console shows them at the top as Last coded on. An approved change from a run that was waiting is made there, in the same place.

What you need

  • A paid plan. Every computer and server counts as a machine, and Free includes none. On Free, hania can't register your computer and tells you that Hania Code needs a paid plan. You can still chat, but the agent can't touch your files. See plan limits.
  • An API key for the terminal client, created under API keys in the console. See Sign in for the abilities it needs.
  • An agent with Hania Code on. The terminal client only lists agents that have it.

Billing

Coding uses the existing rails. Language model usage and per-tool execution are metered the same way as the rest of Hania, against your workspace's usage credit. There is no separate coding subscription. See Plans & usage.

Where to go next