Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add instructions/theillusionoflife/agentkaizen/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.svg" alt="Measured on agentmods" 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 | $0.01059 | $0.01059 |
| Sonnet 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 5d 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.
- 5d 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 5mo ago), licensed Apache-2.0. It adds 2,119 tokens to every session, about $0.0106 per session on Opus 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.
Other instructions, from other repositories
vscode buildNext.instructions.md
Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).
codex AGENTS.md
AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.
vscode oss-third-party-notices.instructions.md
Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).
spec-kit AGENTS.md
AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.
next.js AGENTS.md
AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.
langchain AGENTS.md
AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.