How sethgammon/citadel works
Citadel is an operating layer for Claude Code and OpenAI Codex. The documented user journey starts with a request through /do, selects a workflow, runs it within repository and approval boundaries, records evidence, and leaves a resume action when interrupted. The repository also supports persistent project context, parallel worktrees, safeguards, MCP tools, and codebase memory. Relationships below follow explicit README statements or source-index references; unsampled capabilities are represented without guessing their internal call paths.
Main entry points: service.js Control-plane service · controller.js Operation controller · routing.js Skill routing · user-prompt-submit.js Prompt hook
Components 20
Agent entry and runtime
- Claude runtime
runtimes/claude-code/runtime.js - Codex runtime
runtimes/codex/runtime.js - Skill routing
core/skills/routing.js - Prompt hook
hooks_src/user-prompt-submit.js - Activation config
core/config/activation.js
Workflow execution
- Operation controller
core/operation-controller/controller.js - Control-plane service
core/control-plane/service.js - Operation contracts
core/operations/graph-contract.js - Graph execution
core/operations/graph-run.js - Parallel worktrees
core/forks/orchestrator.js
State and safeguards
- Control policy
core/operation-control/policy.js - Governance authority
core/governance/authority.js - Repository memory
core/memory/repository-store.js - Work coordination
core/coordination/claims.js
Evidence and integrations
- Proof verification
core/proof/index.js - State MCP tools
mcp-servers/citadel-state/index.js - MCP protocol adapter
mcp-servers/protocol-adapter.js - Codebase map
core/map/index.js - Codebase memory MCP
mcp-servers/codebase-memory/index.js
Other components
- Developer
Connections 20
- Developer → Claude runtime: submits request
README.md - Developer → Codex runtime: submits request
README.md - Claude runtime → Skill routing: routes request
- Codex runtime → Skill routing: routes request
- Skill routing → Operation controller: selects workflow
- Operation controller → Control-plane service: dispatches operation
- Control-plane service → Operation contracts: uses contracts
core/control-plane/service.js - Control-plane service → Graph execution: uses operations
core/control-plane/service.js - Operation controller → Control policy: checks boundaries
- Control-plane service → Governance authority: checks authority
- Prompt hook → Activation config: loads activation
- Prompt hook → Repository memory: preserves session state
- Parallel worktrees → Work coordination: claims ownership
- Parallel worktrees → Governance authority: uses governance
- Control-plane service → Proof verification: publishes evidence
- Developer → State MCP tools: requests state tools
README.md - State MCP tools → MCP protocol adapter: adapts protocol
mcp-servers/citadel-state/index.js - Codebase memory MCP → Codebase map: queries map
mcp-servers/codebase-memory/index.js - Codebase memory MCP → MCP protocol adapter: adapts protocol
mcp-servers/codebase-memory/index.js - Proof verification → Operation contracts: verifies receipts
core/proof/index.js