Context Foundry

A self-hosted build loop that runs AI agents against your codebase and improves them over time.

Rust CLI · MIT License · GitHub

What it does

Context Foundry takes a task queue (TASKS.md) and processes each task through a four-stage pipeline:

TASKS.md Scout Plan Implement Doubt git commit

After each task, the system extracts patterns -- recurring issues and their solutions -- and injects them into future plans. The more tasks it completes, the fewer mistakes the reviewer catches.

Install

Cargo
cargo install context-foundry
npm
npm
npm install -g context-foundry
macOS
brew tap context-foundry/tap
brew install context-foundry

or download .dmg

Windows
winget install context-foundry

or download .exe

# Run from any project directory
cd ~/my-project
foundry

Why it matters

Pattern learning. Most AI coding tools treat every task as if it's the first. Context Foundry accumulates institutional knowledge -- patterns from past builds feed into future plans.

Dual-model arena. Run two different models against the same task. Compare outputs. Pick the winner automatically or manually.

Self-hosted, CLI-native. Rust binary with a TUI. Your code stays on your machine. No cloud service, no API proxy. Swap providers per pipeline role via config.

Documentation