/codebase:graph <symbol> [--depth 1-5] [--direction inbound|outbound|both]from codebase
Show a symbol's callers and callees. <symbol> [--depth 1-5] [--direction inbound|outbound|both]
Ships in codebase. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Explore a symbol's relationships in the codebase graph — who calls it, what it calls, what types it uses. Combines search_graph for symbol resolution with trace_path for relationship traversal.
| Argument | Type | Default | Description |
|---|---|---|---|
<symbol> | string | required | Function name, type name, or fully qualified name to explore |
--depth | integer | 2 | How many hops to traverse (1-5) |
--direction | string | both | Traversal direction: inbound (callers only), outbound (callees only), both |
If no symbol is provided:
Usage: /codebase:graph <symbol> [--depth 1-5] [--direction inbound|outbound|both]
Examples:
/codebase:graph writeJSON
/codebase:graph ValidateToken --depth 3
/codebase:graph HandleGet --direction inbound
/codebase:graph internal.auth.middleware.ValidateToken
Prefer MCP first. If its tools are absent or the server is unreachable, automatically try the CLI without asking:
command -v codebase-memory-mcp
codebase-memory-mcp cli --json list_projects
Set codebase_transport to mcp or cli. All tool calls below use that transport. For CLI calls, pipe the same JSON arguments to codebase-memory-mcp cli --json <tool> via stdin; inspect isError and read the result from content[] text. Use each tool's --help for supported flags and output formats. Query and indexing errors are not transport failures: report them accurately, not as missing MCP. On a later MCP connection failure, retry through CLI. Preserve project selection, index settings, and consent rules; do not install anything automatically.
Resolve the transport above. Only if neither MCP nor CLI works, explain that graph queries require either a configured MCP server or the installed codebase-memory-mcp CLI, then exit.
Read references/freshness.md and follow it for every project in scope.
Call list_projects and match against the current repo.
Call search_graph with:
name_pattern: a regex matching the provided symbol name (e.g., writeJSON becomes writeJSON)project: the matched project namelimit: 10If no results, also try semantic_query (array of strings, e.g. ["<symbol name>"]) with the symbol name as a natural language description.
If zero matches:
Symbol "[symbol]" not found in the index.
Try:
- `/codebase:index` to refresh the index
- A different name or spelling
- `/codebase:ask where does [symbol] live?`
If exactly one match: Proceed with that qualified name.
If multiple matches: Present disambiguation:
Multiple symbols match "[symbol]":
1. internal.auth.middleware.ValidateToken (internal/auth/middleware.go:45)
2. internal.api.auth.ValidateToken (internal/api/auth/handler.go:23)
3. pkg.auth.ValidateToken (pkg/auth/validator.go:12)
Which one? (enter number)
Ask the user to choose using the harness's question mechanism. In Claude Code this may be AskUserQuestion; in Pi, ask directly in chat and wait for the answer.
Call trace_path with:
function_name: the resolved qualified nameproject: the matched project namedirection: the --direction argument (default: "both")depth: the --depth argument (default: 2)Call get_code_snippet with the resolved qualified_name to get the symbol's source code.
## [function_name] ([file_path]:[line])
[Contextual explanation: what this symbol does, its role in the architecture,
why it exists. This is the LLM's synthesis — not a copy of the source code.]
### Callers ([count])
[file_path]:[function_name] (line [N])
[file_path]:[function_name] (line [N])
[file_path]:[function_name] (line [N])
... and [M] more
### Calls ([count])
[qualified_name_1]
[qualified_name_2]
[qualified_name_3]
If --direction is inbound, show only the "Callers" section.
If --direction is outbound, show only the "Calls" section.
If --direction is both (default), show both sections.
The contextual explanation should cover:
### Step 6: Offer a Shareable Copy
Read `references/share.md` and follow it.
## Context
Codebase plugin at `plugins/codebase/`. Commands directory already has `index.md`, `ask.md`, `impact.md`.
What SKILL.md sets; muted values are Claude Code's defaults
Use when the user names a specific symbol and wants its relationships: 'who calls X', 'what does X call', 'call graph for X', 'dependencies of X'. Supports depth and direction. Not for general how/where questions (use codebase:ask) or diff-based impact (use codebase:impact).
npx claudepluginhub jskswamy/skills --plugin codebase12 skills in this plugin
/dead-codeFind code nothing uses, with each candidate verified. [<path>]