code-explorer

A code-understanding agent that maps how parts of a software project connect, using the program’s structure and relationships. An AST is a structured representation of source code that helps it inspect symbols and calls.

In plain words
What is it for?
Use it to map a repository, trace an API or function call chain, inspect symbols and their callers, find references before renaming or removing code, and search code by meaning.
Why use it?
It helps when a project is unfamiliar or when a change may affect code in many places. Relationship-based searches can show where functions are defined, called, or referenced.

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/sdsrss/code-graph-mcp/code-explorer
Clone the repo
git clone --depth 1 https://github.com/sdsrss/code-graph-mcp
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 376 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.00028 $0.00376
Opus 5 $0.00014 $0.00188
Sonnet 5 $0.00006 $0.00075
Haiku 4.5 $0.00003 $0.00038

Measured yesterday against content hash 86ea5d66583e, 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 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.

claude-plugin/agents/code-explorer.md · 24 lines

What it actually says

You are a code exploration specialist with access to an AST knowledge graph.

Strategy

  1. Start with semantic_code_search to locate relevant code by meaning, or module_overview / project_map to map an unfamiliar directory or the whole repo
  2. Use get_call_graph to understand function relationships and call chains (pass route_path='GET /api/x' to trace an HTTP handler downstream)
  3. Use get_ast_node to get symbol metadata, source, and callers/callees (context_lines for surrounding source, include_impact for blast radius)
  4. Use find_references for rename/remove audits and ast_search to enumerate symbols by type / return / params
  5. Fall back to Grep/Read only when code-graph tools lack coverage (e.g., config files, non-code assets)

Rules

  • Always prefer structured graph queries over raw text search
  • Return structured findings: name, file, line, relationships
  • When reporting call chains, include depth and direction
  • Estimate token cost: if Read would require >3 files, prefer code-graph tools
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 · 24 lines · 28 tokens per session scan A 86ea5d66583e

Subscribe to this mod's changes

code-explorer is an agent published in the GitHub repository sdsrss/code-graph-mcp (70 stars, last pushed 5d ago), licensed MIT. It adds 28 tokens to every session and 376 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-30.

Related

Other agents, from other repositories

Plan Implementation Reviewer

Reviews the plan implementation across six dimensions — Architecture, Maintainability, Performance, Security, Completeness, and Bug Hunt — then produces a priority sorted report.

semihkayan/codeweave-mcp · 35 tokens

Junior Plan Implementer

Executes the plan literally. Uses a light model — the plan must be straightforward and unambiguous.

semihkayan/codeweave-mcp · 26 tokens

Plan Clarity Reviewer

Plan Clarity Reviewer reads a plan file and assesses its clarity.

semihkayan/codeweave-mcp · 18 tokens

mcp-server-integrator

Use this agent when the user wants to add, configure, or integrate MCP (Model Context Protocol) servers into the global Claude configuration. Examples: Context: User wants to add a new MCP server for file operations. user: "Добавь mcp сервер для работы с файлами" assistant: "I'll use the mcp-server-integrator agent to…

artk0de/TeaRAGs-MCP · 0 tokens

tp-api-surface-tracker

PROACTIVELY use this when the user asks "what changed in our public API", "did we break anyone", "is this a breaking release", or is about to cut a version. Diffs exported-symbols-of-now vs exported-symbols-at-N-commits-ago; classifies each change as MAJOR / MINOR / PATCH by semver rules.

Digital-Threads/token-pilot · 82 tokens

tp-audit-scanner

Use this when the user asks for a security / quality audit, pre-release sweep, or "scan this for issues". Finds hardcoded secrets, injection shapes, unsafe casts, stale TODOs — classified Critical / Important / Minor. Read-only, NEVER edits, never quotes secrets in output.

Digital-Threads/token-pilot · 64 tokens