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

  1. SessionStart hook injects 3D routing + fragmentation protocol into every conversation
  2. LLM analyzes each prompt — selects model + effort + version, decomposes into N parallel subtasks
  3. Dispatches up to 4 parallel Agent calls per batch, each with optimal 3D assignment
  4. Subagent work stays in subagent contexts — only summaries return to main context
  5. Tracks token budget — auto-downgrades to haiku+low+4.5 at 70%+ usage

3D Routing Matrix

ScenarioModelEffortVersionCost
File reads, greps, lshaikulow4.51x
Simple Q&Ahaikumedium4.51.5x
Standard dev worksonnetmedium4.612x
Code review, testingsonnethigh4.615x
Architecture, designopushigh4.660x
Full-suite auditopusmax4.675x

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