Forge: A Memory System for Claude Code Built with Claude Code

✍️ OpenClawRadar📅 Published: March 11, 2026🔗 Source
Forge: A Memory System for Claude Code Built with Claude Code
Ad

What Forge Does

A developer used Claude Code to build Forge, a tool that solves Claude Code's session-based memory problem. Forge is a 6-package TypeScript monorepo that functions as an MCP server. It processes every conversational turn through a structured pipeline to capture and persist project context.

How It Works

The system uses a six-stage pipeline:

  • Classify — Determines if a statement is a decision, constraint, rejection, exploration, goal, correction, or noise.
  • Extract — Pulls structured data including the statement, rationale, category, and certainty level.
  • Model — Writes to an event-sourced project model (append-only SQLite that never loses history).
  • Propagate — Checks for conflicts between decisions and constraints.
  • Surface — Notifies about tensions with flow state detection to avoid constant interruptions.
  • Execute — Hooks into GitHub to create issues, repos, and commit specs based on decisions.

A key design rule enforced by Claude Code: a decision moving from "leaning" to "decided" is never automatic. You must explicitly commit. Tests enforce this invariant.

Ad

Development Details

The build involved several interesting technical challenges:

  • Two-stage LLM pipeline — Forge itself calls LLMs to classify and extract decisions from conversation, creating an inception-like scenario where Claude Code writes code that calls Claude. Getting prompts right for reliable classification required significant iteration.
  • Event sourcing implementation — Every decision, constraint, and rejection is an append-only event in SQLite. Nothing gets deleted or overwritten, allowing replay of the entire decision history.
  • Trust calibration system — Forge tracks how often its classifications are correct and adjusts its interruption threshold. If it's been wrong frequently, it gets quieter. Claude Code built the confidence tracking, interruption budgets, and flow state detection.
  • Testing — The project includes 170 tests across 14 test files that caught real bugs during development, particularly around constraint propagation logic.

Integration with Cortex

Forge pairs with another tool called Cortex (also built with Claude Code), a knowledge graph that indexes your codebase. When both are installed as MCP servers, Forge automatically queries Cortex during extraction. For example, if you say "let's switch to PostgreSQL," Forge checks Cortex for existing database references, related services, and migration patterns before recording the decision.

The tools are complementary: Forge knows why (decisions, constraints, intent, rejections) while Cortex knows what (code entities, patterns, dependencies, architecture).

Practical Usage

You install Forge as an MCP server in your project, then talk to Claude Code normally. Behind the scenes, Forge classifies every turn, extracts decisions, and builds a persistent model. In subsequent sessions, Claude Code can check forge://brief to instantly see what's been decided, what's still open, what was explicitly rejected, and where there are active tensions.

📖 Read the full source: r/ClaudeAI

Ad

👀 See Also