All work
Livesince October 2026
G7 Context Hub
I built the Context Hub so a new coding session can use decisions from earlier work.
I develop and maintain the hub.
Why I built it
Project decisions were scattered across repositories. Starting a fresh session meant finding the relevant notes again and checking whether anyone else was working on the same files.
How it fits together
- Claude Code sessionhooks load context at start
- MCP serverOAuth 2.1, Streamable HTTP
- Context Hubrules, documents, memories, claims, leases
- PostgreSQLfull text + pgvector, row-level security
Implementation
- Context at the start of every task
- A session asks for a context pack and gets the mandatory rules, the project map, the documents most relevant to its task and the work already in progress, inside a token budget. Every section cites the document and version it came from.
- Hybrid retrieval
- PostgreSQL full-text search and pgvector embeddings, merged with reciprocal rank fusion. Embeddings are computed on the server with a local model, so no document is sent to a third party to be indexed.
- Updating a document
- Sessions record what they learn as they work. Project knowledge publishes at once; rules for the whole company wait for a person to approve them. Every write names the version it read, so a stale write is refused instead of overwriting someone else’s.
- Coordination between sessions
- Sessions claim the areas they will change and are told about overlaps. A risky operation such as a deploy needs a lease that only one session can hold. Sessions can message each other, and the hooks warn when two of them share a checkout.
- Built into Claude Code
- Hooks give each session its context when it starts, keep its memory in sync with the hub, and report live activity, time and token use.
- Access to project documents
- The MCP server sits behind OAuth 2.1 with PKCE. Each organisation is isolated with row-level security, and a test proves another organisation is refused. Retrieved text reaches agents as reference data, never as instructions.
- Brief approval
- Agents can propose work as a brief, but no agent can start it until a person approves it.
Results
- documents in one organisation
- ~1,500documents in one organisationNovember 2026
- to build a context pack
- ~100 msto build a context packproduction, warm
- right document in the top five
- 96%right document in the top fivesmall evaluation set, 28 queries
Stack
- TypeScript
- Node.js
- Express 5
- PostgreSQL 18
- pgvector
- PGlite for tests
- Next.js 16
- Tiptap and Yjs
- Model Context Protocol
- OAuth 2.1
- Claude Code hooks
The documentation for this website lives in the hub too.