Refactor Agent Skills for 10x Cost Efficiency A developer refactored coding-agent skills into a two-tier orchestration that pins mechanical steps to Claude Haiku in a forked context and routes judgment work to Claude Sonnet, cutting a pull-request-description workflow from roughly $3.40 per execution to under $0.50 while retaining 100% of template and label quality. The approach targets the hidden cost of monolithic agent loops, where large tool outputs such as 30,000-token git diffs are re-read on every turn, and is presented as three prompts that let an agent audit and rewrite its own SKILL.md files. Engineering teams embracing modern coding agents frequently hit the same inflection point: developer velocity surges, but token bills quickly outpace budgets. The standard advice is usually: "Use lower cost models for simple tasks." In practice, manual model switching does not work. When an engineer is in a flow state debugging an issue or shipping a feature, constantly running /model adds pure cognitive friction. Developers either leave frontier models like Claude Sonnet or Opus on by default, or switch to Haiku, hit a subtle capability wall, and get frustrated. The solution is not manual switching. It is automated routing and architecturally cost-aware orchestrations agent skills . Best of all, you do not need to write complex orchestration code yourself . You can prompt your agent to analyze and refactor your existing skills for you. To see what a cost-aware orchestration looks like in practice, consider a common developer workflow: a skill that automatically inspects your branch, generates a standardized pull request description, and applies issue labels. Originally, this entire workflow ran monolithically on Claude Sonnet, costing ~$3.40 per execution. I refactored the workflow into a two-tier orchestration: model: haiku in an isolated scratchpad context: fork . model: sonnet to evaluate whether the code changes represent architectural technical debt, a security-sensitive change, or feature work. The result: PR templates and labels retained 100% of their quality, while execution cost plummeted from dollars to <$0.5. We apply this exact same pattern to complex incident triage and log diagnosis pipelines. Why does splitting a workflow slash costs so dramatically? When you inspect token usage dashboards in LLM observability tools, the breakdown reveals a hidden trap: When an agent operates in a single, unbroken loop, every tool output—like a 30,000-token git diff, a massive API response, or pages of raw logs—is appended to the conversation transcript. The model must re-read that entire history on every subsequent turn. By turn 8, the model burns thousands of expensive frontier tokens just re-reading past tool outputs. What looked like a simple automation quickly balloons into a $3 to $5 run. You do not need to manually edit YAML frontmatter or learn prompt schemas by hand. You can instruct your coding agent to audit and refactor your skills using three simple prompts. Bellow prompt examples are created for Claude models. Point your agent at your skill definition or workflow config: Audit this skill definition @SKILL.md or plugin config for token efficiency: 1. Identify Mechanical / Procedural steps git commands, template formatting, CLI checks . 2. Identify Heavy Data steps fetching raw diffs, reading large logs, full API payloads . 3. Identify High-Order Judgment steps categorization, root-cause analysis, code critique . Summarize current model assignments and highlight where context accumulates. Instruct the agent to apply the two-tier pattern: Refactor this skill using the two-tier cost pattern: 1. Set the primary skill frontmatter to 'model: haiku' and 'context: fork' for all mechanical steps. 2. Extract the judgment steps into a private subagent e.g.,