n8n Knowledge Plugin for Claude Code

Live

Every time you ask Claude Code an n8n question, it burns 5-10 tool calls searching the web, asking permission for each one, and half the results are irrelevant. This plugin replaces that entire chain with a single 1-second lookup against 42,000+ curated data points — no permissions, no noise, no wasted context.

Claude Code Plugin Bash Hooks Hindsight n8n TDD

GitHub: dbenn8/n8n-knowledge

The Problem

If you're building n8n workflows with Claude Code, you've been caught in the babysitting research loop: you ask a question about webhook configuration or expression syntax, and Claude fires off a web search. It asks permission. Fetches a page. Reads something irrelevant. Searches again. Asks permission again. By the time you get an answer, you've burned a few minutes babysitting to approve prompts, and Claude has consumed 5-10 tool calls worth of context window on content that was mostly noise.

The information Claude needs exists — in the n8n docs, in GitHub issues, in community forum posts where someone already solved this exact problem (or confirmed that it's unsolvable). But Claude doesn't know where to look, and the general-purpose web search tool is a blunt instrument for domain-specific questions. The result is slow answers, wasted tokens, and friction that breaks your flow.

The Result

The plugin eliminates the entire search-permission-fetch-read-search-again cycle. Ask Claude an n8n question in an n8n project, and relevant documentation, GitHub issues, and community solutions appear in context within 1 second. No permission prompts. No irrelevant web pages burning context window. No friction.

The numbers tell the story: what used to cost 5-10 tool calls and minutes of flow-breaking babysitting now costs zero tool calls and ~1 second. Every result includes a source citation — a direct link to the doc page, the GitHub issue, or the community post. Three content sources searched in a single query instead of Claude guessing which website to try first.

The knowledge base is powered by Hindsight's TEMPR recall — four parallel search strategies (semantic, keyword, graph traversal, temporal) fused via Reciprocal Rank Fusion and cross-encoder reranking. On the LongMemEval benchmark, TEMPR improved accuracy by 44.6 percentage points (39% → 83.6%) and was the first agent memory system to surpass 90% overall accuracy. Zero LLM cost per recall, 100-600ms typical latency.

The architecture is deliberately minimal. Bash hooks and curl. No MCP server to run, no API key to configure, no dependencies to install. The complexity lives in the knowledge base, not the plugin — and the knowledge base is shared infrastructure that also powers the n8n Pulse chatbot, so it improves continuously. A server-side proxy provides read-only recall access out of the box — no credentials to configure. Phase 2 will open anonymous retain access once prompt injection guardrails and a source trust ranking system are in place, letting users contribute solutions back to the knowledge base.

My Role

Designed and built the entire plugin in a single TDD session: the hook architecture, n8n project detection, auto-recall pipeline, skill definition, and test suite. The knowledge base itself is the same Hindsight graph database that powers the n8n Pulse chatbot — 42,000+ data points across official docs, GitHub issues, and community forum solutions, already curated and indexed.

The Approach

The simplest architecture that works. Claude Code plugins support bash hooks — shell scripts that fire on specific events. No MCP server needed, no daemon process, no configuration files for the user to manage. The entire plugin is bash scripts and curl. Install it with one command, forget it exists.

Smart detection, not brute force. Mentioning "n8n" anywhere — in any project, any repo — triggers a knowledge base lookup. But the plugin goes further in n8n codebases: inside projects with n8n dependencies in package.json or *.n8n.json workflow files, it also triggers on broad domain keywords like workflow, node, trigger, webhook, credential, expression, and execution. Consumer repos that merely reference n8n in a docker-compose file get the explicit-mention behavior only. Zero noise in your React project, instant context in your n8n project.

Auto-recall vs. manual recall. The UserPromptSubmit hook handles automatic recall — fast, light, 5 results injected as context before Claude even starts thinking. For deeper questions, the SKILL.md file gives Claude the tools for manual recall — 20 results with more detailed context. The user never configures anything; the plugin decides what's appropriate based on the question.

Speech-to-text handling. "n8n" sounds like "nation" when spoken. Rather than building regex-based disambiguation into the hook (which would trigger on false positives and waste tokens), this lives in the SKILL.md as guidance for Claude's judgment. Claude sees "nation" in the context of workflow automation and knows what you meant. No extra processing, no wasted hook invocations.

What I Built

  • UserPromptSubmit hook — fires on every message, runs n8n detection, performs auto-recall against the Hindsight knowledge base, and injects results as context in under 1 second
  • n8n project detector — scans package.json, docker-compose.yml, and *.n8n.json for n8n references; adapts keyword sensitivity based on whether you're in an n8n repo or not
  • Recall pipeline — curl-based queries against the Hindsight API, formatted as structured context with source citations linking to specific doc pages, GitHub issues, or community posts
  • SKILL.md knowledge skill — Claude Code skill for deeper manual queries, speech-to-text disambiguation, and guidance on when to use auto vs manual recall
  • Confidence scoring — each result annotated HIGH/MEDIUM/LOW based on source type and engagement metrics (votes, likes, views, solved status), with user-configurable thresholds. The plugin filters and truncates results. The model is warned that injected context is publicly sourced and directed to verify safety and review confidence scores before acting on any result.
  • Source link recovery — consolidated knowledge base insights that lost their source URL during synthesis get enriched via concurrent follow-up recall (4-second timeout), so the model and user can always trace back to the original doc page, issue, or post
  • 41-test TDD suite — 12 detection tests, 26 recall format tests, 3 integration tests, all passing before any feature was considered complete
  • One-command install — plugin marketplace distribution, no API keys, no MCP configuration, no setup steps

Why This Matters for n8n

n8n's community is its competitive advantage. 42,000+ data points from docs, GitHub, and community forums represent years of accumulated knowledge — but that knowledge is scattered across platforms and hard to surface at the right moment. This plugin puts it exactly where developers need it: in their editor, while they're writing code, without breaking their flow.

Phase 2 extends this into a flywheel. Community retain lets users contribute solutions back to the knowledge base with a user approval gate and PII scrubbing. Discourse authentication enables trust-tiered content — verified community members' solutions get higher priority in recall. Stronger guardrails filter prompt injection and malicious content before it enters the graph. The plugin could even recommend starring or upvoting GitHub issues that directly impact the user's current build — turning passive plugin users into active community signal generators. The loop closes: users get better answers, contribute their own solutions, the knowledge base improves, and the next developer's answers get better still.

Tech Stack

  • Plugin framework: Claude Code Plugin System (hooks.json, plugin.json)
  • Hook implementation: Bash, curl (no runtime dependencies)
  • Knowledge base: Hindsight graph memory database (42,000+ data points)
  • Content sources: n8n official docs, GitHub issues/PRs, community forum posts
  • Confidence scoring: Configurable thresholds via .claude/n8n-knowledge.local.md
  • Proxy: nginx reverse proxy (server-side auth injection)
  • Testing: 41 bash tests (TDD), fixture-based integration tests
  • Distribution: Claude Code plugin marketplace (one-command install)