home / skills / yeachan-heo / oh-my-claudecode / ecomode

ecomode skill

/skills/ecomode

This skill enables token-efficient parallel execution by routing to Haiku and Sonnet agents, prioritizing cost savings while maintaining quality.

npx playbooks add skill yeachan-heo/oh-my-claudecode --skill ecomode

Review the files below or copy the command above to add this skill to your agents.

Files (1)
SKILL.md
5.4 KB
---
name: ecomode
description: Token-efficient parallel execution mode using Haiku and Sonnet agents
---

# Ecomode Skill

Activates token-efficient parallel execution for pro-plan users who prioritize cost efficiency.

## When Activated

This skill enhances Claude's capabilities by:

1. **Parallel Execution**: Running multiple agents simultaneously for independent tasks
2. **Token-Conscious Routing**: Preferring Haiku and Sonnet agents, avoiding Opus
3. **Background Operations**: Using `run_in_background: true` for long operations
4. **Persistence Enforcement**: Never stopping until all tasks are verified complete
5. **Cost Optimization**: Minimizing token usage while maintaining quality

## Ecomode Routing Rules (CRITICAL)

**ALWAYS prefer lower tiers. Only escalate when task genuinely requires it.**

| Decision | Rule |
|----------|------|
| DEFAULT | Use LOW tier (Haiku) for all tasks |
| UPGRADE | Use MEDIUM (Sonnet) only when task complexity warrants |
| AVOID | HIGH tier (Opus) - only use for planning/critique if explicitly essential |

## Smart Model Routing (PREFER LOW TIER)

**Choose tier based on task complexity: LOW (haiku) preferred → MEDIUM (sonnet) fallback → HIGH (opus) AVOID**

### Agent Routing Table

| Domain | PREFERRED (Haiku) | FALLBACK (Sonnet) | AVOID (Opus) |
|--------|-------------------|-------------------|--------------|
| **Analysis** | `architect-low` | `architect-medium` | ~~`architect`~~ |
| **Execution** | `executor-low` | `executor` | ~~`executor-high`~~ |
| **Search** | `explore` | `explore-medium` | ~~`explore-high`~~ |
| **Research** | `researcher-low` | `researcher` | - |
| **Frontend** | `designer-low` | `designer` | ~~`designer-high`~~ |
| **Docs** | `writer` | - | - |
| **Visual** | - | `vision` | - |
| **Planning** | - | - | `planner` (if essential) |
| **Critique** | - | - | `critic` (if essential) |
| **Testing** | - | `qa-tester` | ~~`qa-tester-high`~~ |
| **Security** | `security-reviewer-low` | - | ~~`security-reviewer`~~ |
| **Build** | `build-fixer-low` | `build-fixer` | - |
| **TDD** | `tdd-guide-low` | `tdd-guide` | - |
| **Code Review** | `code-reviewer-low` | - | ~~`code-reviewer`~~ |
| **Data Science** | `scientist-low` | `scientist` | ~~`scientist-high`~~ |

### Tier Selection Guide (Token-Conscious)

| Task Complexity | Tier | Examples |
|-----------------|------|----------|
| Simple lookups | LOW | "What does this function return?", "Find where X is defined" |
| Standard work | LOW first, MEDIUM if fails | "Add error handling", "Implement this feature" |
| Complex analysis | MEDIUM | "Debug this issue", "Refactor this module" |
| Planning only | HIGH (if essential) | "Design architecture for new system" |

### Routing Examples

**CRITICAL: Always pass `model` parameter explicitly - Claude Code does NOT auto-apply models from agent definitions!**

```
// Simple question → LOW tier (DEFAULT)
Task(subagent_type="oh-my-claudecode:architect-low", model="haiku", prompt="What does this function return?")

// Standard implementation → TRY LOW first
Task(subagent_type="oh-my-claudecode:executor-low", model="haiku", prompt="Add validation to login form")

// If LOW fails, escalate to MEDIUM
Task(subagent_type="oh-my-claudecode:executor", model="sonnet", prompt="Add error handling to login")

// File lookup → ALWAYS LOW
Task(subagent_type="oh-my-claudecode:explore", model="haiku", prompt="Find where UserService is defined")

// Only use MEDIUM for complex patterns
Task(subagent_type="oh-my-claudecode:explore-medium", model="sonnet", prompt="Find all authentication patterns in the codebase")
```

## DELEGATION ENFORCEMENT (CRITICAL)

