codebase-memory

Query a codebase knowledge graph for call chains, dependencies, and dead code analysis.

Updated Nov 25, 2024
One-click install
npx skills add https://github.com/cbrostrom/dotfiles --skill codebase-memory-cbrostrom
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: codebase-memory
Source: https://github.com/cbrostrom/dotfiles/tree/main/stow/agents/.agents/skills/codebase-memory
Command: npx skills add https://github.com/cbrostrom/dotfiles --skill codebase-memory-cbrostrom

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Manual code exploration with grep and file reading burns thousands of tokens and still misses cross-service relationships. This Skill queries a pre-indexed knowledge graph of the codebase, returning precise structural answers—callers, callees, dependencies, dead code—in roughly 500 tokens instead of 80K. ## Core Features & Use Cases - Call Chain Tracing: Trace inbound, outbound, or bidirectional call paths from any function with depth control and risk labels. - Structural Search: Find functions by name pattern, filter by fan-in/fan-out degree, and detect dead code by excluding entry points. - Cypher Queries & Change Impact: Run raw Cypher for cross-service edge analysis and map git diffs to affected symbols with detect_changes. - Use Case: Before refactoring a shared handler, ask who calls it—the graph returns every inbound caller across services, including HTTP and async edges that grep would miss. ## Quick Start Ask the agent to trace who calls a specific function in the indexed codebase and show its full call context.

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 every caller. If you only know part of the name, run search_graph with a name_pattern first to discover the exact symbol.

How to detect dead code with a knowledge graph?▼

Run search_graph with max_degree set to 0 and exclude_entry_points set to true. This returns functions with no inbound or outbound relationships that are not application entry points, marking them as dead code candidates.

When should I use query_graph instead of search_graph?▼

Use query_graph with raw Cypher when you need to inspect actual edges, such as HTTP_CALLS with url_path and confidence values. search_graph filters nodes by degree and does not display edge properties.

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 confirm the exact symbol, and verify the project is indexed with list_projects.

What are the limitations of codebase graph queries?▼

query_graph caps results at 200 rows, and search_graph paginates at 10 results per page, requiring offset and has_more checks. Outbound-only tracing misses cross-service callers, so use direction both for full context.