Borrowing it
Nothing to install: this file belongs to TheIllusionOfLife/AgentKaizen. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/TheIllusionOfLife/AgentKaizen/main/CLAUDE.mdgit clone --depth 1 https://github.com/TheIllusionOfLife/AgentKaizenWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/theillusionoflife/agentkaizen/claude-md)<a href="https://agentmods.dev/instructions/theillusionoflife/agentkaizen/claude-md"><img src="https://agentmods.dev/badge/instructions/theillusionoflife/agentkaizen/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/theillusionoflife/agentkaizen/claude-md"><img src="https://agentmods.dev/badge/instructions/theillusionoflife/agentkaizen/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.02119 | $0.02119 |
| Opus 5.5 | $0.00848 | $0.00848 |
| Sonnet 5.5 | $0.00424 | $0.00424 |
| Haiku 4.5 | $0.00212 | $0.00212 |
Grade B, and why
AgentKaizen CLAUDE.md scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
- `ClaudeCodeRunner.run()` strips `CLAUDECODE` and all `CLAUDE_CODE_*` env vars so that `claude -p` works from within an active Claude Code session. Stripping `CLAUDECODE` alone is insufficient: `CLAUDE_CODE_ENTRYPOINT` How it starts
The opening of the file, as written. The whole thing — 120 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
What This Project Does
AgentKaizen measures and improves CLI-based AI coding agent behavior. It connects steering inputs (AGENTS.md, README.md, skills, Codex config) to measurable outcomes through tracing, scoring, and offline evaluation. Works locally out of the box; optionally integrates with W&B Weave for remote tracing and dashboards. Supports both Codex and Claude Code agents.
Commands
# Install
uv sync --group dev
# Tests
uv run --group dev pytest
uv run --group dev pytest tests/test_codex_scoring.py # single file
uv run --group dev pytest tests/test_codex_scoring.py::test_fn # single test
# Lint & format
uv run --group dev ruff check .
uv run --group dev ruff format --check .
# Primary CLI (unified entry point)
uv run agentkaizen --help
uv run agentkaizen run --prompt "Say only: ok"
uv run agentkaizen run --agent claude-code --prompt "Say only: ok"
uv run agentkaizen eval --cases evals/cases --variant-file evals/variants/example.json
uv run agentkaizen eval --runs 3 --cases evals/cases --variant-file evals/variants/example.json # multi-run with dispersion
uv run agentkaizen eval --compare --cases evals/cases --variant-file evals/variants/example.json # blind A/B comparison
uv run agentkaizen eval casegen --limit 20 --output evals/cases.generated.jsonl
uv run agentkaizen session sync --once # Codex sessions
uv run agentkaizen session sync --agent claude-code --once # Claude Code sessions
uv run agentkaizen session score --trace-file path/to/trace.json
# Build package
uv build
CI runs pytest, ruff check ., and ruff format --check . via uv run --group dev (see .github/workflows/ci.yml).
Architecture
src/agentkaizen/ is the canonical package.
Package modules
| Module | Responsibility |
|---|---|
core.py |
Shared infra: JSONL parser, PII redaction, W&B env resolution, prompt building |
oneshot.py |
One-shot traced agent run CLI (agentkaizen run) |
evals.py |
Offline variant comparison: workspaces, CodexVariantModel, scoring/ranking |
casegen.py |
Generate draft eval cases from recent traces (local or Weave) |
session_sync.py |
Ingest local Codex sessions into traces; delegates to claude_code_session for --agent claude-code |
claude_code_session.py |
Parse Claude Code JSONL sessions (~/.claude/projects/): discovery, trace building, sync flow |
session_scoring.py |
Score interactive session traces (heuristics + optional external judge); evidence-based claim extraction |
scoring.py |
Deterministic scorer functions (substring, length, JSON, schema, sections) |
cli.py |
Unified agentkaizen entry point with subcommand dispatch |
config.py |
Load [tool.agentkaizen] from pyproject.toml; merge with CLI args |
_weave_compat.py |
HAS_WEAVE flag, weave_init(), weave_op() shims for optional Weave |
_local_eval.py |
Local evaluation framework: LocalEvaluation, LocalModel, LocalScorer; evaluate_n() for multi-run |
_comparator.py |
Blind A/B comparator: ComparatorScorer, ComparatorResult, position-bias-free comparison |
_trace_log.py |
Local JSONL trace persistence and querying (~/.agentkaizen/traces.jsonl) |
_pii.py |
Local regex-based PII redaction (fallback when Weave is absent) |
runners/ |
AgentRunner protocol + CodexRunner, ClaudeCodeRunner, registry |
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 120 lines · 2,119 tokens per session scan B a87dbcb1ea90
AgentKaizen CLAUDE.md is an instructions file published in the GitHub repository TheIllusionOfLife/AgentKaizen (2 stars, last pushed 8mo ago), licensed Apache-2.0. It adds 2,119 tokens to every session, about $0.0085 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
AgentKaizen CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| AgentKaizen CLAUDE.mdTheIllusionOfLife/AgentKaizen | Instructions file | 2 | 8mo ago | Apache-2.0 | B | 2,119 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |