Max (named after Maxwell Smart, Agent 86) is a self-hosted agent management platform that orchestrates Claude Code CLI agents across multiple projects. Built with Flask, it provides a web-based mission control centre for deploying, monitoring, and coordinating AI agents.
"Sorry about that, Chief." β Max, after every minor setback
- Operations Centre β Dashboard showing all registered projects with status, health, and quick actions
- Persistent Multi-Terminal Hub β Multiple xterm.js terminals with tab and mini-panel management. Sessions survive page navigation. Pop-out windows. Fullscreen mode.
- KAOS Mode β launch Claude with --dangerously-skip-permissions (β οΈ button)
- Session resume β Claude terminals auto-resume the project's last session- Agent 99 β Persistent Claude CLI assistant accessible from every page (Cmd+9). She knows all your projects, can schedule tasks, run health checks, and create new projects from natural language.
- Consolidated task register across all projects β bugs, features, improvements, tasks
- Syncs with production β pulls from your apps' feedback APIs, pushes status updates back
- Agent assignment β assign tasks to 86 (Sonnet/Opus) or 99
- Scheduling β set date/time for agent work, friendly cron builder with presets
- Multi-select bulk actions β run, deploy, or run & deploy selected items
- Quality gates β review states, rejection loops with feedback
- Session management β store and resume Claude CLI sessions per project
- CLAUDE.md generation β edit Business Problem + Proposed Solution, auto-generate CLAUDE.md
- Intelligent merge β updates CLAUDE.md without overwriting existing content
- Reconnaissance β scan project directories with time grouping, search, undercover system
- Sequential task execution per project β no conflicts, no timeouts
- Git workflow β agents commit to
agent/<task>branches, push for review - Diff viewer β color-coded code review in the browser
- Deploy approval β review diff, approve, merge to main with one click
- Progressive updates β agents report progress every 2 minutes
- Auto-handoff β if a task times out inline, it spawns a background worker
- One bot, multiple channels β each project gets a Discord channel
- Agent 99's Direct Line β dedicated channel for 99
- Project agents respond in character β Max talks like Maxwell Smart
- File attachments β send screenshots and files via Discord
- Background task handoff β complex requests auto-delegate to background workers
- Results delivered back to the channel when complete
- Allowlist β only authorised users can talk to the bots
- Central notification hub β all agent updates, task completions, questions
- Reply inline β responses go to the ticket thread
- Deploy approval from inbox β review diffs and approve without leaving
- Discord push β agent updates post to project channels automatically
- macOS notifications β native alerts for agent activity
- Remote agent deployment β SSH into VPS, spawn research agents
- Remote terminal β execute commands on VPS from the browser
- PostgreSQL sync β bidirectional sync between local SQLite and VPS Postgres
- Agent coordination β remote researches, local executes
- Analytics dashboard β 7-day activity trends, task distribution, model usage, project breakdown
- Audit trail β every agent action logged with timestamp, actor, detail
- Health checks β git status, dependencies, common issues, project size
- Vulnerability scanning β npm audit, pip-audit integration
- Log analysis β error pattern detection in project logs
- Smart polling β SocketIO pauses when browser tab is inactive, resumes on focus
- Agent state machine β offline/idle/busy/sleeping/error with heartbeat tracking
- Regression branches β isolated git branches for testing changes
- Promote to production β merge to main with one click
- Test runner β auto-detect and run pytest, npm test, unittest
- Backup & restore β snapshot the database, restore with safety backup
- CLAUDE.md management β edit project briefs, generate CLAUDE.md, intelligent merge
Three themes with Claude orange (#E8734A) as the accent:
- π Dark β Night Operations
- βοΈ Light β Daylight Operations
- π Soft β CONTROL Headquarters (light blues & greys)
- Python 3.10+
- Claude Code CLI installed and authenticated
- Git
git clone https://github.com/yourusername/max.git
cd max
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# Edit .env with your settings
python run.pyOpen http://localhost:8086 β CONTROL headquarters is operational.
cp .env.example .env
# Edit .env
docker-compose up -dpython setup_startup.py # Install launchd agent
python setup_startup.py uninstall # Remove it- Create a bot at discord.com/developers
- Enable Message Content Intent under Bot β Privileged Gateway Intents
- Invite the bot to your server
- Configure in Max: Shoe Phone page β enter token + channel IDs
- Or let 99 create channels: she can do it programmatically
Max (Flask + SocketIO)
βββ Routes (Blueprints) β HTTP β Browser UI
βββ SocketIO Events β WebSocket β Real-time updates
βββ Services
β βββ AgentRunner β spawns claude CLI processes
β βββ Agent99 β persistent Claude assistant
β βββ TaskExecutor β sequential task queue per project
β βββ BotManager β Discord/Telegram lifecycle
β βββ TerminalManager β persistent PTY sessions
β βββ HealthChecker β project health analysis
β βββ FeedbackRegister β consolidated task management
β βββ InboxService β agent notifications
β βββ AuditService β activity logging
β βββ AnalyticsService β usage tracking
βββ DB (SQLite)
βββ Discord Worker (subprocess)
All configuration via .env or environment variables:
| Variable | Default | Description |
|---|---|---|
MAX_SECRET_KEY |
agent-86-would-you-believe |
Flask session secret |
MAX_PORT |
8086 |
Server port (Agent 86's number) |
CLAUDE_CLI_PATH |
~/.local/bin/claude |
Path to Claude CLI |
MAX_PROJECT_LOCATIONS |
local:~/Projects |
Project directories (name:path pairs) |
DISCORD_BOT_TOKEN |
β | Discord bot token |
VPS_HOST |
β | VPS IP for remote operations |
Max is packed with Get Smart references:
- Agent 86 (Max) β your project agents, confident and occasionally bumbling
- Agent 99 β the competent persistent assistant who always calls you "Chief"
- The Chief β that's you
- CONTROL β the good guys (your infrastructure)
- KAOS β the bad guys (production errors, vulnerabilities)
- The Shoe Phone β Discord/Telegram bot connectivity
- The Cone of Silence β secure operations (token entry, credentials)
- KAOS Mode β
--dangerously-skip-permissions(β οΈ button) - Training Ground β regression environments
- Emergency Protocols β backup & restore
- Mission Dossier β consolidated task register
- Satellite Office β VPS remote operations
- "Would you believe..." β loading messages
- "Sorry about that, Chief" β error messages
- "And loving it!" β success messages
- "Missed it by that much!" β timeouts and near-misses
max/
βββ app.py # Flask factory
βββ config.py # Configuration
βββ run.py # Entry point + Discord worker
βββ max/
β βββ models/ # Data models (Project, Agent, Task, etc.)
β βββ services/ # Business logic (agent runner, bots, health, etc.)
β βββ routes/ # Flask blueprints
β βββ sockets/ # SocketIO event handlers
β βββ db/migrations/ # SQL migrations
β βββ utils/ # Smart quotes, helpers
βββ static/ # CSS themes, JS, images
βββ templates/ # Jinja2 templates
βββ menubar/ # macOS menu bar app (rumps)
βββ scripts/ # Setup scripts, launchd plists
- Fork the repo
- Create a branch (
git checkout -b feature/shoe-phone-upgrade) - Make your changes
- Submit a PR
"Would you believe... we accept pull requests?"
MIT License β see LICENSE for details.
"Would you believe... the world's smartest agent manager?"
Built with Claude Code. And loving it.