This guide provides comprehensive documentation for configuring Maestro through .maestro.json files.
Maestro supports multiple configuration file locations and formats:
.maestro.json(project root) - Recommended.maestrorc.json(project root)maestro.config.json(project root)~/.maestrorc(user home)~/.maestrorc.json(user home)
.maestro.local.json- User-specific settings that override project settings (gitignored)
Controls where and how worktrees are created.
{
"worktrees": {
"path": "../maestro-{branch}",
"directoryPrefix": "",
"branchPrefix": ""
}
}| Field | Type | Default | Description |
|---|---|---|---|
path |
string | "../maestro-{branch}" |
Directory pattern for worktrees. Supports {branch} placeholder |
directoryPrefix |
string | "" |
Prefix added to all worktree directory names |
branchPrefix |
string | "" |
Default prefix for new branch names |
Examples:
Place worktrees in a dedicated directory:
{
"worktrees": {
"path": "../workspaces/{branch}"
}
}Add team prefix to branches:
{
"worktrees": {
"branchPrefix": "team-alpha/"
}
}Development environment configuration.
{
"development": {
"autoSetup": true,
"syncFiles": [".env", ".env.local"],
"defaultEditor": "cursor"
}
}| Field | Type | Default | Description |
|---|---|---|---|
autoSetup |
boolean | true |
Auto-run setup commands after worktree creation |
syncFiles |
string[] | [".env", ".env.local"] |
Files to sync across all worktrees |
defaultEditor |
string | "cursor" |
Default editor: "vscode", "cursor", or "none" |
Examples:
Disable auto-setup for manual control:
{
"development": {
"autoSetup": false
}
}Sync additional configuration files:
{
"development": {
"syncFiles": [".env", ".env.local", "config/local.json"]
}
}Automation that runs after worktree creation. This is separate from hooks.afterCreate.
{
"postCreate": {
"copyFiles": [".env", "config/dev.json"],
"commands": ["npm install", "npm run setup"]
}
}| Field | Type | Default | Description |
|---|---|---|---|
copyFiles |
string[] | - | Files to copy from main worktree |
commands |
string[] | - | Commands to execute in new worktree |
Note: postCreate runs before hooks.afterCreate.
Examples:
Python project setup:
{
"postCreate": {
"copyFiles": [".env", "config.ini"],
"commands": ["python -m venv venv", "pip install -r requirements.txt"]
}
}Monorepo setup:
{
"postCreate": {
"commands": ["pnpm install", "pnpm build:deps"]
}
}tmux integration settings.
{
"tmux": {
"enabled": false,
"openIn": "window",
"sessionNaming": "{branch}"
}
}| Field | Type | Default | Description |
|---|---|---|---|
enabled |
boolean | false |
Enable tmux integration by default |
openIn |
string | "window" |
Open in "window" or "pane" |
sessionNaming |
string | "{branch}" |
Session naming pattern |
Examples:
Always use tmux with custom naming:
{
"tmux": {
"enabled": true,
"sessionNaming": "mst-{branch}"
}
}Claude Code integration settings.
{
"claude": {
"markdownMode": "shared"
}
}| Field | Type | Default | Description |
|---|---|---|---|
markdownMode |
string | "shared" |
"shared" (symlink to main) or "split" (independent files) |
Examples:
Use independent CLAUDE.md for each worktree:
{
"claude": {
"markdownMode": "split"
}
}GitHub integration configuration.
{
"github": {
"autoFetch": true,
"branchNaming": {
"prTemplate": "pr-{number}",
"issueTemplate": "issue-{number}"
}
}
}| Field | Type | Default | Description |
|---|---|---|---|
autoFetch |
boolean | true |
Auto-fetch before GitHub operations |
branchNaming.prTemplate |
string | "pr-{number}" |
PR branch naming template |
branchNaming.issueTemplate |
string | "issue-{number}" |
Issue branch naming template |
Examples:
Custom branch naming convention:
{
"github": {
"branchNaming": {
"prTemplate": "pr/{number}-{title}",
"issueTemplate": "issue/{number}-{title}"
}
}
}User interface preferences.
{
"ui": {
"pathDisplay": "absolute"
}
}| Field | Type | Default | Description |
|---|---|---|---|
pathDisplay |
string | "absolute" |
Path display: "absolute" or "relative" |
Examples:
Show relative paths for cleaner output:
{
"ui": {
"pathDisplay": "relative"
}
}Lifecycle hooks for custom automation.
{
"hooks": {
"afterCreate": "npm install",
"beforeDelete": "echo \"Cleaning up: $ORCHESTRA_MEMBER\""
}
}| Field | Type | Default | Description |
|---|---|---|---|
afterCreate |
string | string[] | - | Commands after worktree creation |
beforeDelete |
string | - | Command before worktree deletion |
Environment Variables:
$ORCHESTRA_MEMBER- The branch name$WORKTREE_PATH- Full path to the worktree
Examples:
Multiple commands after creation:
{
"hooks": {
"afterCreate": [
"npm install",
"npm run build",
"echo 'Worktree ready!'"
]
}
}Cleanup before deletion:
{
"hooks": {
"beforeDelete": "npm run cleanup && git stash"
}
}{
"worktrees": {
"path": "../workspaces/{branch}"
},
"development": {
"autoSetup": true,
"syncFiles": [".env", ".env.local"],
"defaultEditor": "vscode"
},
"postCreate": {
"copyFiles": [".env"],
"commands": ["npm install"]
},
"tmux": {
"enabled": true,
"sessionNaming": "dev-{branch}"
},
"github": {
"branchNaming": {
"issueTemplate": "feature/{number}-{title}"
}
},
"hooks": {
"afterCreate": "npm run dev",
"beforeDelete": "npm run clean"
}
}{
"worktrees": {
"path": "../branches/{branch}"
},
"development": {
"autoSetup": false,
"syncFiles": [".env", "config.ini"]
},
"postCreate": {
"copyFiles": [".env", "config.ini"],
"commands": [
"python -m venv venv",
"source venv/bin/activate && pip install -r requirements.txt"
]
},
"hooks": {
"afterCreate": "pre-commit install"
}
}{
"worktrees": {
"path": "../mono-{branch}",
"branchPrefix": "workspace/"
},
"development": {
"autoSetup": true,
"syncFiles": [".env", ".env.local", "turbo.json"]
},
"postCreate": {
"commands": [
"pnpm install",
"pnpm build:shared",
"pnpm prepare"
]
},
"claude": {
"markdownMode": "split"
},
"hooks": {
"afterCreate": ["pnpm dev:setup", "pnpm test"],
"beforeDelete": "pnpm clean:all"
}
}Maestro includes a Model Context Protocol (MCP) server for AI assistant integration.
Use the modern claude mcp add command:
claude mcp add maestro -s local -- npx -y @camoneart/maestro maestro-mcp-server
# Or without -s flag (local is default)
claude mcp add maestro -- npx -y @camoneart/maestro maestro-mcp-serverclaude mcp add maestro -s project -- npx -y @camoneart/maestro maestro-mcp-serverclaude mcp add maestro -s user -- npx -y @camoneart/maestro maestro-mcp-serverIf you've installed Maestro globally:
claude mcp add maestro -s user -- maestro-mcp-serverYou can also use JSON configuration with the claude mcp add-json command:
# Using JSON format
claude mcp add-json maestro -s user '{"type":"stdio","command":"npx","args":["-y","@camoneart/maestro","maestro-mcp-server"]}'
# For global installation
claude mcp add-json maestro -s user '{"type":"stdio","command":"maestro-mcp-server","args":[]}'Note: The traditional manual configuration in .claude/mcp_settings.json is no longer supported.
create_orchestra_member- Create new worktrees with optional base branchdelete_orchestra_member- Remove worktrees with force optionexec_in_orchestra_member- Execute commands within specific worktreeslist_orchestra_members- List all active worktrees with status
The MCP server respects all Maestro configuration settings including hooks, sync files, and Claude markdown modes.
While Maestro doesn't support conditional configuration directly, you can use different approaches:
-
Environment-specific files
.maestro.jsonfor production.maestro.local.jsonfor local overrides (gitignored)
-
Branch-based configuration Create different configs for different branch patterns:
mst init --minimal mst init
{
"development": {
"autoSetup": false
},
"hooks": {
"afterCreate": [
"[ -z \"$CI\" ] && npm install || echo 'Skipping install in CI'"
]
}
}For projects with multiple apps or services:
{
"worktrees": {
"path": "../services/{branch}"
},
"postCreate": {
"copyFiles": [
".env",
"docker-compose.override.yml",
"services/*/config.local.js"
],
"commands": [
"docker-compose build",
"make setup-all"
]
}
}The main change is the addition of postCreate:
Before (v3.0.0):
{
"hooks": {
"afterCreate": ["cp ../.env .", "npm install"]
}
}After (v3.5.0+):
{
"postCreate": {
"copyFiles": [".env"],
"commands": ["npm install"]
}
}If you're migrating from manual Git worktree commands:
- Run
mst initto create initial configuration - Customize the
worktrees.pathto match your existing structure - Add your setup commands to
postCreate.commands - Test with
mst create test-branch --dry-run
- Keep
.maestro.jsonin version control - Share team settings - Use
.maestro.local.jsonfor personal preferences - Override without affecting others - Leverage
postCreatefor consistency - Ensure all worktrees start with the same state - Use environment variables in hooks - Make scripts more flexible
- Test configuration changes - Use
--dry-runwhen available
postCreate commands fail
- Ensure commands work from the worktree directory
- Check file paths are relative to worktree root
- Use
&&to chain dependent commands
Files not syncing
- Verify files exist in main worktree
- Check file permissions
- Use absolute paths if needed
Hooks not executing
- Ensure proper escaping in JSON strings
- Test commands manually first
- Check for shell-specific syntax
DEBUG=mst:* mst create test-branchThis will show detailed logs including configuration loading and command execution.