Get the FREE Ultimate OpenClaw Setup Guide →

Budget Zones

Scanned
npx machina-cli add skill silvesterdivas/context-engineer/budget-zones --openclaw
Files (1)
SKILL.md
2.7 KB

Context Budget Zones

Apply these budget zones to manage context consumption throughout the conversation.

Zone Definitions

GREEN Zone (< 60% context used)

  • Behavior: Work normally. Full creative freedom.
  • Read entire files when helpful
  • Explore the codebase broadly
  • Include full code blocks in responses
  • Use multiple tool calls freely
  • Plan ambitious multi-step operations

YELLOW Zone (60-75% context used)

  • Behavior: Be selective. Start economizing.
  • Prefer Grep with targeted patterns over Read for large files
  • Summarize file contents instead of quoting them fully
  • Batch related operations together
  • Avoid re-reading files already in context
  • Delegate exploration to the investigator agent (Haiku) when possible

ORANGE Zone (75-85% context used)

  • Behavior: Conserve aggressively. Focus on completing the current task.
  • Only read specific line ranges, never full files
  • Use Grep exclusively for finding information
  • Give concise responses — skip explanations unless asked
  • Do NOT start new exploratory tasks
  • Delegate any research to subagents
  • Consider creating fresh context files (TASK.md + PROGRESS.md)

RED Zone (> 85% context used)

  • Behavior: Wrap up immediately. Prepare for handoff.
  • Stop all exploratory work
  • Complete only the immediately active task
  • Create TASK.md and PROGRESS.md with current state
  • Suggest the user start a new conversation
  • If code changes are in progress, commit or save the current state

How to Estimate the Zone

There is no direct token counter, but use these heuristics:

  • Message count: 20+ back-and-forth exchanges → likely YELLOW
  • File reads: 10+ files read → likely YELLOW; 20+ → likely ORANGE
  • Code output: Multiple large code blocks generated → adds up fast
  • Tool calls: 30+ tool calls → likely YELLOW; 50+ → likely ORANGE
  • System compression: If earlier context appears compressed → the context is in ORANGE/RED

Key Principles

  1. Front-load research. Do exploration and reading early (GREEN zone) so context is available when needed later.
  2. Summarize throughout. After reading a file, mentally note the key parts — avoid re-reading it.
  3. Delegate to save context. The investigator agent (Haiku) is cheap and fast. Use it for broad searches.
  4. Fresh context is not failure. Creating TASK.md + PROGRESS.md and starting fresh is a feature, not a workaround.

Source

git clone https://github.com/silvesterdivas/context-engineer/blob/main/skills/budget-zones/SKILL.mdView on GitHub

Overview

Budget Zones manages how much context a conversation consumes by applying four zones (GREEN, YELLOW, ORANGE, RED). It guides when to read, grep, summarize, delegate, or wrap up to control token use and plan work scope.

How This Skill Works

The skill uses zone-based rules: GREEN allows full exploration; YELLOW tightens focus and favors grep and summaries; ORANGE conserves aggressively and limits to current task; RED wraps up and prepares for handoff. It also leverages the investigator agent (Haiku) for broad searches and fresh context files (TASK.md + PROGRESS.md) when needed.

When to Use It

  • When the context window is filling up or you’re managing tokens (budget zones, context budget, or token management questions).
  • When deciding whether to read a large file or use grep with targeted patterns.
  • When planning work scope or decomposing tasks under context pressure.
  • When the user explicitly asks about budget zones, context budget, or token management.
  • When the conversation is getting long and you need to stabilize exploration and hand off tasks.

Quick Start

  1. Step 1: Assess current context usage against GREEN/YELLOW/ORANGE/RED definitions.
  2. Step 2: Apply the zone rules to reading, summarizing, or delegating tasks.
  3. Step 3: Deliver concise results and, if needed, create TASK.md + PROGRESS.md for handoff.

Best Practices

  • Front-load research in GREEN to establish context early, before it’s needed later.
  • Summarize file contents after reading and avoid re-reading large sections.
  • Delegate broad searches to the investigator agent (Haiku) to save context.
  • Create fresh context files (TASK.md + PROGRESS.md) when starting a new context or refactor.
  • In ORANGE/RED, deliver concise results and avoid starting new exploratory tasks.

Example Use Cases

  • Decide between reading a large log file or grepping for a pattern to save tokens.
  • Shift from GREEN to YELLOW as the file set grows, summarizing findings instead of quoting.
  • Plan a multi-step operation in GREEN, then condense steps as you approach context limits.
  • Delegate broad searches to Haiku when context growth threatens recall.
  • Finish a long thread by generating TASK.md and PROGRESS.md for handoff.

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers