debug
CommandHunt bugs with scientific method: hypothesize, test, falsify, repeat
Autonomous iteration loop: modify, verify, keep/discard against any metric
> /plugin marketplace add uditgoenka/autoresearch> /plugin install autoresearch@autoresearch
name: autoresearch description: "Autonomous iteration loop: modify, verify, keep/discard against any metric" argument-hint: "[Goal: <text>] [Scope: <glob>] [Metric: <text>] [Verify: <cmd>] [Guard: <cmd>] [Iterations: N] [--evals]" disable-model-invocation: true
EXECUTE IMMEDIATELY — do not deliberate before reading this protocol.
Extract from $ARGUMENTS:
If Goal, Scope, Metric, or Verify missing → use AskUserQuestion (single batched call): Q1 (Goal): "What do you want to improve?" Q2 (Scope): "Which files?" — suggest globs from project Q3 (Metric+Verify): "How to measure? Provide a shell command that outputs a number" Q4 (Guard): "Safety command that must always pass?" — options: test cmd, build cmd, skip If ALL provided inline → skip setup, proceed directly.
If Goal or Metric targets performance, latency, throughput, runtime, CPU, memory, allocations, binary size, power, energy, bandwidth, or compute cost, read `references/behavior-preserving-optimization.md` in the autoresearch skill directory before establishing the baseline. Apply its exploration/confirmation split: a metric-improving `keep` is an exploratory incumbent, not proof that behavior is preserved.
1. Verify git repo exists (`git rev-parse --git-dir`) 2. Check clean working tree (`git status --porcelain`) — warn if dirty 3. Check for stale lock files, detached HEAD 4. If Guard set → run Guard to establish guard baseline 5. Fail fast on any critical issue. Warn on non-critical.
Before first dry-run, screen Verify command for: rm -rf, fork bombs, curl|sh, embedded credentials, outbound writes. Block dangerous commands.
1. Run Verify command → extract numeric metric 2. Record as iteration 0 in TSV: `0\t{timestamp}\t{commit}\t{metric}\t0.0\t{guard}\t-\tbaseline\tinitial state` 3. Create output directory: `autoresearch/loop-{YYMMDD}-{HHMM}/` 4. Write TSV header: `# metric_direction: {direction}\niteration\ttimestamp\tcommit\tmetric\tdelta\tguard\tguard-metric\tstatus\tdescription`
For each iteration (1 to max_iterations, or unbounded):
Append row to TSV: iteration, timestamp, commit/-, metric, delta, guard status, guard-metric, status, description
Unless `--no-fork`: when the iteration count reaches a scheduled round (33% and 66% of N; 50% when N < 12; every 20 when unbounded), or the last 5 iterations since the last `keep` or fork-and-flush round produced no `keep`, run one fork-and-flush round from the incumbent before the next iteration. Follow `references/fork-and-flush.md`. An early round replaces the next scheduled one. Of the K branches, `floor(K × R)` are guided (a stateless Advisor assigns each one experiment) and the rest are random (fresh context, no assignment).
If --evals: check if current_iteration % interval == 0 → run checkpoint analysis.
If bounded: current_iteration >= max_iterations → exit loop, print summary.
Print: total iterations, kept/discarded counts, starting metric → best metric reached in any lineage, improvement %, top 3 most effective changes, fork rounds run and which ones moved the incumbent, and fork wins by kind (random vs guided).
If --evals present:
Turn Claude Code, OpenCode, or OpenAI Codex into a relentless improvement engine. Based on Karpathy's autoresearch — constraint + mechanical metric + autonomous iteration = compounding gains.
Hunt bugs with scientific method: hypothesize, test, falsify, repeat
Analyze iteration results: trends, plateaus, regressions, recommendations
Crush errors one-by-one until zero remain: tests, types, lint, build
Research ICP challenges, discover improvements, generate PRDs
Scout codebase and auto-generate docs — or a navigable wiki knowledge base — with validation-fix loop
Convert a goal into validated Scope, Metric, Direction, Verify config
One-time setup after installing ARIS as a Claude Code plugin — registers the Codex reviewer MCP server from the plugin directory…
name: sc:agent description: SC Agent — session controller that orchestrates investigation, implementation, and review category:…