Skip to content
anttikissaPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Hal

This is HAL 9001, an agent harness.

Hal in a terminal (left) and a web browser (right)

The main selling points:

  • Respects the terminal: no hijacked mouse or scrolling. ctrl-c, ctrl-z, copy and paste and links work as they should.
  • Basic editing amenities work: select with shift, tab to indent.
  • Excellent in the terminal. Where the terminal falls short, the web UI picks up the torch.
  • Works out of the box with Claude, ChatGPT and OpenCode Go subscriptions, plus many API keys. New providers are easy to add.
  • Micro-optimized where it matters: no typing lag, near-instant startup even with 100+ tabs.
  • No dependencies where we can avoid them: starting hal loads about 33k lines of TS and no third-party packages. Fewer supply-chain attacks are a happy side effect.
  • Small: about 48k lines in total.
  • Run any number of sessions as tabs in one terminal, no extra tools needed. Connect as many terminal or web clients as you like, and sessions survive process exit or restart.
  • Hot-reloadable plugins that can do anything. Failing that, Hal modifies its own source code. That's how it's developed: "update yourself, ctrl-r to restart, observe changes" is my normal workflow.

Before you start

Hal is developed on Mac first, Linux servers second. Windows is untested. Linux desktop users may dislike some default keybindings, especially in the browser.

Hal is written by and mostly tested with Claude Opus 5.5 and GPT-6.1 Sol. Other models, even local ones, work in quick tests, but expect some rough edges.

Install

The official install method is cloning the source and running the install script:

git clone https://github.com/anttikissa/hal ~/.hal
cd ~/.hal
# Hal uses Bun as its runtime. This installs it if you don't have it.
./install
# might have to restart shell for $PATH to update, then:
hal

You can also do this, which does the exact same thing:

curl https://hal.kissa.dev/install | bash

Client-server model

Hal normally runs in "host mode", running the server and terminal app in the same process. Starting another hal joins it as a peer, which is promoted to host if the host exits. (This is a handy way to juggle between Hal processes if it's rewriting itself, and you want to make sure that the new code still runs after a restart.) You can connect to remote or local hal using hal -r <host>:<port>, or by hal -r (the last one), or by accessing its web server (listening on http://localhost:9001/ by default). Remote and web authentication is handled via one-time passcodes generated by hal auth or /auth in an existing session.

There's also hal serve, which only runs the server part.

Persistence

Hal keeps your tabs and their states over restarts (or over server-peer handovers). If you close the host process, they will show up as paused the next time you start Hal. Generally you only need to restart if you modify Hal itself. Plugin, theme, and config changes are reloaded automatically.

Tabs

Open a tab with ctrl-t, close with ctrl-w, browse with ctrl-n and ctrl-p. If you've ever used an IRC client (or a web browser), the keybindings will feel familiar. Closed a tab you didn't want to? Resume it with ctrl-shift-t, or /resume <tab-id>.

Subagents are also tabs (of course) with the "autoclose" property on. If you interfere with the minion's meddlings, autoclose will be turned off. Use /autoclose to turn it back on.

hal -p <prompt> (run a prompt and print output) also shows as a tab while it's running, because why not.

Hal is capable of introspection and issuing commands to itself. You can ask for things like "order my tabs by project", "close inactive or old tabs", etc.

Switching projects

Hal is designed to manage many sessions and many projects at a time. /cd <dir> changes the current directory, bringing its AGENTS.md and skills to scope. Opening a new tab inherits the current tab's directory.

/model (or more usually, ctrl-m) switches the model and thinking effort.

Forking

Fork the current session with ctrl-b (for "branch", since ctrl-f is for "find"/"filter") to ask a quick question, do a side quest, or try another approach with the same context. If you fork while the parent is working, the fork starts idle to avoid conflicting tool calls.

Rebase and edit

Rewrite session history, or ask the model to do it. (E.g. "rebase this session, delete the part after I made decision Y", or "rebase, drop unnecessary stuff to get context usage under 30k tokens".) Takes inspiration from git rebase -i. /rebase undo to go back.

You can edit the previous prompt (arrow up on terminal, or edit icon on web), even while Hal is working (it will be paused once you start editing) and it'll start again with the edited prompt as if nothing else ever happened. Of course you can undo that too: /edit undo.

Compact

The model can use COMPACT to write a working-state checkpoint and continue in the same session with less context. It carries forward your goals, unresolved requests, decisions, findings, work and verification state, and the next action. Current requests stay verbatim.

Use /compact to request a checkpoint, or /compact <focus> to guide what it preserves, e.g. /compact preserve the design decisions and remaining work. /compact undo restores the previous context while keeping later work.

Hal nudges the model to compact at a sensible stopping point at 150k tokens, and before further substantial work at 200k and 250k. These are reminders, not forced compaction.

The transcript and full history stay intact: only what the model sees shrinks. You can still browse the original discussion, and the model can recover details with READ_ENTRY.

Server

I run Hal on a Linux box and use it with the web interface. You can get a decent app-like experience (including notifications) if you save it as a home screen app. (Tested on iPhone, not on Android.)

There's a bundled skill, hal-server-install. So far it is tested on CentOS and Caddy.

Plugins

A Hal plugin can wrap any function in the codebase or override any value. Write custom tools, providers, commands, themes, or pretty much anything as a plugin.

The plugin API changes during development. Its integer version and change history live in plugin-api.ason; see API versioning. The loader does not yet use this ledger to adapt older plugins.

Drop a plugin into <Hal home>/plugins/ to load it automatically. See Writing plugins for portable imports, syncing, and optional file-local formatter and observer hooks.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages