feat: add bridge script for Claude Code → LM Studio execution (v3.12.1)

Bridge script enables local execution of Claude Code plans via LM Studio:
- Python CLI with 5 components (DoobidooReader, LMStudioClient, Validator, StepExecutor, PlanExecutor)
- JSON Schema for plan validation (bridge-plan-schema.json)
- Cost optimization: Plan with Opus (~$0.50-2), execute free locally (80-90% savings)
- 4 validation types: json, syntax_check, contains_keys, non_empty
- CLI: --health, --list, --plan ID, -v verbose mode

Documentation:
- New section "Local Execution Bridge" in ultimate-guide.md §11.2
- scripts/README.md with full usage documentation
- machine-readable/reference.yaml entries for discoverability

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Florian BRUNIAUX 2026-01-25 18:43:05 +01:00
parent 2ace737018
commit 96da6ebd7e
10 changed files with 1223 additions and 10 deletions

View file

@ -6,7 +6,7 @@
**Written with**: Claude (Anthropic)
**Version**: 3.12.0 | **Last Updated**: January 2026
**Version**: 3.12.1 | **Last Updated**: January 2026
---
@ -424,4 +424,4 @@ where.exe claude; claude doctor; claude mcp list
**Author**: Florian BRUNIAUX | [@Méthode Aristote](https://methode-aristote.fr) | Written with Claude
*Last updated: January 2026 | Version 3.12.0*
*Last updated: January 2026 | Version 3.12.1*

View file

@ -10,7 +10,7 @@
**Last updated**: January 2026
**Version**: 3.12.0
**Version**: 3.12.1
---
@ -13612,6 +13612,7 @@ source ~/.bashrc
Diagnostic scripts for instant troubleshooting. Get them from:
- Windows: [`examples/scripts/check-claude.ps1`](../examples/scripts/check-claude.ps1)
- macOS/Linux: [`examples/scripts/check-claude.sh`](../examples/scripts/check-claude.sh)
- Bridge health: `python examples/scripts/bridge.py --health` (LM Studio connectivity)
### Full Clean Reinstall Procedures
@ -14076,6 +14077,83 @@ cco # Offline mode (Ollama, 100% local)
See: [cc-copilot-bridge Quick Start](https://github.com/FlorianBruniaux/cc-copilot-bridge#-quick-start)
### Local Execution Bridge (Opus Plan → LM Studio Execute)
For maximum cost savings, use Claude Code (Opus) for planning only, then execute locally via LM Studio.
**Architecture:**
```
┌──────────────┐ store_memory ┌─────────────────┐
│ Claude Code │ ─────────────────────►│ doobidoo │
│ (Opus) │ tag: "plan" │ SQLite + Vec │
│ PLANNER │ status: "pending" └────────┬────────┘
└──────────────┘ │
┌─────────────────┐
│ bridge.py │
│ (Python CLI) │
└────────┬────────┘
│ HTTP
┌─────────────────┐
│ LM Studio │
│ localhost:1234 │
│ (MLX local) │
└─────────────────┘
```
**Cost model:**
- Planning (Opus): ~$0.50-2.00 per complex plan
- Execution (LM Studio): Free (100% local)
- **ROI**: 80-90% cost reduction on implementation tasks
**Setup:**
```bash
# Requires doobidoo MCP and LM Studio running
pip install httpx
# Health check
python examples/scripts/bridge.py --health
# List pending plans
python examples/scripts/bridge.py --list
# Execute all pending plans
python examples/scripts/bridge.py
```
**Workflow:**
1. **Claude Code creates plan** (stored in doobidoo):
```json
{
"$schema": "bridge-plan-v1",
"id": "plan_jwt_migration",
"status": "pending",
"context": {
"objective": "Migrate auth to JWT",
"files_context": {"src/auth.py": "LOAD"}
},
"steps": [
{"id": 1, "type": "analysis", "prompt": "..."},
{"id": 2, "type": "code_generation", "depends_on": [1], "file_output": "src/jwt.py"}
]
}
```
2. **Bridge executes locally** via LM Studio
3. **Results stored** back in doobidoo for Claude Code to review
**When to use:**
- Implementation tasks (not architectural decisions)
- Code generation with clear specs
- Bulk transformations
- When Opus planning + local execution beats Opus end-to-end
See: [`examples/scripts/bridge.py`](../examples/scripts/bridge.py), [`examples/scripts/README.md`](../examples/scripts/README.md)
## 11.3 Practical Workflows
### Research → Code Pipeline
@ -14785,4 +14863,4 @@ Common misconceptions we've seen:
**Contributions**: Issues and PRs welcome.
**Last updated**: January 2026 | **Version**: 3.12.0
**Last updated**: January 2026 | **Version**: 3.12.1