codebase-researcher

codebase-researcher is an agent for Claude Code from dsifry/metaswarm. It costs 54 tokens per session (3,124 once invoked), scanned A, original, MIT.

A read-only role that explores a codebase, its history, dependencies, documentation, and earlier solutions. It reports what already exists with file-and-line references.

In plain words
What is it for?
Use it to find existing patterns, related code, prior decisions, risks, and the exact files and lines that support those findings.
Why use it?
It provides verified repository context before planning or changing code, without making edits itself.

Agent for Claude Code

Written for Claude Code: $CLAUDE_PLUGIN_ROOT variable. Also seen: model in frontmatter; names the NotebookEdit tool.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the metaswarm plugin — 15 skills, 16 commands, 31 agents, 3 hooks shipped together

Good fit Use it to find existing patterns, related code, prior decisions, risks, and the exact files and lines that support those findings.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add dsifry/metaswarm
Claude Code
/plugin install metaswarm

Made for: Claude Code.

Or install metaswarm, the plugin that ships this one along with the rest of its 15 skills, 16 commands, 31 agents, 3 hooks.

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 codebase-researcher

README.md
[![agentmods](https://agentmods.dev/badge/agents/dsifry/metaswarm/codebase-researcher/github.svg)](https://agentmods.dev/agents/dsifry/metaswarm/codebase-researcher)
Your own site
<a href="https://agentmods.dev/agents/dsifry/metaswarm/codebase-researcher"><img src="https://agentmods.dev/badge/agents/dsifry/metaswarm/codebase-researcher/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for codebase-researcher

Your own site · 80×15
<a href="https://agentmods.dev/agents/dsifry/metaswarm/codebase-researcher"><img src="https://agentmods.dev/badge/agents/dsifry/metaswarm/codebase-researcher.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 54 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,124 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00054 $0.03124
Opus 5.5 $0.00022 $0.01250
Sonnet 5.5 $0.00011 $0.00625
Haiku 4.5 $0.00005 $0.00312

Measured today against content hash 79e24885dbb2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

codebase-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 today.

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.

agents/codebase-researcher.md · 451 lines

How it starts

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

Codebase Researcher

Type: codebase-researcher (replaces researcher, which stays one release as a deprecated alias) Role: Read-only codebase and prior-art-in-repo exploration Spawned By: Issue Orchestrator; brainstorming (alongside a deep-researcher) Tools: Codebase read, git history, library docs (Context7), BEADS CLI. Read-only: never edits the repo.

When to use this role, and when to use deep-researcher instead, is in guides/research-selection.md (plugin file; the plugin root is found with dirname "$(dirname "$(command -v metaswarm-agents.sh)")", or $CLAUDE_PLUGIN_ROOT if set).


Purpose

The codebase researcher answers "what exists?": the code, patterns, dependencies, docs, specs and prior work already in the repository, each fact cited as file:line. It gathers context before planning or design and identifies risks in the existing code. It does not research users, markets or design options; that is the deep-researcher's job.

Model. The default is sonnet. A brief may ask for haiku for a simple, narrow lookup (one symbol, one file, one count). Haiku cited about as accurately as Sonnet in a head-to-head but covered less, so keep Sonnet for anything broader (see guides/research-selection.md).

Citations. Cite every fact as path:line or path:start-end, and every count with the command that produced it. The orchestrator may run a citation-checker over your report before it is used, and corrects any line or count that does not match.


Context check mode

The orchestrator may spawn you as a context check of another research report, after the Haiku citation-checker has run on it. Pipeline: researcher(s) → citation check → context check → apply corrections → design. In this mode you do not research the topic; you check whether each cited source supports its claim in context.

For each MATCH, NEAR or COUNT citation from the citation check, and each corrected WRONG citation (check the claim as restated from what the lines say), read the cited lines plus their surrounding section (the function, the doc section, the plan step) and give one verdict. A correct count can still be applied to the wrong thing (a count that includes tests, cited for production code).

Read the full file on GitHub · 451 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. today First seen · 451 lines · 54 tokens per session scan A 79e24885dbb2

Subscribe to this mod's changes

codebase-researcher is an agent published in the GitHub repository dsifry/metaswarm (442 stars, last pushed yesterday), licensed MIT. It adds 54 tokens to every session and 3,124 once invoked, about $0.0002 per session on Opus 5.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-12-02.

Related

codebase-researcher compared with agents from other repositories

codebase-researcher next to 6 agents from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
codebase-researcherdsifry/metaswarmAgent442yesterdayMITA54Claude Code
playwright-test-generatormicrosoft/playwrightAgent102ktodayApache-2.0A151Claude Code
AVM Owner Triagegithub/awesome-copilotAgent42ktodayMITA61Claude Code
Ultimate Transparent Thinking Beast Modegithub/awesome-copilotAgent42ktodayMITA11Claude Code
Pimcore Expertgithub/awesome-copilotAgent42ktodayMITA26Claude Code
WinForms Expertgithub/awesome-copilotAgent42ktodayMITA19Claude Code
azure-iac-exportergithub/awesome-copilotAgent42ktodayMITA70Claude Code