Debugging Guide
Comprehensive debugging strategies for Orchestre projects.
Debug Mode
Enable Debug Output
bash
# Set environment variable
export ORCHESTRE_DEBUG=true
export ORCHESTRE_LOG_LEVEL=debug
# Run with debug
node /path/to/orchestre/dist/server.jsDebug Information
When debug mode is enabled:
- Detailed MCP communication logs
- Tool execution timing
- API call details
- Error stack traces
Common Issues
MCP Connection Problems
Symptoms: Tools don't appear in Claude Code
Debug Steps:
- Check server path in MCP config
- Verify dist/server.js exists (not src/)
- Check for error messages in Claude Code
- Ensure API keys are set
bash
# Verify build
ls -la dist/server.js
# Test server directly
node dist/server.jsTool Execution Errors
Symptoms: Tools fail with errors
Debug Steps:
- Enable debug mode
- Check error details in response
- Verify API keys are valid
- Check rate limits
bash
# Test API keys
env | grep "_API_KEY"
# Check specific tool
/orchestrate "Test analyze project tool"Template Issues
Symptoms: Template commands not working
Debug Steps:
- Verify template was initialized correctly
- Check template.json exists
- Ensure commands are installed
- Review command files
bash
# Check template
cat template.json
# List available commands
ls templates/*/commands/Debugging Tools
Log Analysis
bash
# Filter debug logs
export ORCHESTRE_DEBUG=true 2>&1 | grep "ERROR"
# Save logs to file
export ORCHESTRE_DEBUG=true 2>&1 | tee debug.logState Inspection
bash
# Check project state
/status
# Discover context
/discover-context
# Review memory files
find . -name "CLAUDE.md" -type fPerformance Profiling
bash
# Time operations
export ORCHESTRE_DEBUG=true
export ORCHESTRE_LOG_LEVEL=verbose
# Monitor resource usage
top -p $(pgrep -f orchestre)Tool-Specific Debugging
analyzeProject
Common issues:
- Requirements too vague
- Gemini API errors
- Timeout on large projects
Debug:
bash
# Test with simple requirements
/orchestrate "Analyze simple TODO app requirements"
# Check Gemini API
curl -H "x-goog-api-key: $GEMINI_API_KEY" \
https://generativelanguage.googleapis.com/v1/modelsmultiLlmReview
Common issues:
- Model disagreements
- Token limits exceeded
- Missing file content
Debug:
bash
# Test with small file
echo "console.log('test');" > test.js
/review test.js
# Check model availability
/orchestrate "List available review models"initializeProject
Common issues:
- Template not found
- Permission denied
- Path already exists
Debug:
bash
# List templates
ls templates/
# Check permissions
ls -la /target/directory/
# Test with temp directory
/create "test-app" using cloudflare-hono in /tmpEnvironment Debugging
API Key Issues
bash
# Check all keys
env | grep -E "(ANTHROPIC|OPENAI|GEMINI)_API_KEY"
# Test each provider
/orchestrate "Test Anthropic API"
/orchestrate "Test OpenAI API"
/orchestrate "Test Gemini API"Path Issues
bash
# Check working directory
pwd
# Verify Orchestre path
which orchestre
# Check Node version
node --version # Should be 18+Error Messages
Common Errors
"Template not found"
- Check template name spelling
- Verify template exists in templates/
- Use exact template name (case-sensitive)
"API key missing"
- Set required environment variables
- Check .env file is loaded
- Verify key format is correct
"Rate limit exceeded"
- Wait before retrying
- Reduce parallel operations
- Check API quotas
"File not found"
- Use absolute paths
- Check file permissions
- Verify working directory
Advanced Debugging
Source Maps
bash
# Build with source maps
npm run build -- --sourceMap
# Better stack traces
node --enable-source-maps dist/server.jsRemote Debugging
bash
# Node.js debugging
node --inspect dist/server.js
# Connect debugger to port 9229Memory Leaks
bash
# Heap snapshots
node --inspect dist/server.js
# Use Chrome DevTools Memory Profiler
# Monitor memory
node --expose-gc dist/server.jsReporting Issues
When reporting bugs, include:
Environment:
bashnode --version npm --version echo $OSTYPEError Details:
- Full error message
- Stack trace
- Debug logs
Reproduction Steps:
- Minimal example
- Expected behavior
- Actual behavior
Configuration:
- MCP config (without keys)
- Template used
- Command executed
