.claude/
├── agents/ # 3 custom subagents
│ ├── mcp-reviewer.md # Code reviewer (Sonnet)
│ ├── api-explorer.md # Fast explorer (Haiku)
│ └── test-generator.md # Test generator (Sonnet)
├── commands/ # 5 slash commands
│ ├── review-tool.md # /review-tool
│ ├── add-tool.md # /add-tool
│ ├── test-coverage.md # /test-coverage
│ ├── api-docs.md # /api-docs
│ └── optimize-code.md # /optimize-code
├── hooks.json # 5 automated hooks
├── config.json # Model configuration
└── README.md # Detailed documentation
CLAUDE_CODE_GUIDE.md # Complete usage guide (root)
Expert code reviewer cho MCP tools
@mcp-reviewer Review the create_work_package implementationChức năng:
- Review tool definitions
- Check async/await patterns
- Validate error handling
- Security review
- Response formatting
Fast codebase navigation
@api-explorer Find all error handling patterns
@api-explorer Where is authentication implemented?Ưu điểm:
- 2x faster than Sonnet
- 3x cheaper
- Perfect cho quick searches
Pytest test generator
@test-generator Create tests for list_work_packages toolTạo:
- Async pytest tests
- Mock patterns
- Error scenario tests
- Coverage improvements
| Command | Usage | Purpose |
|---|---|---|
/review-tool <name> |
/review-tool create_work_package |
Review tool implementation |
/add-tool <endpoint> |
/add-tool custom_fields |
Scaffold new MCP tool |
/test-coverage [module] |
/test-coverage src/tools/ |
Coverage analysis |
/api-docs <endpoint> |
/api-docs work_packages |
API documentation lookup |
/optimize-code <target> |
/optimize-code openproject-mcp.py |
Performance tips |
- format-python-before-edit - Auto Black formatter
- protect-env-file - Block .env edits (security)
- validate-python-syntax - Syntax check
- run-tests-after-tool-changes - Auto pytest
- update-requirements - Auto uv sync
# Use for:
- Daily coding
- Bug fixes
- Reviews
- Tests
- Documentation/model haiku
# Use for:
- Quick searches (10+)
- Rapid iteration
- Cost optimization
# 2x faster, 3x cheaper/model opus
# Use for:
- Architecture decisions
- Large refactoring
- Final review before merge
- Security audits/model opusplan
# Opus for planning, Sonnet for execution# Research (Haiku - fast)
/model haiku
/api-docs custom_fields
# Implement (Sonnet)
/model sonnet
/add-tool custom_fields
# Test (test-generator)
@test-generator Create tests for custom_fields
# Review (mcp-reviewer)
@mcp-reviewer Review custom_fields
# Final check (Opus)
/model opus
Final review before merge# Find (Haiku)
/model haiku
@api-explorer Find error in list_work_packages
# Fix (Sonnet)
/model sonnet
Fix the error
# Auto-hooks run: tests + formatting# Run multiple agents simultaneously
@api-explorer Find pagination patterns
@api-explorer Find auth flow
@test-generator Create auth testsComplete usage guide (19 sections)
- Quick start
- Subagents overview
- Slash commands
- Model selection
- Hooks
- Workflows
- Best practices
- Troubleshooting
- Resources
Configuration reference
- Agent descriptions
- Command usage
- Hook configuration
- Model strategies
- Quick reference
# 1. List slash commands
Type / in Claude Code
# 2. Try a command
/api-docs work_packages
# 3. Use a subagent
@api-explorer Find all tools
# 4. Switch model
/model haiku# Edit any Python file
# Should see: Black formatter runs automatically✅ Use for complex problems, parallel tasks, specialized reviews ❌ Don't use for simple one-line fixes
- Default: Sonnet (90% of work)
- Fast mode: Haiku (10+ searches)
- Deep think: Opus (before merge)
- Hybrid: opusplan (complex features)
- Non-blocking by default
- Fast execution (<5s)
- Check into git for team
- Use
/for autocomplete - Pass
$ARGUMENTSfor parameters - Create custom in
.claude/commands/
# Feature (Sonnet) - $X
Implement authentication
# Research (Haiku) - $X/3 (3x cheaper!)
/model haiku
10+ searches for patterns
# Implementation (Sonnet) - $X
/model sonnet
Write the code
# Final review (Opus) - $X*2
/model opus
Security audit before merge
# Total saved: ~60% compared to all Opus- Try 2-3 slash commands
- Use Explore agent
- Switch models
- Use custom subagents
- Optimize model usage
- Create custom command
- Parallel agents
- Custom hooks
- Hybrid strategies
- Project-specific agents
- Workflow automation
- Team standards
ls .claude/agents/
# Restart Claude Codecat .claude/hooks.json | python -m json.tool
# Check JSON syntaxls .claude/commands/
# Type / to see list- Manual code reviews
- No automated formatting
- Linear workflows
- Single model usage
- No cost optimization
✅ Automated code reviews (@mcp-reviewer) ✅ Auto formatting (hooks) ✅ Parallel workflows (multiple agents) ✅ Optimized models (Haiku for searches) ✅ 60% cost reduction (smart model usage) ✅ Faster development (2x with Haiku) ✅ Better code quality (automated checks)
# Models
/model haiku # 2x faster, 3x cheaper
/model sonnet # Default, balanced
/model opus # Deep thinking, pre-merge
/model opusplan # Hybrid strategy
# Subagents
@mcp-reviewer # Code review
@api-explorer # Fast search (Haiku)
@test-generator # Test generation
# Commands
/review-tool <name>
/add-tool <endpoint>
/test-coverage [module]
/api-docs <endpoint>
/optimize-code <target>- 90% Sonnet: Daily coding, reviews, tests
- 10% Haiku: Quick searches, rapid iteration
- Opus: Final reviews only (pre-merge, architecture)
# Before: Sequential (slow)
Find X, then Find Y, then Find Z
# After: Parallel (fast)
@api-explorer Find X
@api-explorer Find Y
@api-explorer Find Z
# All run simultaneously!- Auto formatting → Consistent code
- Auto testing → Catch bugs early
- Auto reviews → Better quality
- Auto sync → Up-to-date deps
CLAUDE_CODE_GUIDE.md - Comprehensive documentation
/api-docs work_packages
@api-explorer Find all tools- Add project-specific agents
- Create custom commands
- Configure team hooks
- Team training session
- Update project docs
- Share best practices
Official:
Community:
Setup completed successfully! 🎉
Start with Sonnet, use Haiku for searches, save Opus for critical reviews.
Happy coding with Claude Code! 🚀