Trace-mcp trace-mcp
Use trace-mcp tools for code navigation, impact analysis, and framework-aware queries instead of Read/Grep/Glob/Bash. Activate whenever the agent needs to explore, understand, or modify a codebase that has trace-mcp indexed.
install
source · Clone the upstream repo
git clone https://github.com/nikolai-vysotskyi/trace-mcp
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/nikolai-vysotskyi/trace-mcp "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/trace-mcp" ~/.claude/skills/nikolai-vysotskyi-trace-mcp-trace-mcp && rm -rf "$T"
manifest:
skills/trace-mcp/SKILL.mdsource content
trace-mcp — Code Intelligence Routing
trace-mcp is a framework-aware code intelligence MCP server. It exposes 120+ tools that return semantic, structured results over a cross-language dependency graph. When trace-mcp is available, it is almost always cheaper and more accurate than native file tools.
When to Use
Activate this skill whenever you need to:
- Find a function, class, method, route, component, or any symbol
- Understand a file, module, or feature before editing
- Determine what breaks if you change something
- Trace a request flow, call graph, or data flow
- Audit architecture, dead code, tests, or security
Do not use
Read, Grep, Glob, or shell ls/find/cat/head/tail for exploring source code (.ts, .js, .py, .php, .go, .rb, .java, etc.). Use trace-mcp tools instead. Native tools stay allowed only for non-code files (.md, .json, .yaml, configs) or immediately before an Edit on a known file.
Start-of-Session Checklist
withget_project_map
— orient yourself to the project structuresummary_only=true
withget_task_context
— gather all relevant code in a single call instead of chainingtask: "<natural-language description>"
→search
→get_symbolRead
Decision Matrix
| Task | trace-mcp tool | Instead of |
|---|---|---|
| Find a symbol by name | | Grep |
| Understand a file before editing | | Read (full file) |
| Read one symbol's source | | Read (full file) |
| Multiple symbols + shared imports | | chained |
| What breaks if I change X | | guessing |
| Who calls this / what does it call | | Grep |
| All usages of a symbol | | Grep |
| Implementations of an interface | | Grep / ls |
| Classes implementing X | with filter | Grep |
| Tests for a symbol or file | | Glob + Grep |
| Project overview | (summary_only) | Bash ls/find |
| Context for a task | / | reading many files |
| HTTP request flow | | reading route + controller files |
| DB model relationships | | reading model + migrations |
| Component tree | | reading component files |
| Circular dependencies | | manual tracing |
| Dead code / dead exports | / | Grep for unused |
| Project health / coverage gaps | | manual inspection |
| Complexity / hotspots | / | guessing |
Token-Efficiency Rules
- Batch independent queries. Use
when you need 2+ independent tool calls:batchbatch({ calls: [ { tool: "get_outline", args: { path: "src/foo.ts" } }, { tool: "get_outline", args: { path: "src/bar.ts" } }, { tool: "search", args: { query: "handleRequest", kind: "function" } } ]}) - Never read the same file twice. Use
once, thenget_outline
for specific pieces.get_symbol - Prefer
over chainedget_context_bundle
calls — it deduplicates shared imports.get_symbol - Read-before-Edit optimization. When you must
a file to edit it:Read- Call
first to find the line range of the target symbol.get_outline - Read only that range with
+offset
. Never read a 500-line file to edit 5 lines.limit
- Call
- Do not delegate code exploration to subagents. Agent subprocesses carry ~50k tokens of overhead before doing anything. Use trace-mcp tools in the main conversation instead.
After Editing a File
- Call
with the editedregister_edit
to reindex just that file and invalidate caches. This is much lighter than a fullfile_path
and keeps subsequent queries accurate.reindex - If the response includes
, review the referenced symbols — you may be duplicating existing logic._duplication_warnings - Do not re-read the file to "verify" the edit. The
tool already confirmed success.Edit
Before Creating New Symbols
- Call
withcheck_duplication
to verify no similar symbol exists. Prevents reinventing existing logic.{ name, kind }
Health Checks (Once Per Session)
— stale references in CLAUDE.md / settingsaudit_config
— dead exports, untested code, hotspotsself_audit
— per-module tech-debt gradesget_tech_debt
— detects repeated reads, Bash grep usage, missed trace-mcp opportunitiesget_optimization_report
Related Skills
— safe refactoring workflow (risk assessment → rename → impact check)trace-mcp-refactoring
— bulk mechanical changes viatrace-mcp-codemodapply_codemod
— security, quality-gate, and antipattern checks before committrace-mcp-pre-commit