AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
翻譯準備中
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證Audit, cost and real-time guard for AI coding agents (Claude Code, Codex CLI, Aider)
翻譯準備中
取自儲存庫 README
正在載入完整 README。 以下為已儲存的摘錄。
Receipts, cost and a real-time guard for AI coding agents.
RunLedger reads the session logs of your coding agents and turns each run into a receipt: what
changed, what ran, which model did each step, what it cost, and what looked risky. A Claude Code hook
can stop risky calls before they run, and a small team server collects receipts from the whole team.
Version 0.4.1. Python 3.9 or later, no runtime dependencies.
The receipt is saved as runledger- .html in the current folder.
More in docs/quickstart.md.檢視完整 README ↗Receipts and safe rollback for AI coding agents.
RunLedger reads the session logs of your coding agents (Claude Code, Codex CLI, Factory Droid and Aider) and turns each run into a receipt: what changed, what ran, which model did each step, what it cost, and what looked risky. A Claude Code hook can stop risky calls before they run, and a small team server collects receipts from the whole team. Local Git checkpoints let you restore files from before a run, with a safety checkpoint for undo.
RunLedger is fully free and open source, including the self-hosted team server. Version 0.7.0. Python 3.9 or later, no runtime dependencies.
pip install runledger-ai # or `pip install .` from a clone of this repository
cd ~/my-project # a folder where you ran a coding agent
runledger receipt --open # latest session as an HTML receipt, opened in your browser
The receipt is saved as runledger-<first 8 characters of the session id>.html in the current folder.
More in docs/quickstart.md.
--review), optional: Claude marks each finding as confirmed, false
positive or uncertain. The rule-based score does not change.--ai), optional. This sends session content to Anthropic. See
Privacy.runledger receipt --fail-on 60 exits with code 2 when the score is 60 or more.runledger doctor reports every hook, config, approval, log, checkpoint,
price and session detail it can read, with exit codes 0/1/2 for CI. See
docs/doctor.md.runledger stats adds up sessions, steps, tokens, cost, risk, quality and
guard decisions over a window, grouped by agent, model, day, week or project, as a table, JSON or
Markdown. It runs no Git, network or AI, is read-only, and caches its parse in
~/.runledger/cache/stats-v1.json. See docs/stats.md.| Agent | --agent | Status | Reads sessions from |
|---|---|---|---|
| Claude Code | claude-code | Stable | ~/.claude/projects/<project>/ |
| Codex CLI | codex | Beta | $CODEX_HOME/sessions/ (default ~/.codex) |
| Factory Droid | droid | Beta | $FACTORY_HOME/sessions/<encoded project folder>/ (default ~/.factory; FACTORY_HOME_OVERRIDE names the home instead) |
| Aider | aider | Beta | .aider.chat.history.md in the project folder |
| Any agent | native | Open format | <project>/.runledger/runs/ |
Any agent can write the RunLedger format and get receipts, risk scores and pushes without an adapter. The specification is in docs/format.md. Details per agent are in docs/agents.md.
runledger checkpoint --label "Before agent run" # prints a checkpoint id
runledger checkpoints # list snapshots and differing files
runledger rollback CHECKPOINT_ID --dry-run # preview restored and removed files
runledger rollback CHECKPOINT_ID --path src/app.py # restore only this file or folder
runledger rollback CHECKPOINT_ID # confirm, save safety checkpoint, restore
runledger rollback SAFETY_CHECKPOINT_ID # undo using the id printed by rollback
runledger checkpoints prune --keep 50 # or --older-than 30d
Requires Git, but no Git identity setup. Ignored untracked files stay untouched.
Rollback never changes HEAD, branches, staging, or stashes. Scripts must pass --yes to restore;
use --dry-run to preview without restoring.
Use --run SESSION_ID when creating a checkpoint to include its rollback command in the session
receipt. guard install also installs automatic session-start and pre-prompt
checkpoints for Claude Code, Droid and Codex. docs/rollback.md covers hooks,
selective --path restores, pruning and limits.
runledger team create myteam --db runledger.db # 1. create the team; prints its API key once
runledger serve --db runledger.db # 2. start the server on http://127.0.0.1:8787
# 3. open http://127.0.0.1:8787/?key=YOUR_KEY once, then use the plain address
export RUNLEDGER_SERVER=http://127.0.0.1:8787 # 4. on each developer's machine
export RUNLEDGER_API_KEY=YOUR_KEY
runledger push --user "[email protected]" # 5. push the latest run
For a shared server, serve it over HTTPS: docs/self-hosting.md has a Docker Compose setup with automatic certificates and a bare-metal setup behind nginx. docs/enterprise.md covers roles, key rotation and the audit log.
runledger guard install # 1. this project: .claude/settings.json
runledger guard install --agent droid # or Factory Droid: .factory/hooks.json
runledger guard install --agent codex # or Codex CLI: .codex/hooks.json
runledger guard test '{"session_id":"s1","cwd":"/work/my-app","tool_name":"Bash","tool_input":{"command":"rm -rf /"}}' # 2. see a decision
runledger guard install --global # 3. or every project: ~/.claude/settings.json
runledger guard uninstall # remove it again (--global for ~/.claude)
By default the guard denies a hardcoded secret written into a file and high-severity commands such
as 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, or calling a
destructive MCP tool such as mcp__supabase__delete_project. Everything else
is allowed. Two settings files control it: your own ~/.runledger/config.json may set anything, and a
project's .runledger.json may only make the guard stricter. See docs/guard.md.
Post a receipt on every pull request. Commit the session files you want reviewed to
.runledger/sessions/: Claude Code .jsonl transcripts, Codex rollouts, Factory Droid transcripts
(with their .settings.json sidecar, which carries the token usage), or .runledger.json written by
any agent. Then add this workflow:
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/[email protected]
with:
fail-on: "60" # the job fails at 60 or above; "" never fails
Details, inputs and the exit codes are in docs/github.md.
RunLedger is local first. receipt, list and the guard run on your machine. RunLedger has no
telemetry. The network calls it makes are the ones you ask for: pushing to your team server, the
guard's approval requests to the server you configure, webhooks you set, the GitHub API in the
action, and the Anthropic API only when you use --ai or --review.
What a receipt contains:
A receipt does not contain file contents or command output (only test pass and fail counts).
Secrets are masked in everything a receipt shows, and so in what push sends and in the PR
comment: known token formats (Anthropic, OpenAI, AWS, GitHub, GitLab, Slack, Stripe, Google, npm,
Hugging Face, RunLedger keys, JWTs, Bearer and Basic values, private-key headers), assignments such
as API_KEY=…, password="…" and ?access_token=…, flags such as --token …, and passwords in URLs.
Masking is pattern-based, so an unusual secret can still get through. Treat a receipt like the
session transcript it came from.
Safe mode is on by default for receipts written inside a Git repository (HTML included) and
for Markdown and JSON written to stdout, and always on for the PR comment: local paths are
shortened (repository-relative, ~ for the home folder) and e-mail addresses are masked. A
receipt written outside a repository keeps full paths unless --safe is passed. Use --safe or
--no-safe to choose. See docs/quickstart.md.
--ai sends the prompts, each step's inputs (up to 600 characters per field, which can include
file contents being written), each tool result (up to 400 characters) and the agent's final message to
api.anthropic.com. Do not use it on sessions you may not share with that service.--review sends prompts, commands, relative file paths, edit snippets and the rule findings to
Claude Sonnet for an explanation of each risk. Tool output is not sent. See
docs/analysis.md.[EMAIL], home folders
(C:\Users\<name>, /Users/<name>, /home/<name>) become ~..., and known secret formats become
[REDACTED]. Masking is pattern-based, so an unusual secret can still get through..runledger/guard.log) records tool names, commands and paths, masked the same
way. Add .runledger/ to your .gitignore.RUNLEDGER_RETENTION_DAYS enables automatic retention. See
docs/self-hosting.md.Cost figures estimate LLM token usage from public API list prices, not a charge for RunLedger.
Read them as "what this run would cost on the API". Optional --ai and --review calls use
your Anthropic API key and may incur charges from Anthropic.
--agent--json, exit codes and guard statuspython -m pip install -e . pytest
python -m pytest -q
RunLedger is licensed under the Apache License 2.0; see LICENSE. To report a security problem, email [email protected] and do not open a public issue. See SECURITY.md.
RunLedger · runledger.site · [email protected]