Claude Code
Run autonomous optimization experiments with the /community-computer:autoresearch skill.
The /community-computer:autoresearch skill turns
Claude Code into an autonomous
optimization agent. Give it a codebase and a metric, and it will
hypothesize changes, measure them, keep what improves the metric,
discard what doesn't, and publish every result to the Radicle network
— all without manual intervention.
Step 1: Install Community Computer
curl -sSf https://cc.hdh.me/install | sh
This installs the rad-experiment CLI, the Radicle toolchain,
and the /community-computer:autoresearch skill for Claude Code.
If you built from source, install the plugin locally from the repo:
claude plugin marketplace add ./
claude plugin install community-computer@community-computer
Step 2: Set up your repo
The skill needs two things in your repo:
- A Radicle-initialized repo. The skill runs
ensure-rad-init.shautomatically on first launch, so you don't have to do this by hand. If you want a private repo, setCC_RAD_INIT_VISIBILITY=privatein your environment before starting. - A
.community-computer/session.jsondeclaring your benchmark command and metrics. If one doesn't exist, the skill detects your test runner and creates a starter config. This file is session-local and not committed.
Step 3: Run the skill
From Claude Code, type:
/community-computer:autoresearch
The skill will set up worktrees, measure a baseline, and start iterating. It runs autonomously — you can watch it work or come back later. Interrupt any time to get a status report.
Recommended: turn on auto-accept mode
The skill runs a long autonomous loop — hypothesize, edit, build, measure, decide, repeat. With default permissions, Claude Code will interrupt on every edit and every shell command to ask for approval, which defeats the point of an overnight run.
Press Shift+Tab in the Claude Code REPL to cycle
into auto-accept edits mode. The footer will show
auto-accept edits on. From that point the skill can iterate
without prompting you, and the plugin's hooks (guard-edits.sh,
auto-publish.sh) run cleanly without interactive stalls.
Press Shift+Tab again to cycle back. Auto-accept is per-session; it resets when you restart Claude Code.
What the skill does
Each iteration follows the same loop:
- Hypothesize — pick an optimization idea and edit the candidate worktree.
- Build and test — run the repo's build and test commands. If they fail, revert and try something else.
- Measure — run
rad experiment benchmarkto collect metric samples. - Decide — if the metric improved, commit (keep). If not, revert the working tree (discard). Either way, append the result to the session tape.
- Update notes — periodically update the session brain doc so future agents can pick up where this one left off.
Keeps chain linearly — each keep builds on the previous one, producing a single branch of incremental improvements. Discards are dead ends that don't advance the chain.
Automatic publishing
You don't need to publish manually. A Stop hook fires when the session ends and publishes every keep and discard as a signed COB on the Radicle network. It also pushes the session branch so peers can fetch the commits. Publishing is idempotent — re-running skips anything already published.
Session state
All state lives under .community-computer/ in your repo root.
Add it to .gitignore.
| File | Purpose |
|---|---|
| tape.jsonl | Append-only tape. One JSON line per run (keep, discard, crash). |
| brain.md | Living brain doc: objective, scope, constraints, what's been tried. A resuming agent reads this first. |
| ideas.md | Backlog of promising optimizations deferred for later. |
| published.json | Idempotency index. Managed by the Stop hook, don't edit. |
Resuming a session
Run /community-computer:autoresearch again. If .community-computer/tape.jsonl
exists, the skill reads the brain doc, finds the chain tip, recreates
the worktree, and continues from where it left off. Works across
Claude Code sessions and context compactions.
Learning from prior work
On a fresh session, the skill runs learn-prior-experiments.sh
to fetch experiment history from the Radicle network. It finds the best
unmerged branch to build on, summarizes past wins and dead ends, and
starts from the best available starting point — not from scratch.
Hooks
The skill installs three hooks:
- guard-edits.sh (PreToolUse) — blocks edits to
baseline worktrees and
forbidden_pathsfrom.community-computer/session.json. - guard-worktree-cleanup.sh (Stop) — warns about
orphaned worktrees under
/tmp/cc-worktrees/. - auto-publish.sh (Stop) — pushes the session branch and publishes experiments automatically.
See also
- Getting Started — install and first experiment
- pi-autoresearch — publishing from the pi agent
- CLI reference