jeromeetienne / jeromeetienne/codespine

Integrate ts_knowledge_graph with Claude Code (Graphify-style)

Open
#10 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

competitor
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:

  1. A CLAUDE.md directive — tells Claude to read the generated graph report before answering architecture/dependency questions.
  2. A PreToolUse hook in settings.json — fires before every Grep/Glob call so the graph is consulted first (the "always-on" angle they advertise).
  3. 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:

  • GraphQuery methods (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

  1. Start with a Skill — matches Graphify's actual shipping form, fastest to value. Wraps the existing --json CLI; zero changes to core code, just a SKILL.md teaching Claude the commands and when to reach for blast-radius / dead-exports / who-calls.
  2. Then add an MCP server — thin adapter over GraphQuery (already JSON-in/JSON-out) for tool-native, cross-agent use.
  3. Skip the PreToolUse always-on hook initially — clever but adds latency to every search and is the easiest piece to add later.

References

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.