agent-auditor: Command for Claude Code

.claude/commands/improve.md

improve is a command for Claude Code from basher83/agent-auditor. It costs 9 tokens per session (782 once invoked), scanned A, original, MIT.

A command that reviews recent coding-agent sessions to find mistakes, user corrections, and recurring problems. It saves the findings as a dated lessons-learned report.

In plain words
What is it for?
Use it to inspect recent sessions, collect bug fixes and problem-solving examples, and create a continuous-improvement report.
Why use it?
It turns scattered session history into a record of what went wrong and how the process could improve. This makes repeated failures easier to spot.

Command for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: mentions Claude Code.

This is basher83/agent-auditor's own configuration. It tells Claude Code how to work on agent-auditor itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything agent-auditor configures →

Reuse

Borrowing it

Nothing to install: this file belongs to basher83/agent-auditor. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/basher83/agent-auditor/main/.claude/commands/improve.md
Clone the repo
git clone --depth 1 https://github.com/basher83/agent-auditor

Made for: Claude Code.

Wrote 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.

agentmods badge for improve

README.md
[![agentmods](https://agentmods.dev/badge/commands/basher83/agent-auditor/improve/github.svg)](https://agentmods.dev/commands/basher83/agent-auditor/improve)
Your own site
<a href="https://agentmods.dev/commands/basher83/agent-auditor/improve"><img src="https://agentmods.dev/badge/commands/basher83/agent-auditor/improve/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.

agentmods 80×15 button for improve

Your own site · 80×15
<a href="https://agentmods.dev/commands/basher83/agent-auditor/improve"><img src="https://agentmods.dev/badge/commands/basher83/agent-auditor/improve.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 9 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 782 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00009 $0.00782
Opus 5.5 $0.00004 $0.00313
Sonnet 5.5 $0.00002 $0.00156
Haiku 4.5 $0.00001 $0.00078

Measured 1mo ago against content hash 14c989a62289, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

improve scanned grade A with 0 findings 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 1mo 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/improve.md · 121 lines

How it starts

The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Continuous Improvement Analysis

You are analyzing recent Claude Code sessions to identify failures, corrections, and learning opportunities.

Configuration

Search window: ${1:-7} days back from today Output file: ai_docs/continuous-improvement/lessons-learned-<TODAY>.md (use ISO date format)

Task Instructions

Step 1: Calculate Date Range

Today's date is available in your <env> context. Calculate:

  • End date: Today
  • Start date: Today minus ${1:-7} days
  • Use ISO format (YYYY-MM-DD) for all date operations

Step 2: Search for Incidents (Multi-Strategy)

Execute the following searches in parallel for the calculated date range:

A) User Corrections (search_user_prompts) Search for these phrases indicating something went wrong:

  • "wrong"
  • "stop"
  • "why did you"
  • "not what I asked"
  • "no"
  • "what are you"

Use format: "index" first, then fetch full details only for relevant matches.

B) Problem-Solution Patterns (find_by_concept) Query for observations tagged with concept: "problem-solution"

C) Bug Fixes (find_by_type) Query for observations of type: "bugfix"

Step 3: Aggregate and Deduplicate

  • Collect all findings from the three search strategies
  • Note: This command does NOT deduplicate across previous reports
  • Include all incidents found in the time window
  • For each incident, capture:
    • Timestamp (ISO format with time if available)
    • Source (claude-mem URI or reference)
    • User correction (exact quote if from prompts)
    • Context (what was happening, what went wrong)

Step 4: Generate Report

Write the report to ai_docs/continuous-improvement/lessons-learned-<TODAY>.md:

Report structure:

# Lessons Learned - <DATE>

**Search Period:** Last ${1:-7} days (<START-DATE> to <END-DATE>)
**Report Generated:** <TODAY>
**Total Incidents Found:** <COUNT>

---

## Search Strategy

This report combines three search methods:
1. User correction phrases in prompts
2. Problem-solution concept observations
3. Bugfix type observations

---

## Incidents

### Incident 1: <Title/Summary>

**Timestamp:** YYYY-MM-DD HH:MM:SS

**Source:** <claude-mem URI or session reference>

**User Correction:** (if applicable)
> <exact quote>

**Context:**
<What was happening, what went wrong, what was learned>

---

### Incident 2: ...

[Continue for all incidents...]

---

## Search Results Summary

**Total searches performed:** 3 strategies

**Results by strategy:**
- User correction phrases: <COUNT> results
- Problem-solution concepts: <COUNT> results
- Bugfix observations: <COUNT> results

**Note:** This report shows ALL incidents in the time window. Manual reconciliation with existing lessons-learned files is required to identify truly new incidents.

Read the full file on GitHub · 121 lines

Changes

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.

  1. 1mo ago First seen · 121 lines · 9 tokens per session scan A 14c989a62289

Subscribe to this mod's changes

improve is a command published in the GitHub repository basher83/agent-auditor (5 stars, last pushed 7mo ago), licensed MIT. It adds 9 tokens to every session and 782 once invoked, about $0.0000 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.