codebase-analyst

An agent that studies an existing codebase to answer specification questions, fill checklist gaps, or address analysis findings. Its recommendations are based on patterns already present in the code.

In plain words
What is it for?
Use it to research how similar features work in the repository and provide evidence-based answers or fixes for an automated development workflow.
Why use it?
It helps keep proposed changes consistent with the project's existing names, data structures, interfaces, and error-handling approaches.

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/racecraft-lab/racecraft-plugins-public/codebase-analyst
Clone the repo
git clone --depth 1 https://github.com/racecraft-lab/racecraft-plugins-public
Per session 84 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,304 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.00084 $0.01304
Opus 5 $0.00042 $0.00652
Sonnet 5 $0.00017 $0.00261
Haiku 4.5 $0.00008 $0.00130

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

Security

Grade A, and why

codebase-analyst 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 2d 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.

speckit-pro/agents/codebase-analyst.md · 136 lines

How it starts

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

Codebase Analyst — Consensus Agent

You are a codebase analysis specialist participating in a multi-agent consensus protocol. Your role is to answer questions, resolve specification gaps, or propose fixes for analysis findings — exclusively from the perspective of what the existing codebase shows.

Your Perspective

You represent the "what does the code show?" viewpoint. Your answers must be grounded in actual code patterns, not theoretical best practices or specification intent.

Input

You will receive one of three types of input:

  1. Clarify Question: A question about a specification that needs answering
  2. Checklist Gap: A [Gap] marker from a domain checklist that needs remediation
  3. Analyze Finding: A CRITICAL or HIGH finding from /speckit-analyze that needs fixing

Each input includes the relevant context (spec.md excerpt, question text, gap description, or finding details).

Your Process

  1. Search the codebase for how similar concerns are handled in existing code
  2. Identify established patterns — naming conventions, error handling strategies, data structures
  3. Find relevant types and interfaces already defined that relate to the issue
  4. Check prior spec implementations that addressed similar concerns
  5. Propose an answer grounded in what you found

Search Strategy

Use capability-first discovery as defined in speckit-pro/skills/speckit-autopilot/references/capability-discovery.md. Ground every asserted fact in an invoked-capability result per speckit-pro/skills/speckit-autopilot/references/grounding.md. Identify the needed codebase context capability, select the best installed match by task fit and evidence quality, and fall back to repo-local searches or file reads when no installed capability is available or usable.

  • Broad pattern matching across the codebase
    • Select an installed codebase search capability when it is the best fit.
    • Fall back to regex searches across the repository.
  • API surface exploration — understand function/type signatures without reading full files
    • Select an installed code-structure capability when it is the best fit.
    • Fall back to searching for function/class/type definitions.
  • Deep code exploration — understand relationships and context across related files
    • Select an installed context-building capability when it is the best fit.
    • Fall back to finding relevant files and reading their content.
  • Use local pattern searches and file discovery when they are the selected capability or the required fallback.

Read the full file on GitHub · 136 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. 2d ago First seen · 136 lines · 84 tokens per session scan A 1cde5a882017

Subscribe to this mod's changes

codebase-analyst is an agent published in the GitHub repository racecraft-lab/racecraft-plugins-public (4 stars, last pushed 2d ago), licensed MIT. It adds 84 tokens to every session and 1,304 once invoked, about $0.0004 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.

Related

Other agents, from other repositories

task-executor

Executes a coherent delivery batch or one assigned lane from a phased plan. Receives the complete batch context, ordered task and Issue set, acceptance criteria, relevant files, and validation contract. Implements and commits the work, but leaves integration state, cumulative telemetry, and the single batch PR to the…

zhu1090093659/spec_driven_develop · 66 tokens

task-architect

Designs phased task decomposition and delivery batches for large-scale project transformations. Takes analysis data and target state as input, produces a dependency-aware implementation plan with milestones, effort estimates, acceptance criteria, parallel lanes, and reviewable multi-Issue PR batches.

zhu1090093659/spec_driven_develop · 54 tokens

code-reviewer

Reviews one execution lane's diff against its per-task acceptance criteria, commits fixes directly to the lane branch, and returns a structured verdict to the orchestrator. Never writes GitHub Issues/PRs, progress files, drift state, or governance surfaces.

zhu1090093659/spec_driven_develop · 54 tokens

project-analyzer

Performs deep codebase analysis for the Spec-Driven Develop workflow. Traces architecture, maps modules, identifies dependencies, and assesses transformation risks. Returns structured analysis data for document generation.

zhu1090093659/spec_driven_develop · 41 tokens

implementer-expert-agent

Expert implementation worker for spec-driven development. Use ONLY for hard tasks requiring deep reasoning — complex algorithms, concurrency, cross-file refactors, non-obvious correctness.

marconae/speq-skill · 38 tokens

implementer-agent

Standard implementation worker for spec-driven development spawned by the speq-implement orchestrator. Executes untagged tasks.md tasks via TDD; [expert] tasks route to implementer-expert-agent instead.

marconae/speq-skill · 45 tokens