codebase-memory

Query a codebase knowledge graph to trace calls, find dead code, and analyze dependencies.

1|Updated Jan 30, 2026
One-click install
npx skills add https://github.com/chshzh/claude --skill codebase-memory-chshzh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codebase-memory
Source: https://github.com/chshzh/claude/tree/main/skills/codebase-memory
Command: npx skills add https://github.com/chshzh/claude --skill codebase-memory-chshzh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Grepping a large codebase to understand structure, call chains, and dependencies is slow and token-expensive. This Skill answers structural code questions through a knowledge graph, returning precise results in roughly 500 tokens instead of tens of thousands. ## Core Features & Use Cases - Call Tracing: Find who calls a function, what a function calls, or the full call context using trace_path with inbound, outbound, or both directions. - Structural Search: Locate functions by name pattern, detect dead code via zero-degree nodes, and identify high fan-in or fan-out refactor candidates. - Cypher Queries: Run custom graph queries for cross-service edges like HTTP_CALLS, with access to 14 MCP tools including index_repository, detect_changes, and get_architecture. - Use Case: Before refactoring a shared utility function, trace its inbound callers across services, check impact with detect_changes against your git diff, and confirm no dead code depends on it. ## Quick Start Ask Claude to use the codebase-memory skill to trace who calls the function you are about to modify.

Frequently Asked Questions about codebase-memory

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find all callers of a function in a codebase?

Use trace_path with direction set to inbound and the exact function name to list all callers. If you only know part of the name, first run search_graph with a name_pattern to discover the exact qualified name.

How to detect dead code and unused functions in a project?

Run search_graph with max_degree set to 0 and exclude_entry_points set to true. This returns functions with no incoming or outgoing call edges, excluding legitimate entry points like main handlers.

When should I use query_graph with Cypher instead of search_graph?

Use query_graph with Cypher when you need to inspect actual edges such as HTTP_CALLS with their url_path and confidence properties. search_graph filters nodes by degree and does not display edge details, but it avoids the 200-row cap of query_graph.

Why does trace_path return no results for my function?

trace_path requires exact function names, so partial or misspelled names return nothing. Run search_graph with a name_pattern first to find the exact name, and use direction both since outbound-only tracing misses cross-service callers.

Does the codebase knowledge graph work before indexing a project?

No, the project must be indexed first. Run list_projects to check whether it is already indexed, and use index_repository to index it if missing. You can verify progress with index_status.