Skip to main content
Claude Code is Anthropic’s flagship AI coding assistant, fully integrated with Maestro for powerful collaborative development.

Overview

Claude Code (claude) provides intelligent code generation, debugging, and refactoring capabilities with deep codebase understanding.
Claude Code is the most feature-complete agent in Maestro, supporting session resume, plan mode, image input, and comprehensive usage statistics.

Installation

1

Install Claude Code

Install via npm:
npm install -g @anthropic-ai/claude-code
2

Authenticate

Run Claude Code once to authenticate:
claude
Follow the prompts to sign in with your Anthropic account.
3

Verify in Maestro

Launch Maestro and create a new session with Claude Code as the agent type.

Capabilities

Claude Code provides the most comprehensive feature set of any Maestro-supported agent:
supportsResume
boolean
default:"true"
Resume existing sessions with --resume flag
supportsReadOnlyMode
boolean
default:"true"
Plan mode with --permission-mode plan (read-only access)
supportsJsonOutput
boolean
default:"true"
Structured JSON output with --output-format stream-json
supportsSessionId
boolean
default:"true"
Persistent session IDs for conversation continuity
supportsImageInput
boolean
default:"true"
Attach screenshots, diagrams, and images
supportsImageInputOnResume
boolean
default:"true"
Send images via --input-format stream-json on resumed sessions
supportsSlashCommands
boolean
default:"true"
Built-in commands like /help, /compact, /reset
supportsSessionStorage
boolean
default:"true"
Session history stored in ~/.claude/projects/
supportsCostTracking
boolean
default:"true"
Real-time cost information in USD
supportsUsageStats
boolean
default:"true"
Token counts for input and output
supportsThinkingDisplay
boolean
default:"true"
Streaming reasoning/thinking content
supportsContextMerge
boolean
default:"true"
Receive merged context from other sessions
supportsContextExport
boolean
default:"true"
Export conversation context for transfer
Source: src/main/agents/capabilities.ts:121

Command-Line Arguments

Maestro uses these base arguments for all Claude Code sessions:
claude --print --verbose --output-format stream-json --dangerously-skip-permissions
--print
flag
Run in batch/headless mode (no interactive TUI)
--verbose
flag
Enable detailed logging output
--output-format
string
default:"stream-json"
Output format for structured parsing
--dangerously-skip-permissions
flag
Auto-approve all file operations (required by Maestro)

Resume Mode

To resume an existing session:
claude --resume {sessionId} [additional args]
--resume
string
Claude session ID to resume

Plan Mode (Read-Only)

For read-only analysis without file modifications:
claude --permission-mode plan [additional args]
--permission-mode
string
default:"plan"
Set to plan for read-only mode
Source: src/main/agents/definitions.ts:125

Session Storage

Claude Code stores session history in:
~/.claude/projects/{project-name}/{session-id}/
Each session directory contains:
  • conversation.json - Full conversation history
  • metadata.json - Session metadata and configuration
  • files/ - Created/modified files during the session
Maestro can import existing Claude sessions for seamless continuation. Source: src/main/storage/claude-code-session-storage.ts

Output Format

Claude Code outputs newline-delimited JSON events:
{
  "type": "system",
  "subtype": "init",
  "session_id": "abc123",
  "slash_commands": ["/help", "/compact", "/reset"]
}
Source: src/main/parsers/claude-code-parser.ts

Slash Commands

Claude Code supports these built-in commands:
Display available slash commands and usage information
Switch to compact output mode (less verbose)
Clear conversation history and start fresh
Show current context window usage

Error Patterns

Common error patterns Maestro detects:
API_KEY_INVALID
error
Pattern: Invalid API keySolution: Re-authenticate with claude command
RATE_LIMIT_EXCEEDED
error
Pattern: rate limit exceededSolution: Wait before retrying or upgrade your Anthropic plan
CONTEXT_LENGTH_EXCEEDED
error
Pattern: context length exceededSolution: Start a new session or use /reset to clear context
PERMISSION_DENIED
error
Pattern: permission deniedSolution: Check file permissions in working directory
Source: src/main/parsers/error-patterns.ts

Usage with Maestro Features

Auto Run

Fully supported - Claude Code works with playbooks and automated workflows

Group Chat

Participate in multi-agent group chats with other providers

Context Grooming

Export and merge conversation context between sessions

Session Discovery

Import existing Claude sessions from ~/.claude/projects/

Context Window

Claude Code uses Claude 3.5 Sonnet or Claude 4 models with:
  • Context Window: 200,000 tokens
  • Output Limit: ~8,000 tokens per response
Source: src/renderer/utils/contextUsage.ts:15

Best Practices

1

Use Descriptive Session Names

Name sessions based on the task for easier identification in history
2

Resume Instead of Restart

Use session resume to maintain context and reduce token usage
3

Enable Plan Mode for Analysis

Use read-only mode when you only need code analysis without modifications
4

Monitor Token Usage

Check the usage dashboard to track costs and optimize prompts

Troubleshooting

Verify installation:
which claude
claude --version
If not found, reinstall:
npm install -g @anthropic-ai/claude-code
Re-authenticate:
claude logout
claude
Check session exists:
ls ~/.claude/projects/
Session IDs are case-sensitive and must match exactly.

Build docs developers (and LLMs) love