GrokTown
Gastown-Style Multi-Agent Coding System powered by xAI Grok
A multi-agent orchestration system for software development, inspired by Steve Yegge's Gastown, but powered by xAI's Grok instead of Claude Code.
Twitter Account: https://x.com/GrokTownX
What Is This?
GrokTown is a pure coding agent orchestration system that implements Gastown's architecture:
Core Concepts from Gastown
The Town - Your HQ where all projects live
Rigs - Individual projects (git repos) under management
Agents - AI workers with persistent identities
Beads - Git-backed persistent state for everything
GUPP Protocol - "If there's work on your hook, you run it"
Molecules - Multi-step workflows that survive crashes
Crews - Workspaces for teams/users
GrokTown vs Gastown
AI Backend
Claude Code
xAI Grok
Language
Go
Python
Primary Use
Code orchestration
Code orchestration
X Integration
No
Yes (Grok's superpower!)
Open Source
Yes
Yes
Architecture
Agent Roles
Mayor 🎩
Main orchestrator for the project
Breaks down high-level goals into issues
Reviews completed work
Plans architecture
Coding Agent 👨💻
Implements features
Fixes bugs
Writes tests
Refactors code
Witness 👁️
Maintains audit trail
Tracks all work done
Generates reports
Ensures compliance
Quick Start
Prerequisites
Python 3.11+
xAI Grok API key (get one here)
Git
Installation
Run Demo
This will:
Create a convoy of issues for building a web server
Assign the first issue to a coding agent
Watch the agent implement it
Generate a project report
Usage
Basic Commands
Working with GrokTown
1. Create a Project (Rig)
This creates:
Project directory structure
Agent beads
README and scaffolding
2. Configure the Rig
Edit groktown_config.yaml:
3. Start the System
Agents will:
Check their hooks for pending work
Execute tasks autonomously
Store all work in git (Beads)
Continue until stopped
4. Create Issues
GrokTown uses GitHub-style issues. You can:
Via Mayor (AI-generated):
Manually:
5. Assign to Agent
6. Monitor Progress
GUPP Protocol
Grok Unified Perpetual Protocol
The core principle: If there is work on your hook, YOU MUST RUN IT.
How It Works
Hooks - Each agent has a task queue (hook)
Check - Agents continuously check their hooks
Execute - If work exists, agent must process it
Persist - All state stored in git
Resume - Crashed agents restart and continue
Example Flow
This ensures:
No forgotten tasks
Crash resilience
Full audit trail
Predictable behavior
File Structure
Configuration
groktown_config.yaml
Grok Features
Real-Time X Context
Grok's unique advantage: access to real-time X (Twitter) data!
Use cases:
Research best practices
Find solutions to problems
Stay updated on tech trends
Monitor sentiment about technologies
Code Generation
Grok excels at code generation:
Advanced Usage
Custom Workflows (Molecules)
Create multi-step workflows:
Custom Agent Types
Extend the base agent class:
Comparison with Original Gastown
Similarities ✅
Multi-agent orchestration
Persistent state (Beads)
GUPP protocol
Git-backed storage
Workflow molecules
Rig/Crew structure
Differences 🔄
AI
Claude Code
xAI Grok
Language
Go
Python
CLI Tool
gt command
Python scripts
Integration
Deep Claude integration
Generic LLM calls
X Context
No
Yes (Grok feature)
Maturity
Production-ready
Proof of concept
Roadmap
Phase 1: Foundation ✅
[x] Core agent framework
[x] GUPP protocol
[x] Bead storage system
[x] Mayor, Coder, Witness agents
[x] Issue management
Phase 2: Enhancement
[ ] Polecat agents (testing)
[ ] Refinery agent (data processing)
[ ] Deacon agent (system health)
[ ] Advanced molecule workflows
[ ] Better git integration
Phase 3: Integration
[ ] GitHub integration
[ ] VS Code extension
[ ] Web dashboard
[ ] Slack/Discord notifications
[ ] CI/CD integration
Phase 4: Intelligence
[ ] Learning from past work
[ ] Code quality metrics
[ ] Performance optimization
[ ] Team collaboration features
Why GrokTown?
Advantages of Grok
X Integration - Real-time access to developer discussions
Cost - Competitive pricing vs other LLMs
Speed - Fast inference for quick iterations
Flexibility - Not tied to specific CLI tools
When to Use GrokTown
✅ Good for:
Multi-project management
Team collaboration
Long-running development tasks
Projects needing social context (X data)
❌ Not ideal for:
Single-file quick edits (use Claude Code directly)
Projects requiring deep IDE integration
Real-time pair programming
Inspiration & Credits
Gastown by Steve Yegge - The original inspiration
Beads by Steve Yegge - Memory system for agents
xAI Grok - The AI powering the system
Special thanks to the Gastown architecture for showing how multi-agent systems should work!
Contributing
GrokTown is experimental. Improvements welcome:
Fork the repo
Add features
Test thoroughly
Submit PR
Areas that need work:
Better error handling
More agent types
Improved git integration
Web UI
Performance optimization
License
MIT License - Use at your own risk
FAQ
Q: Why not just use Gastown?
A: Gastown is tied to Claude Code and requires the gt CLI. GrokTown is more flexible and uses Grok's unique features like X integration.
Q: Can I use Claude instead of Grok?
A: Yes! Just modify the GrokClient class to use Anthropic's API instead.
Q: How much does this cost? A: Depends on usage. Grok pricing is ~$0.20 per million input tokens. For typical projects, expect $5-50/month.
Q: Is this production-ready? A: No, this is a proof of concept. Use for experimentation and learning.
Q: How does it compare to cursor/copilot? A: Different use case. Cursor/Copilot are IDE assistants. GrokTown is for multi-agent project orchestration.
Happy coding with your AI crew! 🚀🤖
May your agents be productive and your git history clean.
Last updated