forge sync compiles that source into each tool’s native
config. The four layers are how the brain is expressed; the compiler is how it is
delivered.
One source, many emitters
Author rules once (source/rules.json); a deterministic compiler (forge sync)
emits each tool’s native format with a content-hash header, so drift is detectable and
re-running is a no-op. No rule is ever written twice. The canonical source is three
files:
The four layers
Each layer is brand-named and emitted cross-tool.tools — model-invoked capabilities
tools — model-invoked capabilities
~/.forge/tools/ → ~/.claude/skills/. Model-invoked skills, following the
SKILL.md standard (name + description frontmatter).crew — isolated sub-agents
crew — isolated sub-agents
~/.forge/crew/ → ~/.claude/agents/. Isolated-context sub-agents such as scout,
verifier, and frontend-verifier.guards — deterministic hooks (the only enforcing layer)
guards — deterministic hooks (the only enforcing layer)
~/.forge/guards/ → settings.json hooks. The only layer that enforces rather
than suggests. A guard is a deterministic hook the model cannot drift from. Prose
rules in CLAUDE.md get acknowledged and then forgotten after compaction; a guard
does not. Every enforceable invariant belongs here.mcp — the protocol layer
mcp — the protocol layer
Forge ships one stdio server (
src/cortex_mcp.js) exposing 19 MCP tools: the
substrate checks (substrate_check / predict_impact / assumption_gate / …),
memory reads and writes (forge_remember, ledger ratify/retract), and ops/health.Guard over prose
Rules the model can drift from live in prose; rules it must never break live in guards (deterministic shell hooks). A guard can’t be forgotten after context compaction.Move every enforceable invariant out of
CLAUDE.md and into a guard; keep the prose
thin. This is the single most important discipline in Forge’s design.The verified cross-tool emit matrix
Forge emits config for nine tools, plus an MCP server for Roo Code and VS Code. Each row is confirmed against vendor docs.
Roo Code and VS Code receive the Forge MCP server via
forge init (.roo/mcp.json,
.vscode/mcp.json) rather than a rules file.