context-saver
3D Router that auto-switches between model (opus/sonnet/haiku) x effort (low/med/high/max) x version (4.5/4.6) based on task complexity and token budget. Saves 90-97% context and 70-85% cost. Auto-enabled via SessionStart hook.
Context Saver — 3D Router (Model x Effort x Version)
The Context Saver automatically routes every prompt to the optimal 3D combination of model (haiku/sonnet/opus), effort level (low/medium/high/max), and version (4.5/4.6) based on task complexity, token budget, and agent type.
Auto-Enabled
The 3D routing protocol is automatically active when the misar-dev plugin is installed. It injects via SessionStart hook — no manual setup required.
Usage
/misar-dev:context-saver # Show status
/misar-dev:context-saver status # Show 3D routing state + token usage
/misar-dev:context-saver setup # Install advanced router scripts
/misar-dev:context-saver config # Show 3D routing configuration
/misar-dev:context-saver reset # Reset session tracking
How It Works
- SessionStart hook injects 3D routing + fragmentation protocol into every conversation
- LLM analyzes each prompt — selects model + effort + version, decomposes into N parallel subtasks
- Dispatches up to 4 parallel Agent calls per batch, each with optimal 3D assignment
- Subagent work stays in subagent contexts — only summaries return to main context
- Tracks token budget — auto-downgrades to haiku+low+4.5 at 70%+ usage
3D Routing Matrix
| Scenario | Model | Effort | Version | Cost |
|---|---|---|---|---|
| File reads, greps, ls | haiku | low | 4.5 | 1x |
| Simple Q&A | haiku | medium | 4.5 | 1.5x |
| Standard dev work | sonnet | medium | 4.6 | 12x |
| Code review, testing | sonnet | high | 4.6 | 15x |
| Architecture, design | opus | high | 4.6 | 60x |
| Full-suite audit | opus | max | 4.6 | 75x |
Model Distribution (Typical)
- 60% haiku+low — file reads, greps, Explore agents, terse output
- 25% sonnet+medium — implementations, standard dev work
- 10% sonnet+high — code review, debugging, testing
- 4% opus+high — architecture, design
- 1% opus+max — full-suite orchestration, compliance
Savings (v7.0.3)
- 90-97% context token savings (parallel subcontexts + smarter routing)
- 70-85% cost savings (3D routing: model + effort + version optimization)
- 4x longer sessions (150-200+ prompts vs 30 without routing)
- 2-5x faster on multi-file tasks (parallel batch execution)
- +20-25% output token savings over v6.0.0 (from effort-based verbosity control)
Advanced Setup
Run /misar-dev:context-saver setup to install the Python-based router scripts to ~/.claude/router/ for:
- Custom 3D routing rules via
config.yaml - Token monitoring with effort/version tracking via
monitor.py - Programmatic model+effort switching via
switch-model.sh - Pre/post prompt hooks for shell-level routing
Misar.Dev Ecosystem — 3D routing optimizes cost so you can build more with Assisters AI APIs at scale.
Assisters · Misar Blog · Misar Mail · Misar.io · Misar.Dev