The Loop: Plan → Approve → Implement
The loop is Huginn’s core workflow. It ensures you see and approve every change before it’s written to disk.
How it works
1. Trigger planning
Use the /plan command followed by your request:
/plan add pagination to the users endpoint
Or use natural language — Huginn detects planning requests automatically.
2. Planner streams a structured plan
The planner model (separate from the coder) analyzes your repository and streams a structured plan with:
- Numbered steps
- Exact file paths for each change
- A description of what each change does
3. You approve, edit, or cancel
[a]pprove [e]dit [c]ancel
- Approve — passes the plan to the coder
- Edit — opens the plan in your editor for modifications
- Cancel — aborts without touching any files
4. Coder generates diffs
The coder model receives your approved plan plus the relevant repo context and streams diffs. Files are written to disk with a preview.
5. Tests run automatically
Huginn detects your test framework (Go test, pytest, Jest, Cargo test) and runs your tests automatically after applying changes.
Why two models?
Planning and implementation require different reasoning styles. The planner needs to think about architecture and dependencies. The coder needs to generate syntactically correct diffs. Using separate models for each role reduces hallucinations.
Direct coding
Use /code to skip the planning step and go straight to implementation:
/code fix the off-by-one error in the pagination logic