# AutoHarness: Claude Code writes and prunes its own skills (tigerless-labs/autoharness) — skill card for AI agents

> AgentGid skill card. Checked on 2026-11-05 against commit c0aef3f (version 0.5.3).
> Every fact comes from the pack's own files at that commit. Numbers marked "as reported" are the author's.
> Human page: https://agentgid.com/skills/tigerless-labs/autoharness/

> Note: the pack has changed since this check; re-read its files before relying on details.

## Explain it to a non-programmer
Your Claude Code starts keeping notes for itself. While you work, it watches the session. After enough work, a second, hidden Claude session starts in the background and turns what was learned (your corrections, fixes that worked) into new skills. It merges similar ones, and it tidies away skills nobody uses.

## Who it is for
- You use Claude Code every day and keep correcting it the same way
- You want lessons from one session to be there in the next one without writing them down yourself
- You want to say /learn after working something out and have it kept
- Not for: You use another assistant: it is built for Claude Code only
- Not for: You don't want extra background Claude sessions running on your account
- Not for: Your computer has no Python 3.11 or newer

## What it is
- Kind: always-on, command, scripts
- License: MIT
- Repository: https://github.com/tigerless-labs/autoharness

## What it does
- Counts tool calls in your session; by default every 50 tool calls a background learning pass starts when the turn ends
- A hidden reflector session (Haiku model) reads a cleaned-up slice of the session and proposes skill changes: add, merge, patch or delete
- A fixed checker (the promoter) validates each proposal (safety patterns, format, length) and is the only part that writes skill files
- Every new session gets an index of its own skills, grouped by category, plus a line on what landed and what was rejected last time
- Every 250 tool calls a curator pass folds near-duplicate skills into broader ones, after taking snapshots
- Skills that were never used during their trial period, or lose out when there are too many, are moved to an archive folder
- It only touches skills it wrote itself; skills you wrote or installed are left alone

## Skills
| Skill | Call | Changes code? | In plain words |
|---|---|---|---|
| learn | /learn, or "remember this" | no | Turns what you just worked out in this chat into a saved skill |
| reflector (background agent) | starts by itself after enough tool calls | no | Reads the recent part of the session and proposes skill changes, without writing files |
| curator (background agent) | starts by itself, more rarely | no | Merges narrow look-alike skills into broader ones |

### learn
- Asks for: The conversation so far (it reads it itself)
- Gives: One proposed change per lesson, each with a reason and a quote from the session
- Gives: Nothing, if nothing meets the bar
- Gives: A report of rejected proposals at the next session start
- Say: "/learn"

## Know before installing
- It switches on by itself after install and keeps running: no command needed.
- Background learning runs are separate Claude sessions started with permission prompts turned off; the author limits them by an allow-list of read-only tools plus one proposal tool, and a hook blocks their file writes.
- It writes outside your project: general skills to ~/.claude/skills/ and its state to ~/.claude/autoharness/. AUTOHARNESS_DISABLE_GLOBAL=1 keeps it to the project.
- Each saved skill keeps a cleaned-up slice of your session as evidence in references/evidence-*.md; check it before committing .claude/skills/ to git.
- Uninstalling does not remove the skills it made or its state; delete those folders by hand.
- With an older python3 first on your PATH (macOS Xcode ships 3.9.6) every hook is off for the session.

## Install (official commands)
- Claude Code: `/plugin marketplace add tigerless-labs/autoharness` && `/plugin install autoharness@autoharness` — Then run /reload-plugins or restart Claude Code. Needs Python 3.11+ as python3. Remove: `claude plugin uninstall autoharness@autoharness, then claude plugin marketplace remove autoharness; delete ~/.claude/autoharness/, <repo>/.claude/autoharness/ and its skills under .claude/skills/ by hand`.

## What runs on the user's machine
- Code on the machine: yes (the Claude Code plugin)
- Network: yes
- Session start, every tool call, every turn end, session end: A Python hook (python3 -m autoharness.hook.dispatch) counts tool calls, injects the skill index at session start and runs the lifecycle pass once per session.
- Turn end after 50 tool calls (AUTOHARNESS_REFLECT_EVERY_N): Starts a detached background process that runs the claude command (claude -p --agent ... --dangerously-skip-permissions) with a redacted slice of the session transcript; this is a normal Claude session on your account, so it calls Anthropic's servers.
- Every 250 tool calls: Same kind of background claude session for the curator, after tar snapshots of the skill folders.
- While the plugin is on: A local MCP server (python3 -m autoharness.stage_skill.server) takes skill proposals into a queue.
- After a learning run: Writes skill folders (SKILL.md, .ledger.jsonl, .sidecar.json, references/evidence-*.md, optional scripts/ and templates/) to .claude/skills/ and ~/.claude/skills/, and state to .claude/autoharness/ and ~/.claude/autoharness/.
- Optional, off by default: AUTOHARNESS_NOTIFY=desktop shows a desktop notification (osascript / notify-send); AUTOHARNESS_NOTIFY_CMD runs a command of your choice with the run record, for example a webhook.

