Recursive Learning Model (RLM) + claude-flow integration for Claude Code
A structured workflow system that enforces complexity-based task decomposition, quality gates, and learning patterns for Claude Code sessions.
- Complexity-based routing: LOW/MEDIUM/HIGH task classification
- Phase pipeline: Structured execution (Phase 0-4)
- Quality Gates: Automated verification checkpoints
- claude-flow MCP integration: Memory, trajectory tracking, pattern learning
- Metacognition: Self-reflection and adaptive learning
- Stuck recovery: Automatic detection and escalation
Copy CLAUDE.md to your home directory:
# Global (all projects)
cp CLAUDE.md ~/.claude/CLAUDE.md
# Or project-specific
cp CLAUDE.md ./CLAUDE.mdWindows:
.\install.ps1Linux/Mac:
chmod +x install.sh && ./install.sh| Level | Criteria | Required Phases |
|---|---|---|
| LOW | Info lookup, 1-2 line changes | None (direct execution) |
| MEDIUM | 1-3 files, bug fixes | Phase 1, 2, 3, 4 |
| HIGH | 5+ files, new features | Phase 0, 1, 2, 3, 4 + Plan Mode |
Phase 0: Initialize (HIGH only)
└── Agent routing, trajectory start
Phase 1: PDE Q&A
└── Expert consultation, requirement gathering
Phase 2: Block Decomposition
└── 5-10 blocks, max 30min each, workflow_create
Phase 3: Recursive Execution
└── Per-block implementation + reflection (max depth: 3)
Phase 4: Verification
└── Quality Gates, Playwright E2E, pattern storage
| Gate | Threshold |
|---|---|
| Test Coverage | >= 80% |
| TypeScript Errors | 0 |
| Lint Errors | 0 |
| Build | Pass |
| Playwright E2E | Pass |
| Console Errors | 0 |
~/.claude/
├── CLAUDE.md # Core Instructions (auto-loaded)
└── hooks/
├── inject-system-prompt.ps1 # Windows hook
├── inject-system-prompt.sh # Linux/Mac hook
└── system-prompt.md # Instructions content
- Claude Code 2.0+
- (Optional) claude-flow MCP for advanced features
Add to ~/.claude/settings.json:
{
"hooks": {
"UserPromptSubmit": [
{
"matcher": "",
"hooks": [
{
"type": "command",
"command": "powershell -NoProfile -ExecutionPolicy Bypass -File ~/.claude/hooks/inject-system-prompt.ps1"
}
]
}
]
}
}MIT
PRs welcome! Please test your changes before submitting.
Inspired by the Claude Code community and Anthropic's best practices.