Autotune
A Claude Code mod that reviews every finished response, tests small improvements to the project harness against
the current one, and consolidates overlapping skills. Git holds change history and rollback. A local SQLite
database holds the evidence: reviews, experiments, outcomes and the Git commits involved.
Status
Experimental. Milestones M0 to M7 are built: capture, reviews, candidate authoring, paired replay and the
promotion gate, Git application and revert, skill consolidation, and the calibration and mutation tooling.
All of it is tested against a scripted fake Claude CLI. None of it has release evidence from real model runs.
There are no human calibration labels, no observation period, no effectiveness pilot and no held-out study yet.
This repository makes no claim that Autotune improves outcomes. See
release evidence for what has and has not been measured, and the
implementation plan for the status of each milestone and the open items.
Tested with Claude Code 2.1.306 on macOS. It needs Python 3.11 or later (standard library only) and Git. The mod
API is early access and may change between Claude Code releases.
What it does
- After each completed top-level response, the mod sends a bounded, redacted record of the turn to a short
ingress process, which stores it and queues a review. A detached worker does the rest in the background.
- A tool-free reviewer rates the turn on five dimensions, citing evidence ids. A missing outcome is recorded as
unknown, not as success.
- When a review shows an observed failure, or the same failure recurs across sessions, a separate author process
writes one small candidate change in a disposable Git worktree, limited to the enrolled editable paths.
- The candidate and the current harness are replayed on the same task fixtures from
.autotune/cases/, and a
deterministic gate accepts, rejects or reports inconclusive. Known successes must be kept.
- An accepted candidate is applied as a fast-forward of your branch only when the checkout is clean at its
paths, HEAD has not moved, and no session is active. By default it waits for you to apply it.
- Overlapping skills are merged through the same authoring, gate and Git path. A merge must keep every
trigger, exception and support file. Nothing is deleted for low use.
Install
From a local checkout:
git clone <this repository> /path/to/claude-autotune
cd /path/to/repo && claude --plugin-dir /path/to/claude-autotune
From the marketplace, at the prompt of a Claude Code terminal session (answer y to add the marketplace, then pick a scope):
/plugin install autotune --marketplace timini/claude-autotune
From a shell:
claude plugin install autotune --marketplace timini/claude-autotune
Quick start
-
Enroll the repository. This writes .autotune.json with automatic_apply set to false. Commit it.
cd /path/to/claude-autotune && python3 -m autotune enable --project-dir /path/to/repo
Inside a session with the plugin loaded, /autotune enable does the same.
-
Add replay cases under .autotune/cases/<id>.json and commit them. Without cases, candidates end as
inconclusive with reason no_required_cases. examples/replay-case.json is a
valid case; the format is in docs/CONTRACTS.md section 4.
-
Start Claude Code with the plugin and work as usual. /autotune status shows the queue, recent episodes,
reviews, candidates, model call counts, disk use and anything that is waiting, with the reason.
-
Inspect a review or a candidate with /autotune review and /autotune candidate <id>. Apply an accepted
candidate with /autotune apply <id>.
Evidence lives in ~/.claude/autotune/<project-id>/ (set AUTOTUNE_HOME to move it), never in the repository.
Commands
Every command runs as /autotune <command> inside a session, or from the plugin directory as
python3 -m autotune <command> --project-dir /path/to/repo. /autotune with no argument runs status. The
/autotune hint in the session lists the commands down to doctor; calibrate, mutations, export and
uninstall work the same way but are not in the hint. Run uninstall from a terminal: the session command
times out after 20 seconds, and uninstall can wait that long for the worker to stop.