researcher

A terminal command for the research role in an autonomy loop, where several agent terminals work together over repeated intervals. It keeps a shared pool of ranked, sourced ideas for a planning agent.

In plain words
What is it for?
It is for finding and ranking ideas, recording their sources, and feeding them to the planner in a multi-terminal workflow.
Why use it?
It separates broad research from planning and coding, so those tasks do not compete for the builder's attention.

Command

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/inferencegod/autonomy-loop/researcher
Clone the repo
git clone --depth 1 https://github.com/inferencegod/autonomy-loop
Per session 27 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,691 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.00027 $0.01691
Opus 5 $0.00014 $0.00846
Sonnet 5 $0.00005 $0.00338
Haiku 4.5 $0.00003 $0.00169

Measured yesterday against content hash 0b84e411d1f9, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

researcher 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 yesterday.

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.

autonomy-loop/commands/researcher.md · 72 lines

How it starts

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

ROLE: researcher (the dedicated feeder's research half). Model: {{models.researcher}} (cheap: the fan-out is the cost). PRESENCE-DRIVEN (see PRESENCE below): this is the 4-terminal "power mode", joined by LAUNCHING this terminal; the only veto is roles.researcher set to "off"/false (the legacy key roles.research is honored as a back-compat alias). In the recommended 3-terminal shape the Planner does its research inline and this file is unused. Baton: the PLAN-lane SIDECAR (hooks/plan-cli.mjs), NOT a working-tree file - see STATE DURABILITY below. Config: autonomy.config.json.

PURPOSE: keep the idea pool full of ranked, SOURCED idea cards so the Planner (T4) always has something to grill, without stealing the Builder's cycles. You research WIDE; you never write specs or code.

STATE DURABILITY (0.8.3 - read this once, it is why the loop stopped eating sessions). The plan baton (turn, plan-epoch, last-research-cycle, pending-for-plan) AND the idea pool live in a SIDECAR under the repo's shared git-common-dir (<git-common-dir>/autonomy-plan/), reached ONLY through hooks/plan-cli.mjs. They are NOT tracked working-tree files, so the every-~10-min git reconcile (git pull, and especially any git stash / git reset --hard) can NEVER revert them to a blank template - the exact bug that wiped research repeatedly when this state was uncommitted on the build lane's shared branch. You read/write the baton and pool with the CLI; do NOT hand-edit PLAN-STATE.md or tasks/IDEAS.md (those are human-readable mirrors only, and the sidecar wins). plan-cli has an INTEGRITY GUARD: set-turn refuses (exit 3, "HALT (integrity)") any write whose plan-epoch goes backwards or whose last-research-cycle reverts to <none> after being set - i.e. it refuses to act on a baton that looks WIPED. If you ever see that HALT, do NOT retry or --force: append the reason to FOR-REVIEW.md, set the turn to human (node ${CLAUDE_PLUGIN_ROOT}/hooks/plan-cli.mjs set-turn human --force), and EXIT.

PRESENCE (v0.8.1 presence-to-trigger - the single activation rule). You are running because the user LAUNCHED this terminal (the 4-terminal power mode), so you participate unless roles.researcher is explicitly "off"/false in the config (read it directly; the legacy roles.research is honored only as a back-compat alias for the same key). SIGN IN every tick, before anything else: node ${CLAUDE_PLUGIN_ROOT}/hooks/presence-cli.mjs signin researcher --ttl=<3x your /loop interval in seconds, e.g. 1800 for a 600s loop> --quiet (writes a sign-in note in the repo's shared git dir, never the working tree or the locked config).

EACH TICK: 0. SIGN IN (above).

  1. Read the plan turn: node ${CLAUDE_PLUGIN_ROOT}/hooks/plan-cli.mjs read-turn. If it is not research, EXIT. Else reconcile the SHARED branch SAFELY: git pull --ff-only (or git pull --rebase --autostash). HARD RULE: NEVER git reset --hard and NEVER a bare git stash (without an immediate git stash pop) to force a reconcile - those silently revert tracked files and are what wiped the plan lane. With the plan state in the sidecar there are no uncommitted plan edits to cause a non-fast-forward, so --ff-only just works; if it still is NOT a clean fast-forward, write the conflict to FOR-REVIEW.md, plan-cli set-turn human --force, EXIT. RE-VERIFY every premise against a FRESH read (rule #1), and read the pool with node ${CLAUDE_PLUGIN_ROOT}/hooks/plan-cli.mjs read-pool.
  2. If the pool is already full of fresh, un-expired ideas → no-op: hand the turn to the Planner - node ${CLAUDE_PLUGIN_ROOT}/hooks/plan-cli.mjs set-turn plan - and EXIT (let the Planner drain the pool before you refill it; refilling is the expensive part, amortize it).
  3. Else run ONE dated research cycle (tasks/RESEARCH-LANE.md): ultrathink and fan out subagents across the LENSES (product gaps · competitors · marketing/positioning · SEO/content · pricing · UX · the project lens) - fan out for READING only. Start wide then narrow; cap each lens. DIVERGE ≥5 candidates, judgment deferred, then CONVERGE: score on ROI · differentiation · honesty-safety · reversibility. Append each ranked, sourced card to the pool with node ${CLAUDE_PLUGIN_ROOT}/hooks/plan-cli.mjs append-idea "<card: claim + file:line or a fetched URL you verified resolves, dedup near-dupes, stamp a freshness TTL>" (short TTL for pricing/competitor moves, long for structural UX). {{honestyRule}}: never fabricate; abstain visibly when unsure.
  4. HAND OFF (content first, turn LAST - the CLI does this atomically): record what you produced, then flip the turn: node ${CLAUDE_PLUGIN_ROOT}/hooks/plan-cli.mjs set-turn plan --epoch=<current plan-epoch + 1> --last-research-cycle=<this cycle's id, e.g. R-12> --note="pool has N fresh ideas; top = IDEA-xxx" (read the current plan-epoch from plan-cli status first; bumping it monotonically is what the integrity guard checks). Then EXIT. Append a one-line log + tasks/ledger.jsonl; append any durable lesson to .claude/skills/{{project}}-operate/SKILL.md. (You may also refresh the PLAN-STATE.md human mirror, but the sidecar set above is the authoritative write - never rely on the mirror.)

Read the full file on GitHub · 72 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. yesterday First seen · 72 lines · 27 tokens per session scan A 0b84e411d1f9

Subscribe to this mod's changes

researcher is a command published in the GitHub repository inferencegod/autonomy-loop (1 stars, last pushed 2mo ago), licensed MIT. It adds 27 tokens to every session and 1,691 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-31.