A tmux-based system for seamless collaboration between developers and AI assistants, featuring token optimization through local models.
# Start with Docker (default - provides Ubuntu environment)
chmod +x setup-workflow.sh
./setup-workflow.sh# Start without Docker (runs directly on host)
./setup-workflow.sh --nativeThis will either:
- Create a new
ai-workflowtmux session with the proper 3-pane layout - Or attach to an existing
ai-workflowsession if one is already running
- 🛡️ Safety: Commands execute in isolated Ubuntu container
- 🔧 Consistency: Same Ubuntu 22.04 LTS environment everywhere
- 📦 Pre-configured: Python, Node.js, build tools, tmux ready to use
- 🔌 Port Forwarding: Development servers accessible from host
- 💻 VSCode Integration: Remote development support via dev containers
┌─────────────┬─────────────┐
│ │ TOP │
│ LEFT │ (right- │
│ (full │ upper) │
│ height) ├─────────────┤
│ │ BOTTOM │
│ │ (right- │
│ │ lower) │
└─────────────┴─────────────┘
Each pane has a custom prompt: ai-workflow-bash:[PANE_NAME] $
The AI assistant can execute commands using natural language:
- "Run
npm testin the top pane" - "Check what's running in the left pane"
- "Execute
git statusin the bottom pane"
- Two-Tier Architecture: High-cost AI (Claude) for strategy, local models (phi3/Ollama) for routine tasks
- Token Savings: Local AI handles parsing/translation, Claude focuses on complex reasoning
- Handoff Pattern: Natural language → phi3 translation → tmux execution → phi3 cleanup → Claude analysis
- Base64 Encoding: Safe text injection without shell escaping issues
- Heredoc Prevention: Eliminates common tmux session breaking scenarios
- Recovery Tools: Comprehensive error recovery and session management
- Timeout Handling: Appropriate timeouts for different command types
- Container Isolation: Docker mode provides additional safety layer
- Isolated Execution: Commands run in Ubuntu container, protecting host system
- Consistent Environment: Ubuntu 22.04 LTS with pre-installed development tools
- Volume Mapping: Current directory mapped to
/workspacein container - Port Forwarding: Common development ports (3000, 5000, 8000, 8080, 8443, 9000)
- VSCode Support: Full dev container integration for remote development
- Host File Access: Claude filesystem tools can still access host files directly
- Persistent Context: Integration with Serena memory system for cross-session context
- Filesystem Tools: Safe file operations with comprehensive directory access
- Documentation: Self-documenting system via
./tmux-hellobriefing script
tmux-hello: Complete system briefing and AI integration guidesetup-workflow.sh: Session setup and management script (supports Docker/native)Dockerfile: Ubuntu 22.04 container with development toolsdocker-compose.yml: Docker Compose configuration for easy container management.devcontainer/: VSCode dev container configurationtmux-recover: Recovery tools for stuck sessionsSPECIFICATION.md: Complete technical specificationSAFETY-RULES.md: Critical safety protocolsAI-USAGE.md: AI assistant usage examplestests/: Comprehensive test suite with phi3 simulation
This system includes completed research into:
- AI handoff patterns for cost optimization
- Token efficiency strategies using local models
- Safety protocols for AI-tmux interaction
- Real-world testing with complex build processes (Perl compilation)
See tests/README.md for detailed information about the AI handoff pattern and phi3-simulator.py for a working demonstration.
Once the Docker container and session are set up:
- Commands execute safely in isolated Ubuntu environment
- Claude filesystem tools access host files directly
- Development servers run in container but accessible from host
- Use VSCode with dev containers for full IDE integration
Work with your AI assistant using natural language commands targeting specific panes:
- "Run
npm testin the top pane" → Executes in container - "Check what's running in the left pane" → Shows container processes
- "Start development server on port 3000" → Accessible from host
- tmux communication and command execution
- Output parsing and error detection
- Session recovery and troubleshooting
- Context persistence across sessions
- Container lifecycle management
Run ./tmux-hello for a complete system briefing and operational guide.
- Cost Efficiency: Significant token savings through local AI integration
- Safety: Docker isolation protects host system + comprehensive safety protocols
- Consistency: Same Ubuntu environment across all machines and developers
- Speed: Local models handle routine tasks instantly
- Scalability: System designed for complex, long-running development workflows
- Memory: Persistent context and documentation across sessions
- Tool Availability: Pre-configured development environment ready to use
- VSCode Integration: Full remote development support with dev containers
- ✅ Docker containerization - Implemented with Ubuntu 22.04 LTS
- ✅ VSCode integration - Dev container support added
- MCP service integration (
mcp serve) - Enhanced development tool integration
- Expanded local model support beyond phi3/Ollama
- Multi-container support for complex development environments
- Cloud deployment options (AWS, GCP, Azure)
- Team collaboration features