Like a finely tuned transmission at full throttle, powerglide swerves through your codebase with precision, force, and grace. It is the layer between you and a swarm of LLM-driven engineers working in parallel β written in Zig 0.15.2, compiled to a single static binary with zero runtime dependencies, built around one non-negotiable constraint: the agent loop must be reliable enough to run unattended while you do something else.
$ powerglide run --agent hephaestus --velocity 2.0 "implement a binary search tree in Zig"
Named after the legendary Lamborghini Powerglide transmission β powerglide is built for maximum throughput.
Key Features
Multi-Agent Swarms π β Lay your foot flat. Run N agents in parallel, each in an isolated workspace, pulling from a shared file-backed task queue. Workers are monitored via heartbeat; rogue agents are killed before their diverged work accumulates. No daemon, no sockets β just observable, restartable file I/O.
Velocity Control π β Tune the gear ratio:
--velocity 2.0halves the step delay to 500ms for maximum throughput;0.5stretches it to 2000ms β long enough to read output and brake before the agent over-commits. Agents can self-throttle mid-session by writing their own velocity back to disk.Ralph Loop State Machine π β An explicit 11-state machine is the cognitive engine inside every session:
idle β load_tasks β pick_task β thinking β tool_call β executing β observing β verify β commit β done. No implicit flow, no silent exits. Every session terminates with<POWERGLIDE_DONE>or<POWERGLIDE_ERROR>. The loop is what makes powerglide auditable β you can see which state any agent is in, at any moment, and intervene.Reliable PTY Management π» β Every tool runs in a full pseudoterminal. Exit codes are captured via
waitpidwith WNOHANG polling and a/proc/<pid>/statusfallback β sobash,zig build,pytest, and any arbitrary command deliver reliable, trustable exit codes to the verify state that follows.Multi-Model Routing π€ β Route to Anthropic (Claude), OpenAI, or any OpenAI-compatible endpoint (Ollama, igllama, NVIDIA NIM, Together AI). Fallback chains in
config.jsonmean a rate-limited primary provider degrades gracefully to the next available one β without stopping the session.Terminal TUI π β A
vxfw-based multi-panel dashboard showing each agentβs current loop state, live log output, velocity, task progress, and token usage β across all workers simultaneously. Because watching interleaved terminal output across five agents isnβt situational awareness, itβs noise.
Quick Start
Get Started
- Zig 0.15.2 β Install with
mise install zig@0.15.2or from the official site - An API key for your model provider (set
ANTHROPIC_API_KEYorOPENAI_API_KEY), or run igllama locally with any GGUF
Build
git clone https://github.com/bkataru/powerglide
cd powerglide
zig build
The binary lands at ./zig-out/bin/powerglide.
Run
# Health check β verify all dependencies are set up
./zig-out/bin/powerglide doctor
# Run an agent session
./zig-out/bin/powerglide run "refactor this function to be more idiomatic"
# Run with specific agent and velocity
./zig-out/bin/powerglide run --agent hephaestus --velocity 2.0 "add unit tests"
# Open TUI dashboard
./zig-out/bin/powerglide tui
Commands
| Command | Purpose |
|---|---|
powerglide run | Launch an agent coding session |
powerglide session | Manage agent sessions β list, show, resume, delete, export |
powerglide agent | Manage agent configurations β list, add, remove, show |
powerglide swarm | Manage agent swarms β list, create, add, remove, run, status, stop |
powerglide config | Manage powerglide configuration β show, set, get, reset, edit |
powerglide tools | List and test available tools β list, show, test |
powerglide tui | Open the interactive multi-agent dashboard |
powerglide doctor | Run system health checks |
powerglide version | Show version information |
The Ralph Loop
Every powerglide agent session is driven by the Ralph Loop β an explicit state machine that enforces a strict sequence from task intake through tool execution to completion. The loop structure is what makes powerglide agents auditable and stoppable: you can see exactly which state an agent is in, you can attach rate limiting or logging to any specific transition, and you always know whether a session ended cleanly.
The loop does not trust the model to self-terminate gracefully. It drives the model β state by state, transition by transition β and only the loop decides when a session is done.
When LOAD_TASKS finds an empty queue β every task complete or failed β the loop emits <POWERGLIDE_DONE> and exits. This terminal signal is the agentβs contract with its caller: any script, CI job, or orchestrator can reliably detect completion without polling process exit codes or parsing log output.
Inspiration
powerglide synthesizes patterns from across the AI coding agent ecosystem, taking the strongest idea from each:
| Project | What We Took |
|---|---|
| oh-my-pi | Multi-agent harness architecture: N workers, one orchestrator, file-based coordination |
| oh-my-opencode | The omo agent model β autonomous coding agents invocable as CLI subprocesses |
| ralph | The ralph loop pattern: explicit states, explicit done signal, no implicit flow |
| gastown | Workspace isolation per worker β each agent gets its own directory, no write conflicts |
| opencode | CLI structure and multi-model routing with OpenAI-compatible fallback chains |
| crush | Terminal UX sensibility and the vxfw-based TUI approach |