Track E.2 — brain_context MCP tool #28
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of mathias/infra Track E umbrella. Closes the brain↔Claude loop: every session both consumes + feeds the brain.
Goal
New MCP tool
brain_contextthat Claude Code calls at session start (or on demand) to load relevant prior brain knowledge for the current project.Scope
Tool signature
Logic
project_rootbasename (e.g./home/mathias/dev/AGENTS/hyperguild→hyperguild).graphstore.Subgraph(slug, 2)to expand neighbours.recent_filespaths (e.g. fileinternal/graphstore/pg.goboostsgraph-relatedentries).[{slug, title, doc_path, excerpt}].Files
ingestion/internal/mcp/tools_context.go— new handleringestion/internal/mcp/handlers.go— add tool descriptor intools()ingestion/internal/mcp/server.go— add dispatch case inhandleCalltools_context_test.goexercising no-graph + with-graph pathsAcceptance
tools/call brain_context {project_root: "/home/mathias/dev/AGENTS/hyperguild"}returns ≥3 relevant entries on a populated brainlitellmreturnslitellm-config-drifteven when BM25 doesn't rank it top-3)task checkgreenCompanion:
claude-context-bootstrapskillNew skill in
mathias/skillsrepo that documents: at session start, callbrain_contextwith the project root, attach result to the session's working context. Skill author is responsible for shape; this issue ships the tool, not the skill.Branch policy
If Track E.1 worked on simultaneously, use branch
agent/track-e2-brain-context. Merge to main when complete + task check green.Related