Most developers deal with the same 10-20 errors over and over through the years. Different for each person, and different for each library, framework and platform. I build this to help people stop repeating the same work. Solve once, and have Claude remember the what how and why, forever.
By creating a persistent context graph, updating on every bug fix, and using regex and keyword scoring in the hook layer to match current issues with the all your previous fixes helps you and Claude avoid repeating the same work.
git clone https://github.com/sstobo/context-graph-plugin.git
cd context-graph-plugin
./setup.shChoose global (all projects) or local (current project only). Restart Claude Code.
Capture a fix after solving an error:
/graph-it
Claude finds the error you just fixed, proposes a summary, and saves it after you confirm.
Automatic injection happens continuously. The hook scans both your prompts and Claude's outputs (bash commands, file writes, edits) for error patterns, matches against your fix database using regex + keyword scoring, and injects the top matches as context.
-
Dual monitoring - Hooks watch two streams:
UserPromptSubmit- errors you paste or describePostToolUse(Bash, Write, Edit) - errors in Claude's command output and file operations
-
Pattern detection - Text is scanned against regex patterns in
patterns.json(TypeScript errors, runtime exceptions, build failures, etc.) -
Fix matching - When a pattern matches,
fixes.jsonis searched. Each fix has anerrorSignatureregex and keywords. Scoring combines pattern match, keyword overlap, confidence score, and project history. -
Context injection - Top 3 matches get injected as a
<context-graph>block. Claude sees prior solutions before responding and acknowledges the match.
Global install: ~/.claude/context-graph/
Local install: ./.claude/context-graph/
fixes.json- your captured fixes (edit directly to tweak)patterns.json- error patterns to detect (add your own)
Run ./setup.sh --fresh to reset data files.
MIT



