Guides
Best practices, multi-agent orchestration, dashboard setup, session templates, and token efficiency tips.
Best Practices
run_command vs create_terminal
Use run_command for one-shot tasks that exit (build, test, install). Use create_terminal for ongoing sessions (dev servers, watchers, REPLs).
waitForExit vs pattern matching
Pattern matching (default) — returns as soon as the line appears. The process keeps running.
waitForExit: true — waits for the process to finish, then returns everything.
fromSession for sub-agents
Use fromSession instead of hardcoding paths. It inherits cwd from an existing session, keeping your agent configurations portable.
Worktrees for parallel agents
Use worktree: true to isolate changes when running multiple agents on the same codebase. Each agent gets its own git worktree, preventing file conflicts.
Multi-Agent Orchestration
Spawn agents
Use spawn_claude, spawn_codex, spawn_gemini to launch sub-agents.
Tag & group
Use tags for logical grouping: "research", "feature". Clean up with close_group.
Isolation
Use worktree: true for full filesystem isolation between agents.
Delegation
Use delegate_task for interactive multi-turn conversations between agents.
Monitor all sessions with read_multiple and list_terminals.
Web Dashboard
Enable with --dashboard --port 3141. Open http://localhost:3141.
If --auth-token is enabled, access with ?token=YOUR_TOKEN.
Desktop App
macOS Electron app. Currently requires running from source (pending Apple code signing).
Native title bar & system tray
Close-to-tray & notifications
Auto-update support
Security hardened
Session Templates
Built-in templates for common workflows:
| Template | Command | Tags | Wait For |
|---|---|---|---|
| shell | $SHELL | shell | — |
| next-dev | npx next dev | dev-server, next | "Ready" |
| vite-dev | npx vite | dev-server, vite | "Local:" |
| docker-compose | docker compose up | docker | — |
| npm-test | npm test | test | — |
| npm-test-watch | npm run test:watch | test, watch | — |
Token Efficiency
Forge uses a ring buffer with per-consumer cursors — each read_terminal call returns only new output since the last read. No repeated content, no wasted tokens.
90%
Context token savings
30 KB
Read cap per call
Cursor
Per-consumer tracking