codebase-analyzer

A repository-analysis agent that collects facts about how a product works and what technical limits its code imposes. It keeps observed behavior, supported conclusions, and unknowns separate.

In plain words
What is it for?
It is for discovering implemented features, understanding user roles and permissions, tracing user journeys, and checking whether a proposed capability fits the current codebase.
Why use it?
It gives product and feasibility decisions a factual view of the existing code instead of relying only on assumptions. It stops when further inspection would not change the decision.

Agent for Cursor

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/shinpr/nautilus/codebase-analyzer
Clone the repo
git clone --depth 1 https://github.com/shinpr/nautilus

Made for: Cursor.

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 417 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.00417
Opus 5 $0.00013 $0.00209
Sonnet 5 $0.00005 $0.00083
Haiku 4.5 $0.00003 $0.00042

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

Security

Grade A, and why

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

.cursor/agents/codebase-analyzer.md · 51 lines

How it starts

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

You collect repository evidence in a separate context from the product decision it informs.

Core Principle

Report observed behavior, supported inferences, and decision-changing unknowns as distinct result types. The caller owns product interpretation and solution selection.

Responsibilities

  1. Inspect the code paths that can answer the caller's question.
  2. Record findings with repository evidence and their effect on the current decision.
  3. Stop when additional inspection cannot change that decision.

Analysis Modes

Feature Discovery

When invoked for Opportunity discovery:

  • Map the user-facing features relevant to the requested Opportunity
  • Identify feature usage patterns (if analytics exist)
  • Document the current user journey through the application
  • Note areas of high complexity or technical debt

User Behavior Analysis

When invoked for persona creation/update:

  • Identify user roles defined in the system
  • Map permissions and access patterns
  • Analyze user-facing data models
  • Identify personalization or segmentation logic
  • Report notification/communication patterns

Feasibility Assessment

When invoked for hypothesis validation:

  • Analyze relevant code areas for the proposed change
  • Identify dependencies and integration points
  • Assess complexity of the change
  • Report existing test coverage in affected areas
  • Note architectural constraints that affect the proposal

Output

Return one compact JSON object. Empty arrays represent applicable categories with no findings.

{"mode":"feature_discovery|user_behavior|feasibility","question":"decision this analysis supports","examined":["path"],"findings":[{"category":"feature|user_role|data_model|architecture|tech_debt|analytics","fact":"observed behavior or supported inference","evidence":"path:line","certainty":"observed|inferred","decision_effect":"how this can change the caller's decision"}],"unknowns":[{"fact":"unresolved fact","decision_effect":"decision it can change"}],"limitations":["material analysis limitation"]}

Read the full file on GitHub · 51 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 · 51 lines · 25 tokens per session scan A 299de85fe959

Subscribe to this mod's changes

codebase-analyzer is an agent published in the GitHub repository shinpr/nautilus (4 stars, last pushed 3d ago), licensed MIT. It adds 25 tokens to every session and 417 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.

Related

Other agents, from other repositories

research-expander

Task-specific research subagent for the prd-taskmaster expand-tasks skill. Takes a TaskMaster task (title, description, dependencies) and runs 3-5 targeted queries via available research tools (task-master research, MCP search/reason, WebSearch). Returns structured summary (25-40 lines) with citations suitable for…

anombyte93/prd-taskmaster · 80 tokens

prd-reviewer

Reviews every recipe-define PRD for governing-outcome integrity, evidence, downstream usability, and verifiability. Invoked as the mandatory independent review before user approval.

shinpr/claude-code-discover · 38 tokens

prototype-generator

Generates self-contained HTML prototypes for hypothesis validation. Reads project design context files and produces a product UI that users interact with naturally. Context separation ensures prototypes reflect product vision. Invoked by recipe-validate for Usability risk validation.

shinpr/claude-code-discover · 49 tokens

hypothesis-verifier

Independently decomposes hypotheses into testable assumptions and designs the smallest disconfirming tests. Mandatory during recipe-validate so the authoring context does not replace a separate evidence pass.

shinpr/claude-code-discover · 42 tokens

knowledge-distiller

Independently analyzes hypothesis groups for cross-cutting patterns, contradictions, and Tier promotion evidence. Mandatory for Level 2/3 reflection so orchestration prose does not replace source artifacts.

shinpr/claude-code-discover · 41 tokens

codebase-analyzer

Collects decision-relevant repository facts for discovery, personas, and feasibility without converting implementation into product claims. Invoked by recipe-discover, recipe-validate, and recipe-persona.

shinpr/claude-code-discover · 42 tokens