Inspiration
Whether working with a team, multiple agents, or even just switching between computers context gets lost and leads to a lot of finding/searching, copy/pasting, writing/editing context to get models up to speed.
What it does
Baton is an MCP server that turns the git branch you're on into a live, shared "feature card" — a 500-token snapshot of purpose, state, hypotheses, failed attempts, and next action. Any MCP-compatible client (Claude Code, Cursor, etc.) can read and write to it.
How we built it
A thin shim + remote backend split, deliberately Hono backend, Redis Stack is the entire data plane,
Challenges we ran into
MCP SDK API drift. The @modelcontextprotocol/sdk surface has shifted across versions. Burned an hour assuming an older signature before doing a proper code-explorer pass and rewriting the registration layer.
Token budgets that actually hold. Shipping a 500-token cap is easy. Enforcing it under adversarial inputs — 20 failed attempts, 50 dirty files, an essay-length next_action — requires a deterministic truncation order at the JSON.SET boundary. We landed on: drop oldest failed_attempts, then trim hypotheses, never touch git or purpose.
Accomplishments that we're proud of
Redis is doing real work, not table stakes. RedisJSON, Streams, and Pub/Sub each earn their place. The data plane is genuinely just Redis.
Hard architectural invariants, enforced in code. The 500-token card isn't a hope, it's a check at the write boundary. Same for the 1,500-token resume packet.
What we learned
Compaction is the product. The event stream is just storage; the card is what the agent actually reads. Designing the compactor's dedupe rules and truncation order was the architecture work.
What's next for Baton
Git hooks emit events automatically. Pre-commit, post-commit, post-merge → action.commit, feature.merged, etc. The shim auto-detects the current branch via git branch --show-current. No manual event calls.
Built With
- claude
- node.js
- redis
- typescript
- vitest
Log in or sign up for Devpost to join the conversation.