Skip to main content
When Claude Octopus workflows fail or behave unexpectedly, debug mode provides detailed logging to help you diagnose issues.

Debug mode

Enable debug logging to see detailed execution traces:

Option 1: Environment variable

Option 2: Command-line flag

Option 3: Inline

Option 4: From Claude Code

This persists the debug setting across sessions.

What debug mode shows

Debug mode provides detailed logging including:

Startup information

Provider detection

Agent execution

Execution results

Workflow progress

Error context

Log locations

Claud Octopus writes logs to multiple locations:

Orchestration logs

Location: ~/.claude-octopus/logs/orchestrate.log Contains:
  • Command invocations
  • Provider routing decisions
  • Quality gate results
  • Phase transitions
  • Error stack traces
View recent logs:

Agent logs

Location: ~/.claude-octopus/logs/agents/ Structure:
Contains:
  • Full agent output (stdout + stderr)
  • Tool executions
  • Memory operations
  • Token usage
View latest agent log:

Result files

Location: ~/.claude-octopus/results/ Structure:
Contains:
  • Final output from each phase
  • Quality scores
  • Multi-provider consensus results
  • Validation reports

MCP server logs

Location: ~/.claude/logs/mcp-server.log (Claude Code) or ~/.openclaw/logs/mcp-server.log (OpenClaw) Contains:
  • MCP tool invocations
  • Parameter validation errors
  • orchestrate.sh execution traces

Common errors and solutions

Error: ERROR: Codex CLI not foundCause: AI provider CLI is not installed or not in PATHSolution:
Error: ERROR: OPENAI_API_KEY not setCause: Environment variable not configuredSolution:
Error: Quality gate FAILED: score 65/75Cause: Tangle phase output didn’t meet quality thresholdSolution:
Error: ERROR: Agent timed out after 300sCause: Agent execution exceeded timeoutSolution:
Error: bash: ./scripts/orchestrate.sh: Permission deniedCause: Script not executableSolution:
Error: ERROR: Persona 'rust-expert' not foundCause: Custom persona file doesn’t exist or has wrong nameSolution:

Using /octo:doctor for diagnostics

The /octo:doctor command runs 9 health checks:

Health check categories

  1. Provider availability — Checks if Codex, Gemini, Claude CLIs are installed
  2. Authentication — Validates API keys and OAuth tokens
  3. File permissions — Checks if scripts are executable
  4. Directory structure — Validates workspace directories exist
  5. Configuration — Checks environment variables
  6. Memory — Validates memory files are readable
  7. Hooks — Tests hook execution
  8. MCP server — Checks if MCP server is running
  9. Disk space — Ensures sufficient space for logs/results

Example output

Fixing doctor issues

Debugging workflow phases

Probe phase issues

Symptom: Research incomplete or low-quality Debug:
Common causes:
  • Provider timeout
  • API rate limiting
  • Insufficient context in prompt

Grasp phase issues

Symptom: Consensus not reached Debug:
Common causes:
  • Providers disagree (working as intended)
  • Threshold too high (default 75%)

Tangle phase issues

Symptom: Quality gate fails Debug:
Common causes:
  • Code quality issues
  • Missing tests
  • Security vulnerabilities

Ink phase issues

Symptom: Adversarial review blocks delivery Debug:

Best practices

  1. Always enable debug mode when troubleshooting — The overhead is minimal
  2. Check logs in order: orchestrate.log → agent logs → result files
  3. Use /octo:doctor first — Catches most common configuration issues
  4. Simplify prompts — If a complex prompt fails, try breaking it into phases
  5. Check provider status — API outages happen; verify with /octo:status

Reporting issues

When reporting bugs, include:
  1. Debug log output:
  2. Doctor output:
  3. Environment info:
  4. Relevant result files:
Submit to: https://github.com/nyldn/claude-octopus/issues

Source code reference

  • Debug mode implementation: scripts/orchestrate.sh (search for OCTOPUS_DEBUG)
  • Log functions: scripts/lib/logging.sh
  • Doctor command: .claude/skills/skill-doctor.md