Universal Code Navigator

AST-based call graph analysis for AI agents. 28 commands via CLI, MCP server, or agent skill.

Find callers. Trace impact. Detect dead code. Across JS/TS, Python, Go, Rust, Java, and HTML.

tree-sitter MCP 28 commands 6 languages runs locally
Get Started
terminal
$ ucn impact processOrder Impact analysis for processOrder src/orders/service.ts:45 CALL SITES: 3 Files affected: 3 BY FILE: src/api/checkout.ts (1 call) :89 [handleCheckout] await processOrder(cart.items, req.user) src/workers/batch.ts (1 call) :12 [batchProcess] processOrder(order.items, systemUser) src/jobs/daily.ts (1 call) :88 [runDailyOrders] results.push(await processOrder(items, admin))

What You Get

Semantic Analysis

Navigate code by meaning, not text. Tree-sitter ASTs understand your code structure across functions, classes, and modules.

Function Extraction

Pull out any function by name with ucn fn. Get clean, complete definitions from files of any size.

Call Tree Tracing

See the full call hierarchy with ucn trace. Map entire execution flows without reading files.

Impact Analysis

Know what breaks before you change it. ucn impact shows every call site with actual arguments.

Dead Code Detection

Find unused functions and classes with ucn deadcode. AST-verified, not text-matching.

Diff Impact

See what changed in a git diff and every downstream caller with ucn diff-impact. One command, full blast radius.

Three Ways to Use It

CLI, MCP server, or agent skill — same 28 commands everywhere.

CLI

Use directly from the terminal. Works standalone, no agent required.

$ ucn about myFunc

MCP Server

Any MCP-compatible AI agent connects and gets 28 commands automatically.

$ ucn --mcp

Agent Skill

Drop-in skill for Claude Code and OpenAI Codex CLI. No server needed.

/ucn about myFunc
Works with: Claude Code Cursor Windsurf VS Code Copilot OpenAI Codex CLI

Install

Global CLI

terminal
$ npm install -g ucn

MCP Server

one-line setup
# Claude Code
$ claude mcp add ucn -- npx -y ucn --mcp

# OpenAI Codex CLI
$ codex mcp add ucn -- npx -y ucn --mcp

# VS Code Copilot
$ code --add-mcp '{"name":"ucn","command":"npx","args":["-y","ucn","--mcp"]}'

Agent Skill

terminal
# Claude Code
$ mkdir -p ~/.claude/skills
$ cp -r "$(npm root -g)/ucn/.claude/skills/ucn" ~/.claude/skills/

# OpenAI Codex CLI
$ mkdir -p ~/.agents/skills
$ cp -r "$(npm root -g)/ucn/.claude/skills/ucn" ~/.agents/skills/

All 28 Commands

One ucn tool, every code navigation task covered.

Understand

aboutEverything in one call
contextCallers + callees
smartFunction + helpers inline
traceCall tree visualization
impactAll call sites with args
exampleBest usage example
relatedSibling functions

Find & Navigate

findLocate definitions
usagesAll occurrences by type
tocProject overview
searchText search
testsFind tests for a function
deadcodeUnused functions

Extract

fnExtract a function
classExtract a class
linesExtract line range
expandDrill into context

Architecture

importsFile dependencies
exportersWho depends on it
graphDependency tree
file_exportsFile's public API
typedefType definitions
apiPublic API surface
statsProject size stats
stacktraceError trace context

Refactor

diff_impactGit diff + callers
verifyCheck call sites match
planPreview a refactor

Before & After UCN

Same task, fewer tool calls, zero full-file reads.

Without UCN

grep "processOrder" → 34 matches, mostly noise
read service.ts → 800 lines
read handler.ts → 600 lines
read batch.ts → 400 lines
read orders.test → 500 lines
grep "import.*processOrder" → start over
read routes.ts → 300 lines
... still not sure about full impact
8+ tool calls · thousands of lines read

With UCN

ucn impact processOrder → 8 call sites, grouped by file, with actual arguments
ucn smart processOrder → function + all dependencies inline
Done. Full picture. Ready to make the change.
2 tool calls · zero full files read

Ready to navigate your code?

View on GitHub

This website uses cookies to enhance your experience.