Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
lzehrung avatar

Codegraph

  • 9 installs
  • 2 repo stars
  • Updated August 4, 2026
  • lzehrung/codegraph

Map an unfamiliar repo, trace imports and symbols, and estimate what a PR could break without guessing from text search alone.

About

Codegraph is an agent skill for structural repository intelligence: it indexes symbols, import edges, and dependency graphs so you can orient in a new codebase, follow definition and usage, spot cycles and hotspots, and reason about blast radius before or after a change. It is aimed at solo and indie builders shipping with Claude Code, Cursor, or similar agents who outgrow `rg` when direction of dependencies, exports, or PR impact matter. Use it when triggers sound like “understand this repo,” “what depends on this file,” “find references,” or “what could this diff break,” and keep text search alongside for literals and non-symbol patterns. The skill explicitly warns against treating graph output as the sole source for secrets or sensitive literals—you still validate those paths carefully. Complexity sits at intermediate because you need enough repo literacy to interpret graphs and impact reports, but the payoff is faster onboarding and safer refactors without spelunking every file by hand.

  • Builds dependency graphs, symbol indexes, go-to-definition, and find-references across many languages and graph-oriented
  • Answers import paths, cycles, hotspots, and public API surface when ripgrep alone is too shallow.
  • Produces PR/diff impact reports and suggests likely relevant tests from structural change.
  • Chunks files for agent context with lexical scope and dependency direction preserved.
  • Pairs with plain text search for strings, logs, and config keys that are not code symbols.

Codegraph by the numbers

  • 9 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 2, 2026 (Skillselion tracking)
  • Ranked #12,152 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/lzehrung/codegraph --skill codegraph

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs9
repo stars2
Last updatedAugust 4, 2026
Repositorylzehrung/codegraph

What it does

Map an unfamiliar repo, trace imports and symbols, and estimate what a PR could break without guessing from text search alone.

Files

SKILL.mdMarkdownGitHub ↗

Codegraph

Use Codegraph for structure-aware repo questions:

  • repo overview, hotspots, cycles, unresolved imports, and public API surface
  • symbol navigation with definitions, references, dependencies, and paths
  • PR or worktree impact review with candidate tests and risk signals
  • duplicate cleanup and refactor-risk triage
  • bounded agent context through orientation, search, packets, explain, and MCP

Prefer plain text search for raw strings, logs, config keys, secrets, and exact literals. Do not use Codegraph as the only evidence for runtime behavior; pair it with tests or execution.

First Move

Start bounded:

codegraph orient --root . --budget small --pretty

Use doctor only when install, native-runtime, or artifact health is the task.

For PR, worktree, or sweeping review tasks, start with codegraph review --base HEAD --head WORKTREE --summary or codegraph impact --base HEAD --head WORKTREE --pretty instead.

Then choose the smallest useful follow-up:

  • packet: codegraph packet get <file|symbol|sql-object|handle> --pretty
  • search: codegraph search "auth user" --json
  • explain: codegraph explain <file|symbol|sql-object|handle>
  • architecture: codegraph inspect ./src --limit 20
  • dependencies: codegraph deps <file> or codegraph rdeps <file>
  • path: codegraph path <from> <to>
  • cycles: codegraph cycles --sort priority
  • navigation: codegraph goto <file> <line> <column>
  • references: codegraph refs --file <file> --line <line> --col <column> --pretty
  • duplicates: codegraph duplicates --root . ./src --profile cleanup
  • impact: codegraph impact --base HEAD --head WORKTREE --pretty
  • review: codegraph review --base HEAD --head WORKTREE --summary
  • drift: codegraph drift ./src --base origin/main --head HEAD --pretty --graph-edges summary --public-api removals

Use --root to define the project boundary for config lookup, cache scope, path confinement, and output normalization. For orient, drift, and positional graph commands, positional paths are include roots inside that project.

Output Choice

Use readable output when a human or model will read the result. Use JSON when the next step needs exact fields, counts, or filtering.

Current high-value surfaces:

  • orient --pretty: ranked first-turn focus targets with copyable follow-ups
  • impact --pretty: ranked "what could this break?" map
  • review --summary: compact reviewer handoff
  • duplicates --profile cleanup: refactor ROI ordering
  • duplicates --json: full grouped duplicate data

Treat duplicate leads and call-compatibility hints as review leads, not proof.

MCP

If MCP tools are available, prefer them over repeated CLI invocations. Use MCP orient, search, packet_get, goto, refs, deps, rdeps, path, impact, and review first. Fall back to CLI when MCP is unavailable.

Discovery

Durable repo-local ignores belong in codegraph.config.json. One-off CLI filters use scan-root-relative --include-glob and --ignore-glob. Use --no-gitignore only when ignored files are intentionally in scope.

Installation Notes

Use the scoped packages only:

  • package: @lzehrung/codegraph
  • native backend: @lzehrung/codegraph-native

Registry:

npm config set "@lzehrung:registry" "https://npm.pkg.github.com"

Install:

npm install -g @lzehrung/codegraph

Do not suggest the unscoped codegraph package. Codegraph requires Node.js 24.10 or newer.

Related skills

AI & Agent Buildingbackendintegrationstesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.