Developers
The ebrbe CLI
Timer and time logging from your terminal, and every Claude Code or Codex session's token cost logged to the right client, without thinking about it.
Install and sign in
Node.js 20 or newer, on Windows, macOS or Linux. The package has no dependencies.
npm install -g @ebrbe/cli
ebrbe loginebrbe login shows a short code and opens https://ebrbe.com/device. Sign in there, check the code matches, pick the workspace and the permissions, and approve. The CLI then receives a personal API key (shown nowhere else) and stores it in your config folder, readable only by you:
| OS | Config folder |
|---|---|
| Linux | $XDG_CONFIG_HOME/ebrbe (~/.config/ebrbe) |
| macOS | ~/Library/Application Support/ebrbe |
| Windows | %APPDATA%\ebrbe |
Revoke the key any time in Settings → Developers. For CI, skip login and set EBRBE_API_KEY (and EBRBE_URL, EBRBE_WORKSPACE) instead. The sign-in uses the OAuth 2.0 device authorization grant (RFC 8628): codes last 10 minutes, are single use, and requests are rate limited.
Commands
| Command | Does |
|---|---|
ebrbe start "Fix login" -p WEB -t WEB-12 | Start the timer (stops a running one first). |
ebrbe stop | Stop it and save the entry. |
ebrbe status | What's running, and today's total. |
ebrbe log 1h30 "Code review" -p WEB --date 2026-10-27 | Log time without the timer. |
ebrbe agent log --model claude-opus-5-5 --input 120000 --output 8000 -p WEB | Log an AI-agent run (cost from eBRBe's price table, or --cost USD). |
ebrbe link -p WEB | Write .ebrbe.json here so commands and hooks in this repo use project WEB. |
ebrbe whoami | Who, which workspace, which scopes. |
-p takes a project key (WEB), id or name; -t a work item like WEB-12. --workspace slug acts in another of your workspaces.
Map a repo to a project: .ebrbe.json
{
"workspace": "acme",
"project": "WEB",
"billable": true
}The CLI and the hooks look for .ebrbe.json from the current folder upwards. Commit it: it holds no secrets. work_item pins a task, tool renames the tool in the ledger, and "agent": false stops hooks from logging sessions in that repo.
Claude Code hook
ebrbe hook claude-code # ~/.claude/settings.json (every project)
ebrbe hook claude-code --scope project # .claude/settings.json in this repo
ebrbe hook claude-code --uninstallThis adds a SessionEnd and a Stop hook running ebrbe hook claude-code-run. When a turn or session ends, the hook reads the session transcript Claude Code passes it (transcript_path), sums token usage per model, and logs one agent run per model for the usage added since its last run, against the project in .ebrbe.json.
- Never in your way: the hook hands the work to a background process and returns at once; it never prints to Claude Code and always exits 0. Problems go to
<config folder>/logs/hooks.log. - Idempotent: each run's
external_idisclaude-code:<session id>:<model>:<n>. A retried post returns the existing run; resumed sessions and repeated Stop events only add the new usage. --only-mappedlogs only repos with a.ebrbe.jsonproject.ebrbe sync claude-code --days 7logs recent sessions now (backfill).
Why the transcript and not OpenTelemetry
Claude Code's OpenTelemetry export is opt-in per machine, needs a collector, and sends metrics and log events rather than spans, aggregated per export interval. The transcript is always written, has the exact usage of every API response with its message id (so duplicates can be dropped), and the hook receives its path and the session id when the session ends. The hook counts each message once (the last line for a message id, since streamed responses are written several times), reads input_tokens, output_tokens, cache_read_input_tokens and cache_creation_input_tokens, includes sub-agent transcripts, and ignores lines it doesn't recognise. Teams that already run an OTel pipeline for their own agents can use the OTLP endpoint instead.
Codex
ebrbe hook codex # adds notify = ["ebrbe", "hook", "codex-run"] to ~/.codex/config.toml
ebrbe sync codex --days 7 # or log recent sessions nowCodex runs its notify program after every turn with the session (thread) id. The hook finds that session's rollout file in ~/.codex/sessions and logs the increase of its cumulative token_count totals per model, the same way as for Claude Code (codex:<session>:<model>:<n>). Codex allows one notify program: if you already have one, the CLI leaves it and you can call ebrbe hook codex-run '<json>' from yours, or run ebrbe sync codex on a schedule.
Prices: eBRBe's price table ships Anthropic models only, so OpenAI model runs are refused ("No price for model") until a platform admin adds the model in Admin → Model prices. Sessions on a ChatGPT plan have no per-token bill; log them only if you want the token record.
Cursor
Not automated yet. Cursor doesn't keep per-request token usage on disk the way Claude Code and Codex do, and its hooks don't receive token counts, so a local hook has nothing reliable to read. Usage is available to team admins in Cursor's dashboard and its Admin API; syncing that (like the Anthropic and OpenAI usage sync) is what's needed and is on the roadmap. Until then, log Cursor work with ebrbe agent log or the MCP log_agent_run tool, or connect the provider account Cursor bills through.