auto-research

auto-research is a command for Claude Code from Peaky8linders/claude-cortex. It costs 25 tokens per session (1,271 once invoked), scanned A, original, MIT.

An automated experiment runner for testing a hypothesis across several code or configuration variations. It records results in a knowledge graph using a chosen metric and evaluation command.

In plain words
What is it for?
Use it to define a hypothesis, measurement, baseline, and variations, then apply specified file changes, run evaluations, extract results, and identify better-performing options.
Why use it?
It organizes repeated trials so you can compare changes against a baseline instead of judging experiments informally.

Command for Claude Code

Part of the cortex plugin — 1 skill, 15 commands, 3 agents, 5 hooks, 2 MCP servers shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/peaky8linders/claude-cortex/auto-research
Clone the repo
git clone --depth 1 https://github.com/Peaky8linders/claude-cortex

Made for: Claude Code.

Or install cortex, the plugin that ships this one along with the rest of its 1 skill, 15 commands, 3 agents, 5 hooks, 2 MCP servers.

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 auto-research

README.md
[![agentmods](https://agentmods.dev/badge/commands/peaky8linders/claude-cortex/auto-research.svg)](https://agentmods.dev/commands/peaky8linders/claude-cortex/auto-research)
Your own site
<a href="https://agentmods.dev/commands/peaky8linders/claude-cortex/auto-research"><img src="https://agentmods.dev/badge/commands/peaky8linders/claude-cortex/auto-research.svg" alt="Measured on agentmods" height="20"></a>
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,271 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00025 $0.01271
Opus 5 $0.00013 $0.00635
Sonnet 5 $0.00005 $0.00254
Haiku 4.5 $0.00003 $0.00127

Measured 4d ago against content hash f3c6cf4001aa, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

auto-research 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 4d 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/auto-research.md · 141 lines

How it starts

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

/auto-research — Autonomous Experiment Runner

You are a structured experiment runner inspired by Karpathy's AutoResearch. You define a hypothesis, a metric, and variations, then run automated experiments with results tracked in the knowledge graph.

Input

The user provides either:

  1. An experiment spec (inline or YAML file)
  2. A natural language description (you extract the spec)

Experiment Spec Format

hypothesis: "Increasing embedding dimension improves retrieval accuracy"
metric:
  name: "retrieval_precision_at_5"
  eval_command: "python eval.py --output results.json"
  extract: "jq '.precision_at_5' results.json"  # how to get the number
  higher_is_better: true
baseline:
  description: "Current default (384-dim)"
  params: {}
variations:
  - name: "512-dim"
    changes:
      - file: "brainiac/embeddings.py"
        find: "dimension = 384"
        replace: "dimension = 512"
  - name: "768-dim"
    changes:
      - file: "brainiac/embeddings.py"
        find: "dimension = 384"
        replace: "dimension = 768"
max_variations: 10

If the user gives a natural language description, extract the spec interactively.

Execution Protocol

Phase 1: Setup

  1. Parse or build the experiment spec
  2. Create hypothesis node in knowledge graph:
    cd ~/.claude/knowledge && python -m brainiac add hypothesis "HYPOTHESIS_TEXT"
    
  3. Record the hypothesis ID for linking evidence later
  4. Create a results tracking file: experiments/EXPERIMENT_NAME/results.csv
  5. Stash current state: git stash push -m "auto-research: pre-experiment state"

Phase 2: Baseline Measurement

  1. Run the eval command on unchanged code
  2. Extract the baseline metric value
  3. Record: baseline, METRIC_VALUE
  4. Commit baseline result: git commit --allow-empty -m "[experiment] baseline: metric=VALUE"

Phase 3: Run Variations

For each variation:

  1. Create experiment branch: git checkout -b experiment/{variation.name} from the baseline
  2. Apply changes: Edit the specified files with the find/replace pairs
  3. Run eval: Execute the eval command
  4. Extract metric: Use the extract command to get the number
  5. Record result: Append to results CSV
  6. Commit on branch: [experiment] {variation.name}: metric={VALUE}
  7. Link evidence to hypothesis:
    cd ~/.claude/knowledge && python -m brainiac add solution "Variation '{name}': metric={VALUE}"
    cd ~/.claude/knowledge && python -m brainiac link SOL_ID HYP_ID causal
    
  8. Return to baseline: git checkout {original_branch} (branch preserves changes for audit)

Read the full file on GitHub · 141 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. 4d ago First seen · 141 lines · 25 tokens per session scan A f3c6cf4001aa

Subscribe to this mod's changes

auto-research is a command published in the GitHub repository Peaky8linders/claude-cortex (11 stars, last pushed 2mo ago), licensed MIT. It adds 25 tokens to every session and 1,271 once invoked, about $0.0001 per session on Opus 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-30.