jeromeetienne / jeromeetienne/codespine
Integrate ts_knowledge_graph with Claude Code (Graphify-style)
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Goal
Integrate ts_knowledge_graph with Claude Code (and other agents) the way Graphify is — let the agent query the knowledge graph instead of blindly grepping the codebase.
How Graphify does it
Graphify's Claude Code integration is a bundle of three standard Claude Code extension points:
- A
CLAUDE.mddirective — tells Claude to read the generated graph report before answering architecture/dependency questions. - A
PreToolUsehook insettings.json— fires before everyGrep/Globcall so the graph is consulted first (the "always-on" angle they advertise). - An MCP server exposing the graph as callable tools — the most agent-native path, still on Graphify's roadmap (their issue #146), not shipped.
Why we are well positioned
The query layer is already designed as "JSON in, JSON out" agent tools:
GraphQuerymethods (whoCalls,blastRadius,deadExports,neighborhood,references) map one-to-one onto agent tools.- Every CLI query command accepts
--json.
The hard part (a clean, machine-readable query surface) is done; integration is plumbing on top.
Options (lowest to highest effort)
| Approach | What it is | Effort | Best when |
|---|---|---|---|
| CLAUDE.md + slash commands | A directive telling Claude to run ts-knowledge-graph blast-radius <id> --json for impact questions, plus optional /blast-radius commands in .claude/commands/ |
Tiny | Just want Claude to know the tool exists and use it |
| A Skill | A .claude/skills/ skill documenting when/how to invoke the CLI via Bash |
Small | Want automatic triggering + self-documentation — closest to how Graphify ships |
| PreToolUse hook | Intercept Grep/Glob, inject graph context or remind Claude to query the graph first |
Small–medium | Want it consulted before search, not on demand |
| MCP server | Wrap GraphQuery as MCP tools (who_calls, blast_radius, dead_exports, …) so Claude calls them natively, no Bash |
Medium | The most native, portable path — works across Claude Code, Cursor, etc. |
Proposed plan
- Start with a Skill — matches Graphify's actual shipping form, fastest to value. Wraps the existing
--jsonCLI; zero changes to core code, just aSKILL.mdteaching Claude the commands and when to reach for blast-radius / dead-exports / who-calls. - Then add an MCP server — thin adapter over
GraphQuery(already JSON-in/JSON-out) for tool-native, cross-agent use. - Skip the
PreToolUsealways-on hook initially — clever but adds latency to every search and is the easiest piece to add later.
References
- Graphify GitHub: https://github.com/safishamsi/graphify
- Graphify + Claude Code integration page: https://graphify.net/graphify-claude-code-integration.html
- ck:graphify (ClaudeKit docs): https://docs.claudekit.cc/docs/engineer/skills/graphify
- Graphify + code-review-graph (DEV Community): https://dev.to/mir_mursalin_ankur/graphify-code-review-graph-build-a-self-updating-knowledge-graph-for-claude-code-and-other-ai-j1m
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing GraphQuery methods and the CLI query commands that support --json. Then review the proposed .claude/skills/SKILL.md integration and determine how the planned MCP adapter would expose the same operations. Done means the agreed Claude Code integration is documented and usable without changes to the core graph query layer.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- ai, developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100