max start launches the Max daemon and keeps it running in the foreground. The daemon is the core of Max: it owns the Copilot SDK client, manages worker sessions, exposes an HTTP API on port 7777, and optionally runs a Telegram bot.
Flags
| Flag | Default | Description |
|---|---|---|
--self-edit | off | Allow Max to modify his own source code. Sets MAX_SELF_EDIT=1 in the process environment. |
What it does
max start runs through the following boot sequence, logging each step to stdout:
Load config
Reads
~/.max/.env to populate runtime settings: TELEGRAM_BOT_TOKEN, AUTHORIZED_USER_ID, API_PORT, COPILOT_MODEL, and WORKER_TIMEOUT.Initialize SQLite database
Opens (or creates)
~/.max/max.db. Stores worker sessions, conversation history, memories, and app state.Start Copilot SDK client
Connects to the GitHub Copilot SDK. The client must be authenticated — run
copilot login beforehand if you haven’t already.Initialize orchestrator session
Creates or resumes the persistent orchestrator Copilot session. Loads skills from
~/.max/skills/ and ~/.agents/skills/, loads MCP servers from ~/.copilot/mcp-config.json, and injects recent conversation context if recovering from a crash.Start HTTP API
Starts an Express server on port 7777 (or the
API_PORT env var). The TUI and any external clients connect here.Start Telegram bot
If
TELEGRAM_BOT_TOKEN and AUTHORIZED_USER_ID are configured, starts the Telegram bot. Messages are gated to the authorized user ID only.Expected terminal output
A successful start looks like this:Running in the foreground vs. background
max start occupies the terminal. To keep it running while you work:
- tmux / screen
- nohup
- systemd (Linux)
Stopping the daemon
Press Ctrl+C (or sendSIGINT / SIGTERM) to trigger a graceful shutdown.
If there are active worker sessions, you will see a warning before shutdown proceeds:
If the daemon is killed ungracefully (e.g.
kill -9), the orchestrator session is preserved in SQLite and automatically resumed on the next max start.