Members-Only
Recent Talks & Demos are for members only
You must be an AI Tinkerers active member to view these talks and demos.
Building a Terminal Orchestrator for AI Coding Agents in Rust
Learn how to build a Rust-based terminal orchestrator for AI coding agents, managing isolated workspaces, parsing streaming output, and enforcing review gates for autonomous development.
Context Foundry is an autonomous build loop written in Rust. Give it a task list in markdown, and it works through every task using AI agents – scouting the codebase, planning, building, and verifying with an independent reviewer in a fresh context. Passing tasks get committed. When the list runs out, a discovery agent scans for new work and keeps going.
SCOUT ──▶─ PLAN ──▶─ IMPLEMENT ──▶─ DOUBT
The core insight: every agent starts with a clean context window and receives only curated artifacts from the previous stage – not a bloated conversation history full of noise. The scout writes a structured report. The planner reads that report and writes a plan. The builder reads that plan and writes code. The verifier reads the code with zero knowledge of why it was written that way. No shared context windows, no accumulated reasoning, no inherited blind spots. Each stage gets signal, not noise. This is how foundry prevents the compounding error problem where task 3 builds on task 2’s mistakes. On top of this, pattern learning extracts reusable lessons after each task and injects them into future runs across all projects.
- [x] T1.1: Set up scaffolding [SPID] ● feat
- [x] T1.2: Implement auth [SPID!] ✗ WIP
- [ ] T1.3: Write tests [....]
You can also race two models against each other – Claude and Codex each get their own worktree and run the full pipeline independently, so you compare finished solutions, not just raw outputs. Simple tasks skip the planner and reviewer and commit in about 30 seconds. There are three run modes: Auto keeps going forever, Sprint stops when the list is done, Review creates a PR after each task and waits for approval.
Foundry has completed 141 tasks on its own codebase across 33 discovery rounds. Most of the features described here were built by the loop itself.
Rust-based autonomous build loop orchestrating Claude Code agents via PTY.
Context Foundry orchestrates Rust-based agentic workflows using isolated CLI processes.
- RustRust is a high-performance systems programming language that guarantees memory and thread safety via its compile-time ownership model.Rust is a statically-typed systems language engineered for performance and reliability, directly challenging C/C++ in speed. Its core innovation is the ownership model and 'borrow checker,' which enforces strict memory and thread safety at compile-time, eliminating data races and null pointer dereferences without a conventional garbage collector. Rust achieves near-native speed through 'zero-cost abstractions,' allowing high-level features to compile into highly optimized code. Major industry players, including Microsoft and Cloudflare, leverage Rust for critical infrastructure, and it is now officially supported for development in the Linux kernel.
- Claude Code CLIAn agentic coding assistant that integrates Anthropic's AI models directly into your terminal for conversational development.Claude Code CLI is Anthropic's command-line interface (CLI) for agentic coding: it meets developers where they work, in the terminal. This tool allows you to build features from plain English descriptions, debug complex issues, and navigate any codebase with conversational commands. It is powerful because it takes action: the CLI can directly edit files, run shell commands, and even manage Git operations like creating commits and branches. Installation is straightforward via `npm install -g @anthropic-ai/claude-code`, and it's designed to be a flexible, scriptable power tool that automates tedious tasks like fixing linting errors or resolving merge conflicts.
- OpenAI Codex CLIOpenAI Codex CLI is a terminal-native coding agent that reads, executes, and modifies local codebases using advanced reasoning models like o3 and gpt-5.4.Codex CLI transforms the terminal into an interactive development environment by combining OpenAI reasoning models with local execution capabilities. Built in Rust for high performance, it allows developers to scaffold files, run tests, and perform multi-agent code reviews without leaving the command line. The tool prioritizes security through granular approval modes (Auto, Read-only, and Full Access) and a local-first architecture that keeps source code within the user's environment. With support for multimodal inputs like screenshots and integration with the Model Context Protocol (MCP), it serves as a lightweight, open-source alternative to IDE-based agents for terminal-centric workflows.
- Claude CodeAnthropic's agentic coding tool: Unleash Claude's raw power directly in your terminal or IDE to turn complex, hours-long workflows into a single command.Claude Code is Anthropic’s powerful agentic coding assistant, designed for high-velocity development. It operates natively within your terminal, IDE (VS Code, JetBrains), or via a web interface, allowing you to delegate complex tasks like feature building, bug fixing, and codebase navigation. The agent plans, edits files, executes commands, and creates commits, maintaining awareness of your entire project structure. Internally, Anthropic engineers using Claude Code reported a 67% increase in productivity, demonstrating its capacity to deliver significant gains for Pro and Max plan users.
- Opus 4Opus 4 is a high-performance open-source repository platform built for the professional management and publication of electronic academic documents.Opus 4 serves as the primary technical foundation for institutional repositories (managed by KOBV). This PHP-driven system utilizes an Apache Solr backend to deliver sub-second search results across massive document collections. It automates the entire publication lifecycle: from initial user upload to long-term archiving and metadata distribution via OAI-PMH 2.0 interfaces. By adhering to DINI certificate requirements, it ensures that research outputs remain discoverable and persistent through standardized persistent identifiers (URNs) and rigorous metadata validation using Dublin Core standards.
- ratatuiA lightweight Rust crate for cooking up terminal user interfaces with immediate-render efficiency.Ratatui is the community-driven successor to tui-rs, providing a robust framework for building rich TUIs in Rust. It operates on an immediate-mode rendering model: you define the UI layout (using Rects and Constraints) and draw widgets (like Sparklines, Gauges, or Tables) every frame. This approach eliminates complex state synchronization between the backend and the display. With support for crossterm, termion, and termwiz backends, Ratatui powers high-performance tools like bottom and gitui, ensuring your terminal applications remain responsive under heavy data loads.
- TokioThe industry-standard asynchronous runtime for Rust, providing the building blocks for high-performance networking and reliable concurrency.Tokio delivers a multi-threaded scheduler, a reactor for non-blocking I/O, and specialized timers to handle thousands of concurrent tasks with minimal overhead. It powers mission-critical infrastructure at companies like Discord and AWS (via Firecracker), offering sub-microsecond latency for network services. By leveraging Rust's ownership model, Tokio ensures thread safety while providing high-level abstractions like Channels for MPMC communication and Select for multiplexing asynchronous events.
- portable-pty (agent spawning)Spawn pseudoterminals across Windows, macOS, and Linux to bridge local processes with remote agent shells.Portable-pty (agent spawning) solves the headache of inconsistent terminal behavior across OS kernels. By leveraging node-pty or similar low-level bindings, you can spawn interactive shells (bash, zsh, powershell.exe) that behave like real physical terminals rather than simple pipes. This is critical for remote agents: it ensures proper handling of escape sequences, window resizing (SIGWINCH), and interactive prompts. Whether you are building a web-based IDE or a headless automation bot, this tech provides the TTY layer needed to run tools like vim or top without the output turning into a garbled mess.
- serde (contract/attachment serialization)Serde is the gold-standard framework for serializing and deserializing Rust data structures efficiently and safely.Serde provides a high-performance ecosystem for translating Rust data structures into wire formats like JSON, BSON, and Postcard. By using Rust's derive macro system, it generates serialization logic at compile time (zero-cost abstraction) rather than relying on runtime reflection. This approach ensures type safety and maximum throughput for smart contracts and blockchain attachments where byte-level precision is non-negotiable. It currently supports over 25 data formats and integrates seamlessly with common crates like Chrono and SmallVec.
Compose Email
Loading recent emails...