agent-coach
Grade and coach your Claude Code and Codex prompts from your own conversation history, against Anthropic's and OpenAI's official guides.
Quick start · What it grades · Missed responses · FAQ · 한국어
Demo report built from made-up conversations (python scripts/demo_report.py).
agent-coach is a command-line tool that reads the transcripts Claude Code and OpenAI Codex already save on your machine (~/.claude/projects, ~/.codex/sessions) and scores how you direct the agent on 13 habits taken from the official Anthropic and OpenAI guides and academies. It rewrites prompts you actually typed into better versions, finds the turns where you didn't get what you wanted, and tracks your scores run after run so you can see whether you're improving. agent-coach setup also checks the setup the agent runs in: deny rules, sandbox, hooks, CI and your CLAUDE.md / AGENTS.md.
Quick start
uvx --from agent-coach-cli agent-coach run # try it without installing (or: pipx run --spec agent-coach-cli agent-coach run)
pipx install agent-coach-cli # or: uv tool install agent-coach-cli · pip install agent-coach-cli
agent-coach run # grade your prompting
agent-coach setup # check your setup (no model calls)
The package on PyPI is agent-coach-cli; the command it installs is agent-coach. run grades your recent conversations through the claude or codex CLI you're already signed in to, saves the result and opens an HTML report. No API key, no server, no dependencies. Want to look before grading anything? agent-coach scan lists what would be graded, without calling a model.
Or use it inside Claude Code or Codex
Install the plugin and let the agent run it and coach you in the chat, with nothing else to install.
# Claude Code
/plugin install agent-coach --marketplace 1017toa/agent-coach
/agent-coach:coach
# Codex
codex plugin marketplace add 1017toa/agent-coach
codex plugin add agent-coach@agent-coach
Then ask Codex to "grade my prompting with agent-coach". The skill previews what will be graded, runs the grading, and walks you through your weakest habits, rewrites and rules worth adding to CLAUDE.md / AGENTS.md.
Highlights
- Grounded in the official guides. Every habit cites the guide section it comes from: Claude Code best practices, Claude Academy, Codex best practices, OpenAI Academy (rubric).
- Rewrites of your real prompts. "You wrote this; this would have worked better, because…", not generic tips.
- Short prompts aren't penalized. In a long conversation, "ok do it" is often all you need. Coaching targets turns that actually missed, and only when the cause was a gap in your prompt.
- Finds rules worth writing down. Gaps that recur across conversations become one-line rules, with where to put them:
CLAUDE.md/AGENTS.md, memory, a skill, or a hook. - Checks your setup, not just your prompts. As agents steer and approve on their own, guarantees move into the harness: deny rules for secrets, hooks that send the agent back when tests fail (exit code 2), a sandbox, CI.
agent-coach setupchecks them from local files in a second. - Tracks progress. Each run is saved under
~/.agent-coach/history/, so your trend survives after the tools delete old transcripts. - Claude Code and Codex on one scale, in one report.
- Private by default. Secrets and contact details are masked before anything reaches the judge, and results stay on your machine.
- English and Korean. Report, CLI and coaching in either language (
--lang en|ko).
Supported tools
| Tool | Transcripts read from | Notes |
|---|---|---|
| Claude Code (CLI, desktop, IDE) | ~/.claude/projects/**/*.jsonl |
Scripted claude -p runs and app-generated turns are skipped |
| OpenAI Codex (CLI, IDE) | ~/.codex/sessions/**/rollout-*.jsonl |
codex exec and agent-spawned sessions are skipped |
Judge: claude CLI, codex CLI, or offline keyword scoring (--judge heuristic).
How it works
~/.claude, ~/.codex transcripts
│
● collect your own typed turns only (automation, slash commands, app messages filtered out)
│
● redact keys, emails, phone / ID / card numbers, addresses, names you list
│
● judge one call per conversation via your claude / codex CLI, rubric v4 (13 habits)
│
● save ~/.agent-coach/history/run-*.json
│
✓ report one self-contained HTML file: overview · coaching · missed responses · conversations · progress
What it grades
Thirteen habits, each scored 0 / 1 / 2 only in the conversations where it mattered, averaged to 0–100.
| Habit | What the guides recommend |
|---|---|
| Specific context | State the goal and point at the file, screen and symptom from the start |
| Done criteria and verification | Give a pass/fail check (tests, build, screenshot) and let the agent run it |
| Constraints and preferences | Say what must not change and which approach you prefer |
| Hand over the real material | Attach the @file, screenshot or full error instead of describing it |
| Scope and output shape | Minimal or full version; format and length of the result |
| Plan or interview first | For big or fuzzy work, plan or get interviewed before building |
| Stop points and working style | How far to go alone, where to stop and ask, how to report |
| Ask for evidence, review the result | Commands, output, diff; a fresh session to review |
| Course correction | Correct rarely and early; after two failed corrections, start fresh with a better prompt |
| Move repeated rules into files | Only what the agent can't see from the code goes in CLAUDE.md / AGENTS.md, written plainly; rules with no exceptions become hooks or deny rules |
| Hand over whole tasks, then step back | One complete request with its finish line instead of step-by-step spoon-feeding; long work in background, cloud or parallel sessions |
| One outcome per conversation | New work in a new conversation; tidy long ones |
| Model and effort choice | Match model and reasoning effort to the work, judged from what each conversation actually ran on |
Missed responses
Context builds up over a conversation, so a short instruction can be exactly right. agent-coach never marks a prompt down for being short. It looks for turns that didn't get what you wanted, judged by what happened next:
- Signals: you corrected the result, repeated an earlier instruction, asked to redo or undo, reported damage, showed frustration, or the agent had to ask back.
- Causes: gap in your prompt (something only you knew was missing and context didn't cover it) / agent error (context was enough) / changed your mind / external limit.
- Coaching: only prompt gaps get a rewrite, phrased as "the one missing piece". Gaps that recur become rule candidates.
Causes are classified only with an LLM judge; keyword scoring finds the signals and leaves the cause unclassified.
Usage
agent-coach scan # preview which conversations would be graded (no model calls)
agent-coach run # grade → save the run → open the report
agent-coach rank # weekly score, share card, optional leaderboard submission
agent-coach summary # latest run as text: weakest habits, rewrites, rules to add
agent-coach setup # check deny rules, sandbox, hooks, CI and CLAUDE.md / AGENTS.md (add --json for CI)
agent-coach history # score table per run
agent-coach report # rebuild the report from saved runs
| Option | Meaning |
|---|---|
--days 30 / --all |
Time window (default: since the previous run; 14 days on the first run) |
--judge claude|codex|heuristic |
Which judge (default: auto) |
--model sonnet |
Judge model |
--max-sessions 20 |
Max conversations to grade; each one is one model call |
--source claude / --source codex |
Only one tool |
--rubric my-rubric.json |
Your own rubric, for a course or a team |
--lang en|ko |
Language of the report and coaching (default: OS locale, or AGENT_COACH_LANG) |
From a checkout without installing: python -m agentcoach run. Latest development version: pip install git+https://github.com/1017toa/agent-coach.git.
Grade on a schedule. Run agent-coach run every week or two; each run grades only what's new and adds to the trend. Claude Code deletes transcripts older than 30 days by default, so keep the interval shorter than that.
Setup check
Prompts are half of it. With auto mode approving commands and the model steering itself, what keeps a long unattended run safe and correct is the setup around it. agent-coach setup reads your local config (nothing is sent anywhere, no model calls) and scores three areas:
| Area | What it checks |
|---|---|
| Safety | A deny rule for .env and SSH keys (deny rules apply before auto mode's classifier), not running in bypassPermissions, the sandbox (macOS, Linux, WSL2), Codex sandbox_mode |
| Verification | A Stop / TaskCompleted hook that runs tests, a lint hook after edits, hook scripts that exit with code 2 on failure (exit 1 lets the task finish anyway), CI in the repo |
| Instructions | CLAUDE.md / AGENTS.md without piled-up IMPORTANT / NEVER / !!!, without stack and folder-layout sections the agent can read from the code, and short |
Each warning comes with the fix and the doc it's based on. Run it in a project folder, or pass --project PATH; --json prints machine-readable output for CI.
Weekly ranking
See how you compare with other Claude Code and Codex users, or run a league for your class or team.
agent-coach rank # your weekly score and a share card (nothing is sent)
agent-coach rank --nickname neo --submit # submit to the public leaderboard
agent-coach rank --league class-18 # compare within a group
- Weekly score = quality × activity bonus. Quality is the mean grade of your conversations from the last 7 days. The bonus rises slowly with the number of conversations (×1.16 at 5, capped at ×1.3 from 20), so using agents a lot helps a little, but prompting well wins.
- Tiers from the weekly score: Iron 0+ · Bronze 30+ · Silver 45+ · Gold 60+ · Platinum 75+ · Diamond 90+ · Master 105+. The card shows your tier, how far the next one is, and gets livelier as you climb (light sweep, stars from Platinum, confetti from Gold).
- Only LLM-graded conversations count (offline keyword scores aren't comparable), and you need at least 3 to be ranked.
- Share card:
rankwrites a card with a PNG download and share text, ready for X, LinkedIn or a class chat. - Submitting opens a pre-filled GitHub issue that you review and send. It contains only numbers, your nickname and an optional league: no prompts, projects or paths. A bot validates it, replies with your rank and updates the leaderboard. One entry per GitHub account per week; the newest counts.
- Scores are self-reported, since grading runs on your own machine. Treat the board as a friendly challenge.
How it compares
| agent-coach | Token and cost trackers (e.g. ccusage) | Prompt eval frameworks (e.g. promptfoo) | |
|---|---|---|---|
| Looks at | How you direct the agent | Tokens and spend | Your app's prompts and model outputs |
| Input | Your Claude Code / Codex history | Your Claude Code / Codex history | Test cases you write |
| Output | Scores per habit, rewrites, missed turns, rules to add | Usage tables | Pass/fail matrices |
| For | Developers, teams and courses learning to work with coding agents | Budgeting | Building LLM apps |
They answer different questions and work fine side by side.
FAQ
How do I improve my Claude Code or Codex prompts?
Run agent-coach run and open the Coaching tab. It starts with your three weakest habits and shows prompts you actually wrote next to rewritten versions, with the official guide section behind each one. Re-run in a week or two and check the Progress tab.
Does it send my conversations anywhere?
Raw transcripts never leave your machine. With an LLM judge, the masked prompts of each graded conversation and one-line summaries of what the agent did are sent to the Claude or Codex account you're signed in to, the same place your conversations already went. --judge heuristic grades fully offline.
Do I need an API key?
No. Grading runs through the claude or codex CLI you're already logged in to, using your existing plan. Without either, it falls back to offline keyword scoring.
How much does a run cost?
One judge call per conversation, on your existing plan. Use --max-sessions to cap it and agent-coach scan to preview the count first.
Why wasn't my short prompt marked down?
Because short prompts are often right. "Yes, do it" after a long discussion has all the context it needs. agent-coach only coaches a turn when what happened next shows it missed, and only rewrites it when the missing piece was something only you knew.
Can I use my own rubric for a course or a team?
Yes. Copy agentcoach/rubric/default.json, edit the habits and examples, and pass --rubric your-rubric.json. A rubric without English fields is shown as written.
Where are results stored?
~/.agent-coach/history/run-*.json (one file per run) and ~/.agent-coach/report.html. Set AGENT_COACH_HOME to move them.
How do I hide my name or company?
Names can't be detected reliably, so list yours (name, romanized name, company, ...) one per line in ~/.agent-coach/redact.txt. Keys, tokens, emails, phone, national ID and card numbers, and Korean road addresses are masked automatically.
Does it support Cursor, Gemini CLI or Aider?
Not yet; Claude Code and Codex only. Support for more tools is on the roadmap, and parsers are small (see agentcoach/collect.py).
Sources
The default rubric (v4) and the setup check are built from:
- Anthropic: Best practices for Claude Code, Model configuration, Prompting Claude Fable 5.2, Getting the most out of Opus 5.5, Permission modes, Sandboxing, Hooks, Memory, Claude Code on the web, Claude projects
- Claude Academy: AI Fluency: Framework & Foundations, Claude Code 101, Claude Code in Action, Claude 101
- OpenAI: Codex Best practices, Codex Prompting, GPT-5.6 prompt guidance
- OpenAI Academy: Get Started with Codex, Agents and Workflows, Extend Codex Workflows (free with sign-in; the rubric cites specific lessons, such as the four-part task brief, Plan Mode, validation and handoff, delegation contracts and AGENTS.md)
When the rubric changes, earlier runs have no score for new habits and the report says the versions differ.
Roadmap
- Statusline with your current tier and one tip a day
- README badge (SVG) that keeps your tier visible on your profile
- Monthly / yearly "wrapped" card
- GitHub Action that runs
agent-coach setup --jsonon pull requests - Anonymized aggregate export for courses and teams
- Example custom rubrics
- Cursor and Gemini CLI transcripts
Contributing
Issues and pull requests are welcome; see CONTRIBUTING.md. Run the tests with:
python -m unittest discover -s tests
License
Metadata
Release files for agent-coach-cli 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agent_coach_cli-0.2.0.tar.gz | 87.5 kB | With provenance | Details for agent_coach_cli-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_coach_cli-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for agent_coach_cli-0.2.0-py3-none-any.whl |
Total release size: 173.4 kB
Release files / agent_coach_cli-0.2.0.tar.gz
| Download URL | agent_coach_cli-0.2.0.tar.gz |
|---|---|
| Size | 87.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d275eba8b4533d668be23f0143b35e99106b88f0b9afc29eaf9eedf3be3e34a7
|
|
BLAKE2b-256 checksum How to use checksums |
90eef7bc2a9896feab4329f5e6a2c1c57eb8adaf76ec18c5e4d4f833e378f5f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logRelease files / agent_coach_cli-0.2.0-py3-none-any.whl
| Download URL | agent_coach_cli-0.2.0-py3-none-any.whl |
|---|---|
| Size | 85.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c3b163da14cfa029aacd14df34c9e61bd5d2746af8f9f4d0a6e2e9b0486d9545
|
|
BLAKE2b-256 checksum How to use checksums |
af6ec305cf1fefad1a98a32274dbbe79555b0d2a2dc597de014e08f101069b60
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logSecurity for agent-coach-cli 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for agent_coach_cli-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.