Install for Your Harness¶
alr install <harness> wires OpenALR into one harness. This page holds what
every install has in common; each harness's own page has what is particular to
it.
Before You Start¶
You need the alr command: install uv and OpenALR as in
Quickstart steps 1 and 2.
The Harnesses¶
| Harness | Command | What It Does | Requires |
|---|---|---|---|
| Claude Code | alr install claude-code |
Adds hooks to Claude Code's settings.json and the in-session commands to its commands folder. |
2.1.296 or later |
| Grok Build | alr install grok |
Adds its own hook file to Grok's hooks folder, and the /alr-plan and /alr-prices skills. Your Grok config.toml is never edited. |
1.0.53 or later |
| Hermes | alr install hermes |
Copies the plugin into Hermes, enables it through Hermes, restarts a running gateway, and proves the plugin loads. | 0.21 or later |
| Anthropic SDK | alr install claude-sdk |
Writes nothing. Prints the few lines of code to add to your own program. | Not applicable |
Each version is the earliest one OpenALR was built and tested against. A later version should work too; if it does not, say which version you have when you report it.
How Every Install Works¶
- The install preview. Run without
--yes,alr installchanges nothing. It prints each file it would add or change, with the exact lines (it can run to a few screens), saysnothing changed, and exits. - Apply it. Run the same command with
--yes. Before it changes a file that already exists, it keeps a copy named<file>.alr-backup-<time>beside it. - Run it again any time. A second install is safe: the preview says which files are already installed and what it would refresh. After you upgrade OpenALR, run the install again.
- Try it somewhere else first.
--home DIRpreviews or installs against a scratch folder in place of your real home.
A hook never fails your session. If the emitter breaks, the hook still exits cleanly; a missed record is a gap in the accounting, not a broken session.
Get the Latest Price Book¶
OpenALR ships with a price book: the list prices it uses to estimate a cost that no harness reported. Newer books are published as prices change and new models appear, and the one that ships with OpenALR does not update itself. Once you have installed, fetch the latest book and see which one is in use:
alr prices update # fetch the latest signed book, check it, and store it
alr prices show # which book is in use, and where it came from
This is one download over HTTPS, and it sends nothing about your records (see What Stays Private). A book that fails its signature check is not stored. To keep the book current, see Keep the Price Book Current.
Check, Uninstall, and Purge¶
alr check # every record line that could not be used, and why
alr uninstall <harness> # preview what uninstall would remove
alr uninstall <harness> --yes # remove only what the install added
alr uninstall <harness> --purge --yes # ... and delete that harness's records
Uninstall removes only what the install added, and leaves your own settings
alone. Your records are kept unless you pass --purge, which deletes only the
named harness's records (and the grades, corrections, and tag events that name
only them); every other harness's records stay byte for byte. Each harness page
says what its uninstall removes.
Where Files Live¶
%USERPROFILE% is your user folder, for example C:\Users\you.
| What | Where |
|---|---|
| Records | %USERPROFILE%\.alr-emit\records.jsonl |
| Config | %USERPROFILE%\.config\openalr\config.toml |
| Session state (tags, turn journal) | %USERPROFILE%\.local\state\openalr\sessions\ |
| Claude Code | %USERPROFILE%\.claude\settings.json, %USERPROFILE%\.claude\commands\alr-*.md |
| Grok Build | %USERPROFILE%\.grok\hooks\alr-emit.json, or under GROK_HOME (the preview says so) |
| Hermes plugin | %LOCALAPPDATA%\hermes\plugins\alr-emit\ |
| What | Where |
|---|---|
| Records | ~/.alr-emit/records.jsonl |
| Config | ~/.config/openalr/config.toml |
| Session state (tags, turn journal) | ~/.local/state/openalr/sessions/ |
| Claude Code | ~/.claude/settings.json, ~/.claude/commands/alr-*.md |
| Grok Build | ~/.grok/hooks/alr-emit.json, or under GROK_HOME (the preview says so) |
| Hermes plugin | ~/.hermes/plugins/alr-emit/ |
ALR_EMIT_SINK (a file) or log_dir in the config (a folder) moves the record
file; XDG_CONFIG_HOME and XDG_STATE_HOME move the config and the session
state.
Setting an Environment Variable¶
Several settings are environment variables, for example the cost basis. Set one in the shell you start your harness from:
$env:ALR_EMIT_COST_BASIS = "metered"
It holds for that PowerShell window and the programs it starts.
export ALR_EMIT_COST_BASIS=metered
It holds for that shell and the programs it starts.
Installing From a Wheel File¶
OpenALR is published to PyPI, from GitHub Actions with Trusted Publishing, and each file there carries a PyPI attestation (PEP 740) and its SHA-256 hash. If you were given a wheel file instead, check its hash against the one you were given, then install it:
Get-FileHash -Algorithm SHA256 .\alr_emit-0.1.0-py3-none-any.whl
uv tool install .\alr_emit-0.1.0-py3-none-any.whl
Get-FileHash prints the hash in capitals; compare it ignoring case.
sha256sum alr_emit-0.1.0-py3-none-any.whl # Linux
shasum -a 256 alr_emit-0.1.0-py3-none-any.whl # macOS
uv tool install ./alr_emit-0.1.0-py3-none-any.whl
WSL¶
Inside WSL, OpenALR is a Linux install: follow the macOS and Linux tabs. A harness running in Windows and one running in WSL keep separate records.