Skip to content

Commit 04dbfe6

Browse files
docs: update CLAUDE.md dogfooding section to follow our own recommended practices
Add the 6-step before/after workflow (where, explain, context, fn-impact, diff-impact), flag guidance (-T, -f, -k), and missing commands (stats, search, where, explain, context, fn-impact).
1 parent 5965fb4 commit 04dbfe6

1 file changed

Lines changed: 23 additions & 7 deletions

File tree

CLAUDE.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,34 @@ The workflow can be overridden with a specific version via the `version-override
9797

9898
## Dogfooding — codegraph on itself
9999

100-
Codegraph is **our own tool**. Use it to analyze this repository before making changes:
100+
Codegraph is **our own tool**. Use it to analyze this repository before making changes. If codegraph reports an error, crashes, or produces wrong results when analyzing itself, **fix the bug in the codebase** — don't just work around it.
101101

102+
### Before modifying code, always:
103+
1. `node src/cli.js where <name>` — find where the symbol lives
104+
2. `node src/cli.js explain <file-or-function>` — understand the structure
105+
3. `node src/cli.js context <name> -T` — get full context (source, deps, callers)
106+
4. `node src/cli.js fn-impact <name> -T` — check blast radius before editing
107+
108+
### After modifying code:
109+
5. `node src/cli.js diff-impact --staged -T` — verify impact before committing
110+
111+
### Other useful commands
102112
```bash
103-
node src/cli.js build . # Build/update the graph
113+
node src/cli.js build . # Build/update the graph (incremental)
114+
node src/cli.js map --limit 20 # Module overview & most-connected nodes
115+
node src/cli.js stats # Graph health and quality score
116+
node src/cli.js fn <name> -T # Function call chain (callers + callees)
117+
node src/cli.js deps src/<file>.js # File-level imports and importers
118+
node src/cli.js diff-impact main # Impact of current branch vs main
104119
node src/cli.js cycles # Check for circular dependencies
105-
node src/cli.js map --limit 20 # Module overview & coupling hotspots
106-
node src/cli.js diff-impact main # See impact of current branch changes
107-
node src/cli.js fn <name> # Trace function-level dependency chains
108-
node src/cli.js deps src/<file>.js # See what imports/depends on a file
120+
node src/cli.js search "<query>" # Semantic search (requires `embed` first)
109121
```
110122

111-
If codegraph reports an error, crashes, or produces wrong results when analyzing itself, **fix the bug in the codebase** — don't just work around it. This is the best way to find and resolve real issues.
123+
### Flags
124+
- `-T` / `--no-tests` — exclude test files (use by default)
125+
- `-j` / `--json` — JSON output for programmatic use
126+
- `-f, --file <path>` — scope to a specific file (partial match)
127+
- `-k, --kind <kind>` — filter by symbol kind (function, method, class, etc.)
112128

113129
## Parallel Sessions
114130

0 commit comments

Comments
 (0)