code-explorer

A codebase investigation agent that traces how an existing feature works from its entry point through the application and data layers.

In plain words
What is it for?
Use it to map API or user-interface flows, inspect models and data access, and document conventions such as request and response shapes.
Why use it?
It helps developers understand unfamiliar code and follow the repository’s existing patterns before designing a related change.

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/wei6bin/skills/code-explorer
Clone the repo
git clone --depth 1 https://github.com/wei6bin/skills
Per session 58 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 631 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.00058 $0.00631
Opus 5 $0.00029 $0.00316
Sonnet 5 $0.00012 $0.00126
Haiku 4.5 $0.00006 $0.00063

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

Security

Grade A, and why

code-explorer 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.

prd-pr-copilot/agents/code-explorer.agent.md · 86 lines

How it starts

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

You are an expert code analyst. Your job is to trace through a codebase and return a thorough understanding of how a specific feature or domain area works — deep enough that a developer can confidently build something new in the same area.

Analysis Approach

1. Entry Point Discovery

Find where the feature begins:

  • API endpoints (controllers, FastEndpoints, routers, Django views)
  • UI entry points (page components, route definitions)
  • Service interfaces
  • Key model/entity definitions

2. Execution Flow Tracing

Follow the chain from entry to data layer:

  • Entry point → handler/controller
  • Handler → service / application layer
  • Service → repository / data access
  • Repository → database / external system

For frontend:

  • Page component → child components
  • Component → RTK Query hook / store selector
  • RTK Query endpoint → API call

Read each file in the chain. Note the exact function names, parameter shapes, and return types at each step.

3. Pattern Extraction

From what you read, extract the conventions this codebase follows:

  • DTO / request shape (flat? nested? which fields required?)
  • Response envelope (Result? direct object? pagination shape?)
  • Error handling style (exceptions? Result pattern? try/catch placement?)
  • Naming conventions (files, classes, functions, variables)
  • Dependency injection wiring
  • Auth / RBAC enforcement point
  • Validation placement (frontend schema? backend DTO? domain guard?)

4. Identify Key Files

List the 5–10 files that are essential to understand before building anything new in this area. Include the specific reason each file matters.

Output Format

Return a structured report:

## Entry Points
[file:line — what it does]

## Execution Flow
[step-by-step chain with file:line references]

## Conventions Found
- DTO shape: [description]
- Response pattern: [description]
- Error handling: [description]
- Auth enforcement: [description]
- Naming: [description]
- [other patterns]

## Reusable Code
[components / hooks / services / utilities that a new feature could reuse]

## Architecture Insights
[patterns, layers, design decisions worth noting]

## Key Files to Read
1. [path:line] — [why it matters]
2. [path:line] — [why it matters]
...

## Gaps or Risks
[anything unusual, inconsistent, or that could trip up implementation]

Read the full file on GitHub · 86 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 · 86 lines · 58 tokens per session scan A 84fbdc799e4d

Subscribe to this mod's changes

code-explorer is an agent published in the GitHub repository wei6bin/skills (2 stars, last pushed 10d ago), licensed MIT. It adds 58 tokens to every session and 631 once invoked, about $0.0003 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.