model-escalation
Automatic model switching based on task complexity for OpenClaw agents. Dynamically escalates between Haiku (simple), Sonnet (medium), and Opus (complex) models. Tracks prefix consistency ([H], [S], [O]) and logs discrepancies. USE WHEN configuring multi-model agents, optimizing API costs, or implementing complexity-based model routing.
npx skills add majiayu000/claude-skill-registry --skill model-escalation --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Model Escalation **Canonical implementation:** `Tools/model_escalator_v2.py` Complexity-based model switching with prefix tracking for OpenClaw agents. ## Quick Start ```python from Tools.model_escalator_v2 import model_escalation_hook_v2 as model_escalation_hook # Determine model from conversation context result = model_escalation_hook("main-session", { "messages": [], "current_message": "Explain this API integration", "token_count": 0, }) session_status(model=result.model) ``` ## Complexity Thresholds | Range | Model | Prefix | Use Cases | |-------|-------|--------|-----------| | 0-0.25 | Haiku | [H] | Simple questions, confirmations, chat | | 0.25-0.75 | Sonnet | [S] | Code, debugging, API integration | | 0.75-1.0 | Opus | [O] | Architecture, complex algorithms, strategic planning | ## High Complexity Indicators (Opus) - System architecture design - Distributed systems - Multi-step technical implementations - Deep code reviews - Strategic planning with tradeoffs - "Implement X mechanism/system" requests ## Prefix Tracking Ensures conversation prefix matches active model: ```python from Tools.model_prefix_tracker import ModelPrefixTracker tracker = ModelPrefixTracker() # Valida
- Quick Start
- Complexity Thresholds
- High Complexity Indicators (Opus)
- Prefix Tracking
- Integration with AGENTS.md
- Configuration
- Database Schema
sqlite3 model_prefix_state.db "SELECT * FROM prefix_log WHERE correction_applied=1;"
What does the model-escalation skill do?
Automatic model switching based on task complexity for OpenClaw agents. Dynamically escalates between Haiku (simple), Sonnet (medium), and Opus (complex) models. Tracks prefix consistency ([H], [S], [O]) and logs discrepancies. USE WHEN configuring multi-model agents, optimizing API costs, or implementing complexity-based model routing.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill model-escalation --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
