codegraph-adhoc
Ad hoc context lookup across every repo under ~/git.work using the codegraph CLI from bash, from any working directory (including ~ or non-indexed dirs). Locate a symbol, file, flag, table, or flow fa
Files1
View on GitHubSKILL.mdpi/skills/codegraph-adhoc/SKILL.md
GitHubcodegraph-adhoc
Quick, cheap context lookups against the shared ~/git.work graph. For deep work
inside one repo, use the codegraph skill and its codegraph_explore tool instead.
Facts from past sessions
- Only three indexes exist:
~/git.work/.codegraph(root,21.9k files, all repos),/git.work/322.PlatformSync-Logic-Service` still searches all repos, so results from other repos leak in.353.e2e-bdd-playwright, and380.sdd_scheduler_workspace.. Every other repo path walks up to the root graph. A path like ` - Root explore costs ~30 s and has a budget of 4 calls.
query,node, andcallerstake under 1.5 s each. - These failed in past sessions:
structure_only/context --no-codeon the root: command failed.- Huge multi-repo "trace everything" queries:
aborted/timed out. - Non-code files (
.yml,jest.config.js,.idea/*, some.md):No relevant code found. - Any command during an index or sync:
database is locked.
~/svnis not indexed.
Ladder: cheapest first
Always pass -p ~/git.work so the command works from any cwd. Prefix paths with the
repo folder, e.g. 322.PlatformSync-Logic-Service/src/....
- Locate the symbol, file, or string name. Returns repo/file:line.
codegraph query EntityOrderingLock -p ~/git.work -l 10 codegraph query isPatientFormV2Enabled -p ~/git.work -k function -j - Read one symbol or file. Returns source plus callers, callees, and dependents.
codegraph node EntityOrderingLock -p ~/git.work -f 322.PlatformSync-Logic-Service/src/functions/inbound/services/entityOrderingLock.ts codegraph node -p ~/git.work -f <repo>/<file> --symbols-only # symbol map only codegraph node -p ~/git.work -f <repo>/<file> --offset 120 --limit 80 - Who uses it / what breaks:
The root graph matches by bare name across all repos. Generic names (codegraph callers <symbol> -p ~/git.work -l 20 codegraph callees <symbol> -p ~/git.work codegraph impact <symbol> -p ~/git.work -d 2debug,handler,acquire) can resolve to the wrong repo, so check the repo prefix on every hit. - List a repo's files:
codegraph files -p ~/git.work --filter 322.PlatformSync-Logic-Service/src/functions --format flat --no-metadata - Explore a flow. Use this only after steps 1–3 have named the symbols.
Run it withcodegraph explore -p ~/git.work --max-files 4 \ "Only 322.PlatformSync-Logic-Service: handler -> EntityOrderingLock.acquire -> release"timeout 120. Use thecodegraph_exploretool for the same job if it is loaded.
Query habits that worked
- Name concrete symbols plus repo-prefixed paths:
"317.rt-scheduler-iq-dev/src/modules/scheduler/rules_engine/rule_checker.py RuleChecker._run_slot_evaluation run_rules_once". - Scope root queries: start with
Only <repo>:and end withExclude other repos. - For a flow, name both ends:
"how does createAppointment reach sqsPublish". - For one or two repos, name them in the query instead of asking "across all repositories". Split cross-repo questions into one query per repo.
- Feature flags, table names, and config keys are often constants. Run
queryon the exact string first.
Fall back to plain tools when
- The target is config, YAML, a workflow, an IDE file, or docs: use
read, orrgin that repo. queryreturns nothing for an exact string literal (strings in bodies are not symbols): userg -n '<string>' ~/git.work/<repo>.- You get
database is locked: an index or sync is running. Wait, or userg. Never rununlockunless the user asks. - The target is in
~/svn: not indexed, userg.
Freshness
The index does not watch files. If results look stale after pulls, run
codegraph sync ~/git.work (incremental, in the background with nohup, tail the log
with a timeout). Never run init, index, uninit, or daemon.
Report
Answer with repo/path:line citations from the output. Say which part of the
question was not covered. Do not paste whole explore dumps.
In Claude Code
The codegraph_explore tool is named mcp__codegraph__codegraph_explore here. The CLI steps above work unchanged through Bash.