## Settings
- `AUTOHARNESS_DISABLE_GLOBAL`: 1 = project only (default 0)
- `AUTOHARNESS_REFLECT_EVERY_N`: tool calls between learning runs (default 50)
- `AUTOHARNESS_CONSOLIDATE_EVERY_N`: tool calls between curator runs (default 250)
- `AUTOHARNESS_DIGEST_EXCHANGES`: earlier exchanges compressed into the reflector's input (default 20)
- `AUTOHARNESS_CARRIER`: bundle | fork (default bundle)
- `AUTOHARNESS_INDEX_SUSPENDED`: 1 = no skill index at session start
- `AUTOHARNESS_INDEX_DESC_MAX_CHARS`: default 60
- `AUTOHARNESS_SKILL_DESC_MAX_CHARS`: default 1024
- `AUTOHARNESS_SKILL_BODY_MAX_LINES`: default 25
- `AUTOHARNESS_MATURITY_PROJECT`: default 100
- `AUTOHARNESS_MATURITY_GLOBAL`: default 300
- `AUTOHARNESS_CAPACITY_PROJECT`: default 50
- `AUTOHARNESS_CAPACITY_GLOBAL`: default 20
- `AUTOHARNESS_GRADUATION_SUSPENDED`: 1 = never archive for going unused
- `AUTOHARNESS_SNAPSHOT_KEEP`: default 5
- `AUTOHARNESS_NOTIFY`: desktop = native notification per run
- `AUTOHARNESS_NOTIFY_CMD`: command that receives the run record JSON
- `AUTOHARNESS_NOTIFY_TIMEOUT_S`: default 5

## Examples (from the pack's own files)
- Ledger lines of a learned skill: output format defined in README.md

## Author's numbers (as reported, not run by AgentGid)
- Same model, different harness: 42% to 78% on CORE-Bench (a cited outside result, not a test of this plugin). Source: tigerless-labs/autoharness/README.md

## Steps only the person can do
- Make sure python3 on the PATH is Python 3.11 or newer (README.md (Install)) Then: The hooks and the stage_skill MCP server start with Claude Code
- Run /reload-plugins or restart Claude Code after installing (README.md (Install)) Then: The plugin starts watching sessions and landing skills in the background
- Optional: turn on auto-update for the autoharness marketplace in /plugin → Marketplaces (README.md (Update)) Then: New releases install without manual update commands
- Optional, macOS: allow Script Editor notifications in System Settings → Notifications if AUTOHARNESS_NOTIFY=desktop shows nothing (README.md (Notify)) Then: A desktop notification names what each learning run landed and rejected

## Mistakes to avoid
- Not: Install it on a Mac where the first python3 on the PATH is the Xcode 3.9 one. Instead: Put Python 3.11 or newer first on the PATH as python3 before starting Claude Code. Why: The hooks call bare python3, and an older one turns every hook off for the session
- Not: Register the stage_skill MCP server by hand instead of installing the plugin. Instead: Install it as a Claude Code plugin from the marketplace. Why: The background agents' allow-lists use the plugin-namespaced tool name, so a hand-registered server leaves them without their only tool
- Not: Lower AUTOHARNESS_REFLECT_EVERY_N for a demo and leave it there. Instead: Use the small demo values only for a walkthrough, then go back to the defaults. Why: A lower value starts more background Claude sessions on your account
- Not: Commit .claude/skills/ to a shared repo without reading the learned skills. Instead: Read each learned skill and its references/evidence-*.md before committing. Why: Each evidence file is a redacted slice of your real session
- Not: Expect uninstalling to remove the learned skills and state. Instead: Uninstall, then delete ~/.claude/autoharness/, <repo>/.claude/autoharness/ and the self-authored skills under .claude/skills/ by hand. Why: The skills and state live outside the plugin folder

## What leaves the machine
- A redacted slice of the session transcript plus a digest of earlier exchanges and the skill index → Anthropic, through a background claude -p session on your own Claude Code account, At the end of the turn that passes every 50 tool calls (AUTOHARNESS_REFLECT_EVERY_N), and for the rarer curator pass. Opt out: No opt-out while the plugin is on; a higher AUTOHARNESS_REFLECT_EVERY_N makes runs rarer
- The real conversation (not the redacted window), when the fork carrier is chosen → Anthropic, through a forked claude -p session, Only with AUTOHARNESS_CARRIER=fork. Opt out: Keep the default AUTOHARNESS_CARRIER=bundle
- The run record JSON (what landed and was rejected; skill names redacted) → Any command you set in AUTOHARNESS_NOTIFY_CMD, for example a Slack or webhook script, After each learning run, only if the variable is set. Opt out: Leave AUTOHARNESS_NOTIFY_CMD unset (the default)

## May I use it like this?
- commercial-app: yes (MIT: keep the license notice)
- redistribute-files: yes (MIT: keep the copyright and permission notice in copies)
- client-work: yes (MIT allows use in work for others)

## Which one to pick
- If You want Claude Code to write, merge and retire its own skills in the background, with a ledger per skill: skill:tigerless-labs/autoharness
- If You want corrections and preferences synced into CLAUDE.md and AGENTS.md instead of separate skills: skill:BayramAnnakov/claude-reflect
- If You switch between several agents and want one portable memory and skills folder for all of them: skill:codejunkie99/agentic-stack

## Works well with
- agent:claude-code: It is a Claude Code plugin; its hooks, MCP server and background sessions all run through Claude Code

## Works in and needs
- Works in Claude Code: plugin
- Needs Python 3.11+ as python3 on PATH: The hooks and the MCP server are Python
- Needs claude command on PATH: Background learning runs start the claude CLI
- Needs Linux or macOS: The platforms the README badge names

## How to tell it works
Install it, work on a real task, correct the assistant once ("that's missing a step"), then say /learn. A new folder should appear under .claude/skills/ (ls -la shows its .ledger.jsonl), and the next session opens with an index line for it.

## Related
- NousResearch/hermes-agent

## Safety
Background learning sessions run claude with --dangerously-skip-permissions; the author relies on the agents' tool allow-list and a hook that denies file writes. Learned skills can carry scripts/ files that later sessions may run; the promoter scans them with regex safety patterns, which the author calls heuristics, not sandboxing. Read new skills before trusting them.
