Repository navigation
Description
Summary
Graphify currently doesn't index .sh (bash) or .json files at the AST level — these extensions aren't in the extension→extractor map in graphify/extract.py, and the corresponding tree-sitter-bash / tree-sitter-json packages aren't dependencies.
Result: graphs of repositories that include hook scripts, CI configs, MCP configs, package manifests, and other operationally-relevant files have no nodes for any of that content. graphify get_node "scripts/hooks/my-hook.sh" returns "not found" even when the file exists.
Reproduction
In a fresh graphify venv:
# Verify parsers
pip list | grep -E "tree.?sitter"
# No tree_sitter_bash or tree_sitter_json
# Verify extension map
grep -E "\.(sh|json)" graphify/extract.py
# No .sh entry; only stray .json references for tsconfig.json path resolution
# Verify empirical
graphify update /path/to/repo-with-shell-scripts
graphify query "any-bash-symbol-in-the-repo" # zero resultsWhy this matters
For users on AI agent platforms (Claude Code, Codex, Cursor, etc.), a significant portion of the "operating environment" lives in shell + JSON:
.claude/settings.json— hook registration, MCP servers, permissionsscripts/hooks/*.sh— PreToolUse / PostToolUse / Stop hooks.mcp.json— MCP server configurationpackage.json— script entry points
These files contain real cross-references (a settings.json matcher points at a hook script; a hook script invokes another shell script; a package.json script references a .sh entry-point). Without bash/json indexing, queries like "how does PreToolUse on Bash get gated?" return zero hits — agents fall back to manual file walks.
Proposed fix
- Add
tree-sitter-bashandtree-sitter-jsontopyproject.tomldependencies. - Register the parsers in graphify's language map (whichever file holds the tree-sitter language registration).
- Add extension→extractor entries:
".sh": extract_bash, ".bash": extract_bash, ".json": extract_json,
- Write
extract_bash(functions + top-level commands) andextract_json(top-level keys + nested object refs) — both can be lightweight; the goal is file + symbol nodes, not deep semantic analysis.
Workaround
For users who can't wait, a workspace-local monkey-patch:
# scripts/persistence/graphify-bash-json-shim.py
import graphify.extract as e
# ... register bash + json extractors ...
import sys; sys.exit(__import__("graphify.__main__").main())But this is fragile and breaks on graphify upgrades. Upstream support is the right answer.
Context
Surfaced while building a 6-layer agent intelligence stack (graphify + lightrag + ruflo + mempalace + nexus + obsidian-mind). Graphify's blind spot for the agent operating environment was the root cause of a protocol violation: when the protocol demanded "query graphify before grep," graphify had nothing to return for hook-mechanism questions, so the fallback path (manual grep) became the only option.
Happy to contribute the PR if there's interest in this scope.
Activity
safishamsi commentedon May 14, 2026
Fixed in branch v8, commit 40b9b84.
Added
extract_bash()andextract_json()extractors and registered.sh,.bash,.jsonin_DISPATCH. Addedtree-sitter-bashandtree-sitter-jsonas dependencies.Bash extracts: functions (with
definesedges), cross-functioncallsedges,source/.\ imports resolved to file paths,export/declare` variable declarations.JSON extracts: top-level and nested keys (
containstree),dependencies/devDependencies→importsedges,extendsedges (tsconfig/eslint),$refreferences. Size guard skips files > 1 MiB.19 new tests, 798 passing total. The monkey-patch workaround mentioned in the issue is no longer needed.
Add tree-sitter bash and JSON extractors (Graphify-Labs#866)
feat(multigraph): add runtime compatibility probe (#956)
Add tree-sitter bash and JSON extractors (Graphify-Labs#866)
feat(multigraph): add runtime compatibility probe (Graphify-Labs#956)
Add tree-sitter bash and JSON extractors (Graphify-Labs#866)