kaizen
Run and share kaizen so you can see how coding agents behave in real time, run retros on that stream, and turn it into strategies to improve your own repo. Unifies Cursor, Claude Code, and Codex. One SQLite store and one CLI; redact before any sync, and only sync on your terms.
Narrative guides and references live in this repository under docs/. The
crate is on crates.io as kaizen-cli (cargo install kaizen-cli installs the kaizen binary); the Rust API is on
docs.rs/kaizen-cli. Long-form markdown stays in this repo.
See Install for cargo install, git clone, and PATH.
Why
- Cost visibility — tokens and USD per session, per model, per agent.
- Session history — searchable, live-tailable, across all three agents.
- Heuristic retro — weekly bets: what to change to make agents cheaper / faster.
- Experiments — A/B a rule, skill, or repo change against a real metric.
- Fits your topology — self-host, laptop, or a shared place your team can use; tailable session streams; you decide when anything syncs and redact first.
Why kaizen over the alternatives
| You want… | Existing tool | Kaizen |
|---|---|---|
| Cost per session for Claude Code | ccusage, claude-usage-report |
✅ plus Cursor + Codex + hook provenance |
| Cost per session for Cursor | none (transcripts strip usage) | ✅ best-effort token + model from transcript tail |
| One pane of glass across agents | glue scripts | ✅ unified store, one CLI, one MCP |
| Turn observations into change | dashboards only | ✅ weekly heuristic retro + experiments (A/B) |
| Self-host, not locked to a vendor cloud | needs an account | ✅ deploy the binary, tail agent sessions live, SQLite + optional redacted sync |
| Ship MCP tools to agents | depends | ✅ most commands as MCP tools; shell-only for doctor, guidance, gc, completions, proxy, telemetry |
| Rust, single static binary, sub‑second cold start | varies | ✅ build from a checkout (cargo install --path . or ./scripts/install-local.sh) |
Kaizen is not a dashboard — it is an opinionated feedback loop: capture → summarise → propose change → measure. Start with kaizen init in any repo where you use a coding agent.
How it works (about 60 seconds)
Kaizen does not run the model. It observes agent activity: conversation and tool use land in local SQLite; optional HTTP proxy logging adds another path. A metrics pass ties sessions to file-level and graph facts so the CLI, TUI, retro, and experiments can reason about your repo, not just token totals. Read the full pipeline (with a diagram) in docs/telemetry-journey.md.
| If you want… | Start here |
|---|---|
| Cost and rollups by agent / model | docs/usage.md (summary, metrics) |
| Browse and tail sessions | docs/usage.md (sessions, tui) |
| Heuristic “what to change” weekly bets | docs/retro.md |
| A/B a rule or change against a metric | docs/experiments.md |
| The end-to-end data story (ingest → store → facts) | docs/telemetry-journey.md |
| Hands-on tutorial (all features, exercises) | docs/tutorial/README.md |
Demo
https://github.com/user-attachments/assets/3cf4ac40-cef7-480a-9bea-af69df06f3c6
Install
You need Rust 1.95+ (rustup). Git is only required for a source build.
-
Install the CLI from crates.io (writes
kaizento~/.cargo/bin, or$CARGO_HOME/bin):Or use Homebrew from a tap once you publish
packaging/homebrew/kaizen-cli.rbto ahomebrew-taprepo:brew tap <user>/tap && brew install kaizen-cli(installs the samekaizenbinary). See docs/install.md. -
Or build from a git clone (for contributors and
--pathinstalls):Equivalent:
cargo install --path . --lockedfrom the repo root (use--forceto replace an existing install). -
Confirm
kaizenis on yourPATH(rustup usually adds~/.cargo/bin). If the shell cannot findkaizen, add that directory toPATHand open a new terminal. -
Run
kaizenin your own project (where you use Cursor / Claude Code / Codex), not only inside the kaizen repo:
Step-by-step guide, uninstall, and troubleshooting: docs/install.md.
Quick start
kaizen init creates both hook files when absent and patches them idempotently when present. Re-running is safe; originals back up under .kaizen/backup/.
Full CLI reference: docs/usage.md. Guided walkthrough: docs/tutorial/README.md.
Docs
| Doc | Purpose |
|---|---|
| docs/install.md | Install, build from source, uninstall |
| docs/tutorial/README.md | Hands-on tutorial (all major features) |
| docs/usage.md | CLI reference |
| docs/concepts.md | Sessions, events, retro, experiments |
| docs/architecture.md | Module graph, data flow |
| docs/config.md | Config file + env vars |
| docs/telemetry-journey.md | How sessions become stored facts (learning path) |
| CONTRIBUTING.md | Dev setup, tests, PR flow |
| CHANGELOG.md | Release notes |
Status
Pre–1.0: breaking changes may appear in minor versions (see CHANGELOG.md). Feature set for the initial public line is shipped; follow the changelog for new work.
License
AGPL-3.0-or-later. Contributions are licensed under the same terms. See CONTRIBUTING.md.
Security disclosures: SECURITY.md.