Codebase Memory First
Use codebase-memory MCP as the primary source for code discovery, dependency tracing, impact analysis, and architecture orientation
Source: .agents/rules/codebase-memory-first.mdc
Metadata
- name: codebase-memory-first
- alwaysApply: true
Content
Codebase Memory First
For code discovery, follow .agents/references/coding-standard/codebase-memory-guidance.md.
- Resolve the indexed project by exact current-worktree
root_path. Runindex_repositorybefore code discovery when that worktree is not indexed. - Use
search_graphfirst for symbols, routes, modules, and natural-language code discovery. - Use
trace_pathfor callers, callees, dependency paths, and impact analysis. - Use
get_code_snippetonly aftersearch_graphreturns the exact qualified name. - Use
query_graphfor complex structural questions andget_architecturefor broad orientation. - Use
search_codefor source literals or test patterns when graph symbol search is insufficient. - Fall back to
rg/findfor non-code files, config values, generated/excluded paths, or when MCP results are insufficient. Record the fallback reason in implementation or review notes. - Read the current source file before editing. The graph accelerates discovery but does not replace live source, tests, API documentation, or product requirements.