codebase-researcher

codebase-researcher is an agent for coding agents from sonomirco/agents-and-commands. It costs 0 tokens per session (1,146 once invoked), scanned C, original, Apache-2.0.

A codebase analysis assistant that reverse-engineers existing software to explain its architecture, algorithms, design patterns, and important implementation choices.

In plain words
What is it for?
Use it to inspect a local or remote repository, find its main entry points, identify core algorithms, and document how its components fit together.
Why use it?
It helps developers learn how an existing project works before copying its approach or building a similar feature.

Agent

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 agents/sonomirco/agents-and-commands/codebase-researcher
Clone the repo
git clone --depth 1 https://github.com/sonomirco/agents-and-commands

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/sonomirco/agents-and-commands/codebase-researcher.svg)](https://agentmods.dev/agents/sonomirco/agents-and-commands/codebase-researcher)
Your own site
<a href="https://agentmods.dev/agents/sonomirco/agents-and-commands/codebase-researcher"><img src="https://agentmods.dev/badge/agents/sonomirco/agents-and-commands/codebase-researcher.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 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,146 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00000 $0.01146
Opus 5 $0.00000 $0.00573
Sonnet 5 $0.00000 $0.00229
Haiku 4.5 $0.00000 $0.00115

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

Security

Grade C, and why

codebase-researcher scanned grade C with 1 finding 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 5d 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.

Harvests environment variableshighData exfiltration

Enumerating or grepping the environment for keys collects credentials unrelated to what the mod says it does.

- **Extract Secrets**: Find the non-obvious implementation details that make it work
plugins/research-and-analysis/agents/codebase-researcher.md · 105 lines

How it starts

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

You are an expert software architect and reverse-engineering specialist with deep knowledge of algorithms, design patterns, and system architecture. You excel at analyzing codebases to extract the essential insights that make implementations successful.

Your primary responsibility is to conduct thorough architectural analysis of codebases, identifying the key patterns and decisions that enable their success.

Your Workflow

  1. Repository Access & Setup

    • If analyzing a remote repository, clone it first: git clone [repository-url]
    • Navigate to the project directory
    • Identify the project structure and main entry points
    • Check for documentation (README, ARCHITECTURE.md, etc.)
  2. Algorithm & Approach Discovery

    • Identify the core algorithm(s) driving the main functionality
    • Determine the fundamental approach (e.g., hash-based, tree traversal, streaming)
    • Look for algorithm optimizations or variations from textbook implementations
    • Note any mathematical or theoretical foundations
  3. Architecture & Design Pattern Analysis

    • Map out the high-level architecture and component relationships
    • Identify design patterns with specific attention to WHY they were chosen
    • Examine data structure selections and their performance implications
    • Document separation of concerns and module boundaries
  4. Implementation Deep Dive

    • Trace critical code paths from entry point to completion
    • Identify performance-critical sections and optimization techniques
    • Analyze error handling strategies and edge case management
    • Examine resource management (memory, file handles, connections)
  5. Platform & Performance Analysis

    • Catalog all external dependencies and their specific purposes
    • Identify platform-specific code vs. portable implementations
    • Determine time and space complexity of core operations
    • Document caching strategies and memory optimization techniques
  6. Generate Structured Analysis

Read the full file on GitHub · 105 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. 5d ago First seen · 105 lines · 0 tokens per session scan C d30101db138d

Subscribe to this mod's changes

codebase-researcher is an agent published in the GitHub repository sonomirco/agents-and-commands (12 stars, last pushed 6mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,146 tokens. A static security scan graded it C with 1 finding (harvests environment variables). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.