|
@@ -29,12 +29,23 @@
|
|
|
export const CODEGRAPH_SECTION_START = '<!-- CODEGRAPH_START -->';
|
|
export const CODEGRAPH_SECTION_START = '<!-- CODEGRAPH_START -->';
|
|
|
export const CODEGRAPH_SECTION_END = '<!-- CODEGRAPH_END -->';
|
|
export const CODEGRAPH_SECTION_END = '<!-- CODEGRAPH_END -->';
|
|
|
|
|
|
|
|
-/** The full block, markers included, exactly as written to disk. */
|
|
|
|
|
|
|
+/**
|
|
|
|
|
+ * The full block, markers included, exactly as written to disk.
|
|
|
|
|
+ *
|
|
|
|
|
+ * The wording is deliberately CONDITIONAL ("in repositories indexed by…"):
|
|
|
|
|
+ * a global install writes this into a user-scope file (~/.claude/CLAUDE.md,
|
|
|
|
|
+ * ~/.codex/AGENTS.md) that applies to every project the user opens —
|
|
|
|
|
+ * including unindexed ones, where an unconditional "this repository is
|
|
|
|
|
+ * indexed" claim would send subagents into failing codegraph calls (the
|
|
|
|
|
+ * noise the unindexed-session policy exists to prevent).
|
|
|
|
|
+ */
|
|
|
export const CODEGRAPH_INSTRUCTIONS_BLOCK = `${CODEGRAPH_SECTION_START}
|
|
export const CODEGRAPH_INSTRUCTIONS_BLOCK = `${CODEGRAPH_SECTION_START}
|
|
|
## CodeGraph
|
|
## CodeGraph
|
|
|
|
|
|
|
|
-This repository is indexed by CodeGraph — a pre-built code knowledge graph. Reach for it BEFORE grep/find or reading files when you need to understand or locate code:
|
|
|
|
|
|
|
+In repositories indexed by CodeGraph (a \`.codegraph/\` directory exists at the repo root), reach for it BEFORE grep/find or reading files when you need to understand or locate code:
|
|
|
|
|
|
|
|
- **MCP tools** (when available): \`codegraph_explore\` answers most code questions in one call — the relevant symbols' verbatim source plus the call paths between them. \`codegraph_node\` returns one symbol's source + callers, or reads a whole file with line numbers. If the tools are listed but deferred, load them by name via tool search.
|
|
- **MCP tools** (when available): \`codegraph_explore\` answers most code questions in one call — the relevant symbols' verbatim source plus the call paths between them. \`codegraph_node\` returns one symbol's source + callers, or reads a whole file with line numbers. If the tools are listed but deferred, load them by name via tool search.
|
|
|
- **Shell** (always works): \`codegraph explore "<symbol names or question>"\` and \`codegraph node <symbol-or-file>\` print the same output.
|
|
- **Shell** (always works): \`codegraph explore "<symbol names or question>"\` and \`codegraph node <symbol-or-file>\` print the same output.
|
|
|
|
|
+
|
|
|
|
|
+If there is no \`.codegraph/\` directory, skip CodeGraph entirely — indexing is the user's decision.
|
|
|
${CODEGRAPH_SECTION_END}`;
|
|
${CODEGRAPH_SECTION_END}`;
|