Read the session
Point RunLedger at a folder where an agent ran. It finds the newest session and parses every step: tool calls, files, models and token usage.
Recording every run
A receipt for every run, and a guard that stops risky commands before they execute.
The problem
A diff shows what ended up on disk. It does not show the files the agent read, the commands it ran or the tests it deleted along the way.
By the time you read the log, the force push, the .env read or the rm -rf has already happened.
Tokens are spread across models and steps. It is hard to tell which step used the budget, or whether a cheaper model would have done.
How it works
RunLedger reads the session logs your agent already writes. No wrapper, no proxy, nothing between you and your tools.
Point RunLedger at a folder where an agent ran. It finds the newest session and parses every step: tool calls, files, models and token usage.
Files changed with lines added and removed, each step in plain language, the model and tokens per step, an estimated cost, a risk score from 0 to 100 and a quality grade. Known secret formats are masked.
Native hooks for Claude Code, Codex CLI and Factory Droid check every tool call against the same rules as the receipt. They deny, ask or allow before anything executes.
Optionally, --review has Claude mark each finding as confirmed, false positive or uncertain. The rule-based score never changes. In CI, --fail-on 60 fails the job on high scores.
Features
Files changed with lines added and removed, every step in plain language, the model and tokens for each step, and the reason behind each risk finding.
Each point has a reason a reviewer can check.
Estimated from public list prices, with tips on where a cheaper model would do.
Tests run, retries, scope and unfinished work, all listed with their points.
Known token formats and key assignments are hidden. Pattern-based, so treat receipts like transcripts.
Exit with a non-zero code when the score reaches your threshold.
API keys with roles, audit log, approvals, budgets and compliance exports.
Quality over time, model and agent comparison, and the top cost tips in the team dashboard.
Save the working tree before an agent edits it. Restore everything, or one file or folder with --path, with a safety checkpoint each time and automatic pruning of old checkpoints.
runledger stats totals sessions, steps, tokens and cost by agent, model, day or project, with the risk and quality spread and the top findings.
runledger doctor checks the installed hooks for each agent, the config, the approval server and the price table, and exits 1 or 2 when something is wrong.
One install command writes the hook for Claude Code, Codex CLI or Factory Droid in that agent's own format. Codex has no prompt, so ask becomes a deny with the reason.
Model Context Protocol calls are rated by what they do, not by their name: read tools pass, tools that delete, drop or destroy ask first, and SQL passed to a query tool is inspected before it runs.
Around twenty more dangerous commands are known by default, and your own command_rules and tool_rules add to them. A project can only tighten the rules, never loosen them.
A documented session format means no adapter is needed to get scores and pushes.
No telemetry and no runtime dependencies. Network calls happen only when you ask for them.
Supported agents
Each adapter turns the agent's own log into common steps, so risk rules and receipts work the same everywhere.
--agent claude-codeReads ~/.claude/projects/. Real-time guard hook, with deny, ask and allow decisions.
--agent codexReads rollout files in ~/.codex/sessions/. Real-time guard hook, where ask maps to deny.
--agent droidReads transcripts in ~/.factory/sessions/, with model and token usage. Real-time guard hook.
--agent aiderReads .aider.chat.history.md in your project.
--agent nativeWrite a .runledger.json file and get the same receipts. Read the format
Real-time guard
The guard installs as a native hook in Claude Code, Codex CLI and Factory Droid. Before each tool call runs, it decides deny, ask or allow. Pick a call to see the default policy at work.
Recursive force delete (rm -rf)
The call is blocked. Claude Code is told why and the command never runs.
Install with runledger guard install --agent claude-code|droid|codex|all, remove with runledger guard uninstall, and check what is installed with runledger doctor. If the guard cannot evaluate a call it fails open by default, or closed if you set it. Guard docs
GitHub Action
One sticky comment per pull request, updated on every push. Add a threshold and the job fails when a run is too risky.
name: RunLedger receipt on: pull_request permissions: contents: read pull-requests: write jobs: receipt: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: kodji7202-code/runledger@v0.7.0 with: fail-on: "60" # fail at 60 or above
Commit the sessions you want reviewed to .runledger/sessions/. Review them first: a session file can contain secrets. Action docs
Self-host
Developers push receipts, the team reads them in one dashboard. The server uses only the Python standard library and a single SQLite file, with a Docker Compose setup for HTTPS.
runledger team create myteam --db runledger.dbcreate the team, prints its API key oncerunledger serve --db runledger.dbstart the server on 127.0.0.1:8787open http://127.0.0.1:8787/?key=YOUR_KEYsign in to the dashboard onceexport RUNLEDGER_SERVER=http://127.0.0.1:8787on each developer's machine, with RUNLEDGER_API_KEYrunledger push --user "ana@example.com"push the latest runOpen source
The CLI, the guard, the Action and the team server are all open source. Read the code, run the tests, send a patch.
FAQ
receipt, list and the guard run locally, and RunLedger has no telemetry. The network is used only when you ask: pushing to your team server, webhooks you set, the GitHub API in the Action, and the Anthropic API when you use --ai or --review.API_KEY=..., --token flags and passwords in URLs are masked in receipts, pushes and PR comments. Masking is pattern-based, so an unusual secret can get through. Treat a receipt like the transcript it came from.rm -rf, force pushes, curl | sh, DROP TABLE, npm publish and kubectl apply. It asks before sudo, reading a .env file, writing outside the project, deleting a test, and MCP tools that delete, drop or destroy. You can change the policy in ~/.runledger/config.json.--review and --ai are opt-in and send redacted session content to Anthropic using your own API key.--ai and --review are optional and use your own Anthropic API key.runledger guard uninstall (add --global for every project) to remove the hook and keep your other Claude Code settings, then pip uninstall runledger-ai.Start recording
Install, run your agent, then open the receipt. It takes about a minute.