Inspiration
Every AI coding agent starts from scratch. When you ask Claude, Cursor, or Copilot to work on your codebase, it has no memory of what your team has learned—the conventions you've established, the patterns that work, the mistakes you've stopped making. Meanwhile, your team's real knowledge lives in merged pull requests: the code that was accepted, the review comments that shaped it, and the decisions that emerged from discussion.
We asked: What if AI agents could inherit institutional knowledge the same way new engineers do—by learning from the team's accepted work?
Sync Rabbit was born from this insight. We wanted to build a shared memory layer that treats merged PRs as ground truth and makes that knowledge accessible to any AI agent working on the codebase.
What it does
Sync-Rabbit creates a persistent, codebase-scoped memory that learns from every merged pull request and makes that knowledge available to AI coding agents.
The Write Path:
- When a PR is merged, a GitHub Action sends the PR data to Sync-Rabbit
- A Claude agent analyzes the changes—not just the diff, but also CodeRabbit review comments and developer responses
- The agent extracts atomic, searchable insights: patterns, conventions, co-change relationships, and hazards
- These learnings are stored in a shared memory database
The Read Path:
- AI agents (Claude Code, Cursor, Claude Desktop) connect via MCP (Model Context Protocol)
- They can query the memory: "What patterns exist for authentication?" or "What files typically change together?"
- The memory informs their work, so they write code that fits the team's established conventions
How we built it
Architecture:
- Server: Node.js + Express + TypeScript, with lowdb for JSON-based persistence
- AI Engine: Anthropic Claude API with a 3-tool agent loop (
get_current_memory,get_pr_context,update_memory) - GitHub Integration: Custom GitHub Action that collects PR metadata, diffs, and CodeRabbit review threads
- Agent Access: MCP server that exposes memory to Claude Code, Cursor, and Claude Desktop
Key Design Decisions:
Merged PRs as truth: We only learn from accepted code. This ensures the memory reflects what the team actually wants, not experimental or rejected approaches.
Atomic insights: Rather than storing paragraphs, we prompt Claude to write one specific, searchable fact per pattern. This makes retrieval precise.
CodeRabbit integration: Review comments contain nuance that diffs don't—why something was wrong, what the team prefers. We capture the full conversation thread (CodeRabbit + developer responses) to extract these insights.
MCP for universal access: By implementing the Model Context Protocol, any compatible AI agent can access the memory without custom integration.
Challenges we ran into
1. Memory Schema Design Our first schema was too broad—patterns combined multiple insights into single descriptions. We realized that if Claude is both the writer and reader of memory, descriptions need to be atomic and searchable. We restructured to enforce one insight per pattern.
2. Localtunnel Reliability During testing, localtunnel connections kept dropping. We learned to use stable subdomains and implement proper health checks. For production, we'd move to a deployed server.
3. GitHub Token Permissions The fine-grained GitHub PATs have complex permission requirements. We had to ensure the Action has access to PR metadata, review comments, and the ability to fetch CodeRabbit threads.
4. Balancing Depth vs. Noise Claude could extract dozens of "insights" from each PR, but most would be noise. We tuned the system prompt to focus on patterns that would actually help future agents—actionable conventions, not trivia.
Accomplishments that we're proud of
- End-to-end pipeline: From PR merge → GitHub Action → Claude analysis → memory storage → MCP retrieval, the full loop works
- CodeRabbit integration: We're the first (that we know of) to feed AI code review discussions into a learning system
- Universal agent access: Any MCP-compatible AI agent can benefit from the shared memory
- Clean architecture: The separation between write path (webhook/Claude) and read path (MCP) keeps the system modular
What we learned
LLMs as memory writers: When Claude writes memory that Claude will read, optimize for natural language—not structured schemas. The model is better at interpreting prose than parsing fields.
Atomic > comprehensive: Small, specific insights are more useful than comprehensive summaries. "API routes go in src/routes/" beats a paragraph describing the whole architecture.
Review comments are gold: The back-and-forth between CodeRabbit and developers contains the "why" that code alone doesn't show. This is where conventions get negotiated and established.
MCP is powerful: The Model Context Protocol makes it trivial to give any AI agent access to custom tools. Building the MCP server took less time than expected.
What's next for Sync Rabbit
Vector search: Add embeddings for semantic retrieval. When an agent asks "how do I handle auth?", find the most relevant patterns by meaning, not just keywords.
Cross-repo learning: Allow organizations to share patterns across repositories. Common conventions could propagate automatically.
Confidence scoring: Track how often patterns hold true. If a "convention" keeps getting violated, maybe it's not actually a convention.
IDE integration: Surface relevant patterns directly in the editor as developers write code—not just for AI agents.
Hosted service: Deploy Sync-Rabbit as a managed service so teams don't need to run their own infrastructure.
Built With
- actions
- anthropic
- api
- claude
- context
- express.js
- github
- lowdb
- mcp
- model
- node.js
- protocol
- typescript