When asked to set up or install this project, run the following steps in order. Check each prerequisite and install if missing, then install npm dependencies.
node --versionIf not installed or too old, install via nvm or directly from nodejs.org:
# macOS with Homebrew
brew install nodewhich tmux || echo "MISSING: tmux not found"Install if missing:
# macOS
brew install tmux
# Ubuntu/Debian
sudo apt install tmux# macOS
xcode-select -p || xcode-select --install
# Ubuntu/Debian
which make || sudo apt install build-essential python3which claude || echo "MISSING: claude not found"Install if missing:
npm install -g @anthropic-ai/claude-codenpm installnode --version # should be ≥ 22
which tmux
which claude
ls node_modules | head -5If everything looks good, start the server with:
npm run devThen open http://localhost:3000.
npm run dev— start server (port 3000) + Vite dev server concurrently, both with hot reloadnpm run build— compile TypeScript and bundle client for productionnpm run server:start— run production build
- Server: Express + Socket.io on :3000; MCP SSE server on :3001
- Client: React 18 + Vite
- Database: SQLite via
node:sqliteexperimental (auto-created atdata/orchestrator.db) - Agents: spawned as
claude --print --output-format stream-json --verbosesubprocesses
A PreToolUse hook (scripts/check-lock-hook.mjs) blocks Edit/Write tool calls unless the agent holds a DB lock for that file. This applies to all Claude Code sessions running in this directory, including interactive ones.
To manually acquire a lock for direct edits while the orchestrator is running:
AGENT_ID="$ORCHESTRATOR_AGENT_ID"
FILE="/absolute/path/to/file"
LOCK_ID=$(node -e "const {randomUUID}=require('crypto');console.log(randomUUID())")
NOW=$(node -e "console.log(Date.now())")
EXPIRES=$(node -e "console.log(Date.now()+300000)")
sqlite3 data/orchestrator.db \
"INSERT INTO file_locks (id,agent_id,file_path,reason,acquired_at,expires_at,released_at) VALUES ('$LOCK_ID','$AGENT_ID','$FILE','manual',$NOW,$EXPIRES,NULL);"
# ... make your edits ...
sqlite3 data/orchestrator.db \
"UPDATE file_locks SET released_at=$(node -e 'console.log(Date.now())') WHERE id='$LOCK_ID';"