Install¶
How do I get OpenALR working on my machine, and know it works?
Audience: Developers, and anyone setting up OpenALR for a team.
The Lantern Studio Case: A Number That Arrived Too Late¶
The quarterly review at Lantern Studio was booked for an hour. It ran to an hour and forty minutes. Eight people sat through it, and when it broke up, Tom, the owner, stopped at the door and asked the room a fair question: "Was that worth it?"
Nobody could say, because nobody knew what "that" had cost. Priya, a team lead, worked it out on the back of the agenda. Eight people at an average of $75 an hour is $10 a minute. A hundred minutes is $1,000. The number was easy to get. It just arrived after the meeting, when nothing could be done with it.
Before she left the room, Priya wrote a one-line brief on the whiteboard: "show what a meeting costs while it runs."
Sam, a developer, offered to build it with an agent, in a few short sessions. Tom asked the obvious next question. What would the agent cost? Sam's honest answer was that the agent tool sends one total at the end of the month, with no list of what it was for. The studio would be back where it started: a cost that shows up afterwards, as one number, with nothing to read it against.
So Priya made the first decision before the first line of code. The agent work would be recorded from its first turn, so that when Tom asks his question about the timer, there is something to answer with. The timer will show what people cost in a meeting. OpenALR will show what the agents cost building it.
This page is the half-morning Sam spends getting the recorder in place and proving it records.
The team and its people are illustrative. The work, the commands, and the records are real.
What You'll Build and What You'll Learn¶
The timer gets:
- Nothing yet. There is an empty repository and a one-line brief on a whiteboard.
OpenALR shows:
- Installing
uv, then OpenALR. - Wiring a harness, here Claude Code.
- Checking before the first turn, and what an empty record file looks like.
- Starting the telemetry receiver and setting three things before Claude Code starts, so each turn carries its own cost figure.
- Proving it: one turn, and the record that turn left on disk.
- Opening the dashboard on the same records.
- How to read a record's cost, including the word for a cost nobody knows.
Before You Start¶
- A machine. Sam's runs Linux.
- Claude Code, already installed and signed in.
- OpenALR 0.1.0 from PyPI. The install line below needs that release to exist.
- No earlier example. This one is the first.
- The code and records, if you want to follow along: this example's snapshot is the
we-00folder of openalr/meeting-cost-meter.
This page runs Claude Code on Linux. The same steps work on Windows and macOS, and with Grok Build, Hermes, and the Anthropic SDK; each has its own install page.
The Build¶
Sam works on Linux. Where Windows differs, it has its own tab.
1. Install uv¶
OpenALR installs as a uv tool, so uv comes first. Run the line for your platform.
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
curl -LsSf https://astral.sh/uv/install.sh | sh
If uv is not found afterwards, open a new terminal, or run the source line the installer prints.
What you see:
sam@studio:meeting-cost-meter$ curl -LsSf https://astral.sh/uv/install.sh | sh
downloading uv 0.13.10 x86_64-unknown-linux-gnu
installing to ~/.local/bin
uv
uvx
everything's installed!
sam@studio:meeting-cost-meter$
2. Install OpenALR¶
uv tool install alr-emit
Then ask for the version:
alr --version
The expected line is OpenALR alr-emit 0.1.0. If the shell says alr is not found, run uv tool update-shell and open a new shell.
If it prints a usage message instead of the version, uv is using an older copy of alr-emit from its cache. Reinstall the release by version, skipping the cache: uv tool install --reinstall --no-cache alr-emit==0.1.0. (With uvx, the same fix is uvx --no-cache --from alr-emit==0.1.0 alr --version.)
sam@studio:meeting-cost-meter$ alr --version
OpenALR alr-emit 0.1.0
sam@studio:meeting-cost-meter$
Then fetch the latest price book. OpenALR ships with one, the list prices it uses to estimate a cost that no harness reported, but the one that ships does not update itself, and newer books are published as prices change and new models appear. Sam checks which book is in use, fetches the latest, and checks again:1
alr prices show
alr prices update
alr prices show
sam@studio:meeting-cost-meter$ alr prices show
in use: alr-prices/0.3 as of 2026-11-20, published 2026-11-20T21:28:00Z, 33 models (bundled pricebook.json)
source: bundled (shipped with this release)
signing key: ef70aea38947ec91 (key id: the first 16 hex digits of the SHA-256 of the built-in public key's 32 raw bytes)
label: estimate at public API list prices as of 2026-11-20; not a bill
…
sam@studio:meeting-cost-meter$ alr prices update
stored the price book as of 2026-12-01 in /home/sam/.alr-emit/prices/alr-prices-2026-12-01.json
sam@studio:meeting-cost-meter$ alr prices show
in use: alr-prices/0.3 as of 2026-12-01, published 2026-12-01T17:34:25.368145Z, 103 models (/home/sam/.alr-emit/prices/alr-prices-2026-12-01.json)
source: stored (by alr prices update or alr prices import)
signing key: ef70aea38947ec91 (key id: the first 16 hex digits of the SHA-256 of the built-in public key's 32 raw bytes)
label: estimate at public API list prices as of 2026-12-01; not a bill
…
sam@studio:meeting-cost-meter$
The first show names the book that ships with 0.1.0, as of November 20, with 33 models. After the update, the book in use is the December 1 one, with 103, signed by the same key. Each listing goes on with its notes and a line per model, cut here at …. A newer book changes estimates, never records; Keep the Price Book Current says when to fetch one again.
3. Wire Claude Code, Preview First¶
Run the install command without --yes first. That prints what would change and writes nothing. Read it. Then run it again with --yes.
alr install claude-code
alr install claude-code --yes
You do not need --wheel FILE when you install from PyPI.
What you see:
~/.claude/settings.json: add hooks: Stop, SubagentStop, SessionEnd, UserPromptExpansion, UserPromptSubmit
~/.claude/commands/alr-tag.md: add the kit's own file
~/.claude/commands/alr-ctl.md: add the kit's own file
~/.claude/commands/alr-turns.md: add the kit's own file
~/.claude/commands/alr-grade.md: add the kit's own file
~/.claude/commands/alr-help.md: add the kit's own file
~/.claude/commands/alr.md: add the kit's own file
~/.claude/commands/alr-plan.md: add the kit's own file
~/.claude/commands/alr-prices.md: add the kit's own file
nothing changed; run again with --yes to apply these changes
The preview adds five hooks to Claude Code's settings and eight slash commands, and it writes nothing until you run it again with --yes.
Using Grok Build or Hermes?
Wire it with alr install grok or alr install hermes instead, as their install pages show: Grok Build and Hermes. The steps are similar, but what each one prints differs. Step 5's telemetry receiver is for Claude Code only: Grok Build reports each turn's cost itself, and Hermes passes one on when its model provider reports it; when it does not, est. prices the turn.
4. Check Before the First Turn¶
alr check
Before the first turn there is no record file yet, so alr check says so on one line and exits with status 1:
alr: no records yet: <home>/records.jsonl does not exist (set $ALR_EMIT_SINK or name a file)
That is the expected result on a new install, not an error. <home> is ~/.alr-emit unless ALR_EMIT_HOME is set (on Windows, %USERPROFILE%\.alr-emit).
sam@studio:meeting-cost-meter$ alr check
alr: no records yet: <home>/records.jsonl does not exist (set $ALR_EMIT_SINK or name a file)
sam@studio:meeting-cost-meter$ echo exit=$?
exit=1
sam@studio:meeting-cost-meter$
5. Start the Receiver, Then Claude Code¶
Claude Code reports a session's cost once, when the session ends. Without help, OpenALR can only give each turn an allocated share of that total. With the receiver running before Claude Code starts, each turn gets its own figure. This is the difference between knowing what the session cost and knowing what each request in it cost, and Priya's later questions are all of the second kind.
The order matters: the receiver first, then three settings, then Claude Code.
alr otel start
The default port is 4318, and --port changes it. The command starts a receiver on your own machine and sets four Claude Code telemetry settings. alr otel status shows them, and alr otel stop removes them.
sam@studio:meeting-cost-meter$ alr otel start
alr otel start: started the sink at http://127.0.0.1:4318/<token>/v1/logs (pid 156710; log <home>/state/otel/sink.log)
alr otel start: set CLAUDE_CODE_ENABLE_TELEMETRY, OTEL_LOGS_EXPORTER, OTEL_EXPORTER_OTLP_LOGS_PROTOCOL, OTEL_EXPORTER_OTLP_LOGS_ENDPOINT in ~/.claude/settings.json
alr otel start: restart claude: a running claude keeps its old settings until it is restarted
sam@studio:meeting-cost-meter$ alr otel status
alr otel status: settings file ~/.claude/settings.json
sink: running (pid 156710) at http://127.0.0.1:4318/<token>/v1/logs
CLAUDE_CODE_ENABLE_TELEMETRY: set by alr
OTEL_LOGS_EXPORTER: set by alr
OTEL_EXPORTER_OTLP_LOGS_PROTOCOL: set by alr
OTEL_EXPORTER_OTLP_LOGS_ENDPOINT: set by alr
managed settings: none set these variables (/etc/claude-code/managed-settings.json and its managed-settings.d)
otel-sink: reachable at http://127.0.0.1:4318/<token>/v1/logs
otel-sink: token accepted
otel-sink: /v1/logs answers
sam@studio:meeting-cost-meter$
Then, in the same shell, name the agent, say what kind of dollars the records hold, and name the person. ALR_PRINCIPAL names the person who issues and accepts plans, from WE 01 on; turn records do not carry it.
$env:ALR_EMIT_AGENT_ID = "agent-sam"
$env:ALR_PRINCIPAL = "sam"
$env:ALR_EMIT_COST_BASIS = "metered"
$env: settings last for that PowerShell window only, so start Claude Code from the same window.
export ALR_EMIT_AGENT_ID=agent-sam
export ALR_PRINCIPAL=sam
export ALR_EMIT_COST_BASIS=metered
Sam's agent work is billed through an API key, so its dollars are metered: what the tool reported being charged. Now start Claude Code from that shell:
claude
6. Prove It¶
Give the agent one small turn. Sam's first prompt to the empty repository is the brief itself: he asks the agent to add Priya's line, "show what a meeting costs while it runs," to the README. It is the smallest real piece of work the project has, and it is the first thing the recorder sees. Then, in a second shell, he reads what that turn left behind:
alr turns last
sam@studio:meeting-cost-meter$ alr turns last
session 821890a4-8f39-49bb-ac5a-362b1ef32126 · claude-code · agent-sam · 1 record
# finished (UTC) model input output cache rd cache wr cost est. outcome grade tags
- ------------------- --------------- ----- ------ -------- -------- --------- -------------------- ------- ----- ----
1 2026-12-01 03:59:43 claude-opus-5-5 4 281 37.8k 7.4k in parent $0.0500 (for parent) ok
cost basis: m = metered, a = api-equivalent, ? = unstated; * = from a cost correction; '+' = lower bound; sub = a subagent record; aux = an auxiliary call, no turn of its own; session = the session's own record; a basis is shown only when the record states one (a harness-reported cost with no stated basis shows ?); 'in parent' = its cost is inside its parent's; 'share' = its share of that cost, never added ('alloc.' = allocated, not measured); '(for parent)' = an estimate standing in for the parent's unknown cost.
est.: ESTIMATE from price book alr-prices/0.3 as of 2026-12-01 (estimate at public API list prices as of 2026-12-01; not a bill); only for records with no reported cost; never added to reported cost.
sam@studio:meeting-cost-meter$
The turn is on record, with its model and its tokens, but not yet with its cost. Its cost column reads "in parent": in Claude Code, a turn's cost sits inside its session's. The cost itself comes from Claude Code's telemetry, which reaches the receiver a moment after the turn ends, so the record written at the end of the turn does not have it yet. Until it arrives, est. stands in with a price-book estimate, marked "(for parent)", and is never added to anything.
The figure arrives with the next turn, or when the session ends. Sam quits Claude Code with /exit and reads again, with alr summary this time as well:
alr turns last
alr summary
sam@studio:meeting-cost-meter$ alr turns last
session 821890a4-8f39-49bb-ac5a-362b1ef32126 · claude-code · agent-sam · 2 records
# finished (UTC) model input output cache rd cache wr cost est. outcome grade tags
------- ------------------- --------------- ----- ------ -------- -------- --------------- ---- ------- ----- ----
1 2026-12-01 03:59:43 claude-opus-5-5 4 281 37.8k 7.4k share $0.0571 m ok
session 2026-12-01 03:59:43 0 0 0 0 $0.0571 m ok
cost basis: m = metered, a = api-equivalent, ? = unstated; * = from a cost correction; '+' = lower bound; sub = a subagent record; aux = an auxiliary call, no turn of its own; session = the session's own record; a basis is shown only when the record states one (a harness-reported cost with no stated basis shows ?); 'in parent' = its cost is inside its parent's; 'share' = its share of that cost, never added ('alloc.' = allocated, not measured); '(for parent)' = an estimate standing in for the parent's unknown cost.
est.: ESTIMATE from price book alr-prices/0.3 as of 2026-12-01 (estimate at public API list prices as of 2026-12-01; not a bill); only for records with no reported cost; never added to reported cost.
sam@studio:meeting-cost-meter$ alr summary
day records input output cache rd cache wr metered est.
---------- ------- ----- ------ -------- -------- ------- ----
2026-11-30 2 4 281 37.8k 7.4k $0.0571
---------- ------- ----- ------ -------- -------- ------- ----
total 2 4 281 37.8k 7.4k $0.0571
2 current records, 2 requests; days in local time.
Reported cost is the figure on each record, kept per cost basis and never added across bases. '+' marks a lower bound (a figure in it is unknown or partial).
est.: ESTIMATE from price book alr-prices/0.3 as of 2026-12-01 (estimate at public API list prices as of 2026-12-01; not a bill); only for records with no reported cost; never added to reported cost.
sam@studio:meeting-cost-meter$

Now the turn reads "share $0.0571 m": a metered figure (the m), Claude Code's own report. It is the turn's share of the session's cost, and with one turn in the session, the share is the whole of it. The session's own record carries the same $0.0571. alr summary counts it once.
alr summary groups by day in local time. Sam ran the take on the evening of November 30, Central time, so the day reads 2026-11-30, while the records' own times are in UTC, early on December 1.
Inside Claude Code, /alr-turns shows the turns inside the session, and /alr-ctl shows metering status and lets you control it.
If a turn's cost shows ? in alr turns or alr summary (an em dash in /alr-turns) even after the session ends, Claude Code was already running when the receiver started: quit it and start it again from the shell where the settings were made. A ? is an unknown cost, and the tool says so rather than printing a zero.
This home is the one every later example reads. Sam does not reset it.
7. Open the Dashboard¶
The same records make a dashboard: static pages written to a folder and opened in a browser. Nothing is sent anywhere.
alr dashboard --out $HOME\alr-dashboard --open
alr dashboard --out ~/alr-dashboard --open

With one turn on record there is little to see yet: $0.06 metered, and "n/a" in the other columns, which means no record has that kind of cost, not $0.00. The page fills in as the work grows; WE 01 reads its Earned Value and Quality sections. Use the Dashboard walks through every section.
What the Records Said¶
The proof turn left three lines in the record file. The file is on your machine, and nothing leaves it.
%USERPROFILE%\.alr-emit\records.jsonl, unless ALR_EMIT_HOME is set. If HOME is set, as it is under Git Bash, it wins over USERPROFILE.
~/.alr-emit/records.jsonl, unless ALR_EMIT_HOME is set.
Here are the three lines from the take, each cut down to the fields this page reads:
{"alr_id": "6141d755-2f81-5b50-b153-cdeb3d5543c6", "alr_schema": "alr/0.1", "request_id": "821890a4-8f39-49bb-ac5a-362b1ef32126:t0001", "agent_id": "agent-sam", "harness": "claude-code", "model": "claude-opus-5-5", "tokens": {"input": 4, "output": 281, "cache_read": 37801, "cache_write": 7366}, "attempt": 1, "parent_inclusion": "cost_in_parent", "cost_usd": null, "pricing_source": "unknown"}
{"alr_id": "7bcc6218-88ac-52c4-8c6e-ddd08d10f353", "alr_schema": "alr/0.1", "request_id": "821890a4-8f39-49bb-ac5a-362b1ef32126:t0001", "agent_id": "agent-sam", "harness": "claude-code", "model": "claude-opus-5-5", "tokens": {"input": 4, "output": 281, "cache_read": 37801, "cache_write": 7366}, "attempt": 2, "supersedes": "6141d755-2f81-5b50-b153-cdeb3d5543c6", "parent_inclusion": "cost_in_parent", "cost_usd": null, "cost_share_usd": 0.057130099999999996, "cost_basis": "metered", "pricing_source": "harness_reported", "claude_code_cost": {"by_query_source": {"generate_session_title": 0.0001273, "prompt_suggestion": 0.0069766, "repl_main_thread": 0.0500262}}}
{"alr_id": "50310b1d-09ff-50f6-8c6e-381a6b8d7d10", "alr_schema": "alr/0.1", "request_id": "821890a4-8f39-49bb-ac5a-362b1ef32126", "agent_id": "agent-sam", "harness": "claude-code", "tokens": {}, "attempt": 1, "cost_usd": 0.057130099999999996, "cost_basis": "metered", "pricing_source": "harness_reported"}
Read them in order:
- The turn, as first written. At the end of the turn, the cost was not known yet:
cost_usdisnull,pricing_sourceisunknown, and there is nocost_basis.parent_inclusionsays the turn's cost belongs inside its session's. - The same turn, written again. When the cost arrived, OpenALR did not edit the first line. It wrote a second attempt that
supersedesthe first, by itsalr_id. This one carriescost_basis: metered,pricing_source: harness_reported, andcost_share_usd, the turn's share of the session's cost. - The session. Its own record carries the session's
cost_usd, $0.0571, metered.
Read these fields:
alr_schema: which version of the record format the line follows.harness: which tool did the work.model: which model answered.tokens: the token counts the harness reported. Tokens are measured.cost_usd: the dollars for the record. It may benull. A cost nobody knows is unknown, not zero.cost_basis: the kind of dollars,meteredorapi-equivalent. When it is absent, it shows as unstated.pricing_source: on a record,harness_reportedorunknown. The emitter itself never prices.attemptandsupersedes: a newer line for the same request replaces an older one, and the older one stays in the file. Nothing is edited in place.
That is the whole receipt for one request: who did it, with what, how many tokens, and what kind of dollars. It is the same idea as the timer Priya asked for, pointed the other way.
The second line also shows where the money went inside the turn, in Claude Code's own breakdown (claude_code_cost.by_query_source). The reply itself cost $0.0500. Two small calls Claude Code makes on its own account cost the rest: a suggested next prompt ($0.0070) and a title for the session ($0.0001). The est. of $0.0500 in the first read priced the turn's own tokens and matches the reply. The metered figure is what was charged, side calls included.
The site uses three phrases for where a dollar figure came from, and every later example leans on them. An own figure is one the harness or its telemetry reported for that turn. An allocated share is a slice of a session total, which is what Claude Code gives without the receiver. est. is a price-book estimate for a record that has no reported cost. It sits in its own column and is never added to anything. Do not read est. as API-equivalent, which is a cost_basis: measured tokens priced at list API rates, an estimate. Metered (charged) figures and API-equivalent figures are never added together.
The proof turn's figure is an own figure, not an allocated share: it is metered and harness_reported, and its record has no cost_allocation, the field OpenALR adds when it has to divide a session total among turns.
The proof turn's basis should read metered. If it reads unstated, ALR_EMIT_COST_BASIS was not set in the shell that started Claude Code. Setting it later does not change records already written: quit Claude Code, set it, and start Claude Code again. The earlier record stays as it is, unstated, and is never guessed.
The Decision¶
Priya read the proof turn on Sam's screen and decided to go ahead. The recorder works, the record is on disk, and she can read it without help. She did not decide whether the timer is worth building. There is nothing yet to weigh against a cost.
What she did decide is small and concrete. The next piece of agent work gets a plan before it starts: three tasks, a budget for each, and her own estimate of what the work would take by hand. Every turn will be tagged to one of those tasks. When Tom asks his question again, it will be about something with a record.
For Your Role¶
For Developers
Install in this order: uv, OpenALR, the harness wiring, then the receiver and the three settings, and only then start the harness. Preview with no --yes before you apply, and read the preview. An empty-home alr check exits 1 with "no records yet"; that is expected before the first turn.
For Managers
The decision this page asks of you is to record before the work starts, not after the bill. The install is short. The proof turn tells you the recorder works, which is the thing to know before you plan anything.
For Finance
The record file is local, and the tool prices nothing on its own authority: each figure says where it came from. A cost with no known figure is shown as unknown, not as zero.
For Accounting
Nothing is booked yet. Note where the record file lives and what the basis words mean, because every later figure carries one. Charged figures and API-equivalent estimates stay apart.
For Executives
There is nothing to judge yet, and that is the point. This page's only claim is that the first piece of work will have a record. Whether the work was worth it stays your call, now with figures to make it on.
Next¶
Sam has a working recorder, an empty repository with one line in its README, and a brief on a whiteboard. In the next example, WE 01: Hello World, he builds the live meter: a start button, the number of people, an average rate, and a cost that ticks up while the meeting runs, $10 a minute for the review that started all this. Priya plans it as three tasks before the first prompt, and at the end the records put a cost beside each one. That is the first time Tom can ask "was it worth it" with figures in front of him, about the meeting and about the agent work that built the timer.
-
Added after the take. The December 1 price book was published later on the day Sam made his first record, so this step was captured then, with the same release on a clean machine. The outputs in step 6 were read again at the same time, from the same records, and name the December 1 book. Every figure in them is unchanged: the two books price Claude Opus 5.5 the same. ↩