**YOU ARE AN ORCHESTRATOR, NOT AN IMPLEMENTER.**

| Action | YOU Do | DELEGATE |
|--------|--------|----------|
| Read files for context | ✓ | |
| Track progress (TODO) | ✓ | |
| Spawn parallel agents | ✓ | |
| **ANY code change** | ✗ NEVER | executor-low/executor |
| **UI work** | ✗ NEVER | designer-low/designer |
| **Docs** | ✗ NEVER | writer |

**Path Exception**: Only write to `.omc/`, `.claude/`, `CLAUDE.md`, `AGENTS.md`

## Background Execution Rules

**Run in Background** (set `run_in_background: true`):
- Package installation: npm install, pip install, cargo build
- Build processes: npm run build, make, tsc
- Test suites: npm test, pytest, cargo test
- Docker operations: docker build, docker pull

**Run Blocking** (foreground):
- Quick status checks: git status, ls, pwd
- File reads (NOT edits - delegate edits to executor-low)
- Simple commands

## Verification Checklist

Before stopping, verify:
- [ ] TODO LIST: Zero pending/in_progress tasks
- [ ] FUNCTIONALITY: All requested features work
- [ ] TESTS: All tests pass (if applicable)
- [ ] ERRORS: Zero unaddressed errors

**If ANY checkbox is unchecked, CONTINUE WORKING.**

## Token Savings Tips

1. **Batch similar tasks** to one agent instead of spawning many
2. **Use explore (haiku)** for file discovery, not architect
3. **Prefer executor-low** for simple changes - only upgrade if it fails
4. **Avoid opus agents** unless the task genuinely requires deep reasoning
5. **Use writer (haiku)** for all documentation tasks

## STATE CLEANUP ON COMPLETION

**IMPORTANT: Delete state files on completion - do NOT just set `active: false`**

When ecomode completes (all verification passes):

```bash
# Delete ecomode state files
rm -f .omc/state/ecomode-state.json
rm -f ~/.claude/ecomode-state.json
```

This ensures clean state for future sessions. Stale state files with `active: false` should not be left behind.

Overview

This skill activates a token-efficient parallel execution mode that prioritizes lower-tier Haiku and Sonnet agents to reduce cost while preserving outcome quality. It orchestrates parallel work, background operations, and strict delegation rules so you can run multi-agent tasks with minimal token usage and predictable behavior. Ecomode enforces persistence until all verification checks pass and cleans up state after completion.

How this skill works

Ecomode routes tasks to preferred low-tier agents (Haiku) and only escalates to Sonnet or Opus when complexity demands it. It spawns agents in parallel for independent work, uses run_in_background for long-running operations, never performs direct code edits (delegates those to executor agents), and verifies completion with a checklist before ending. The skill also deletes local state files to avoid stale sessions.

When to use it

  • When cost or token efficiency is a primary concern for multi-agent orchestration
  • For large codebase lookups, file discovery, and batch tasks where simple agents suffice
  • When you need reliable background execution for installs, builds, or test suites
  • When you want strict delegation: orchestrator handles coordination, agents perform edits
  • Before launching broad parallel work that can be batched to reduce repeated prompts

Best practices

  • Default to Haiku agents; escalate to Sonnet only if low-tier attempts fail or task is complex
  • Always pass the explicit model parameter for each Task to avoid unexpected defaults
  • Batch similar operations into a single agent instead of spawning many small tasks
  • Use run_in_background: true for heavy installs, builds, or test runs and run blocking for quick checks
  • Delegate all code changes, UI work, and documentation to appropriate agents; orchestrator should not write code

Example use cases

  • Search and discovery: use explorer (haiku) to find function definitions across a repo
  • Standard feature work: try executor-low for implementation, escalate to executor (sonnet) if needed
  • CI operations: run npm install and npm test in background agents to minimize token overhead
  • Refactoring or complex debugging: route to Sonnet for deeper analysis, reserve Opus only for planning/critique
  • Documentation batches: use writer (haiku) to generate or update docs across multiple files

FAQ

Can ecomode perform code edits directly?

No. Ecomode enforces delegation: it orchestrates and spawns executor agents to make code changes. The orchestrator reads files and tracks progress but does not write code outside allowed state paths.

When should I allow Opus-tier agents?

Only for explicit planning or high-level critique tasks that require deep reasoning. Default behavior is to avoid Opus and prefer Haiku or Sonnet to save tokens.