Claude has a finite context window. This reference defines how to monitor usage and handle approaching limits gracefully. Claude receives system warnings showing token usage: ``` Token usage: 150000/200000; 50000 remaining ``` This information appears in `` tags during the conversation. **Status**: Plenty of room **Action**: Work normally **Status**: Context accumulating **Action**: Mention to user: "Context getting full. Consider wrapping up or creating handoff soon." **No immediate action required.** **Status**: Running low **Action**: 1. Pause at next safe point (complete current atomic operation) 2. Ask user: "Running low on context (~30k tokens remaining). Options: - Create handoff now and resume in fresh session - Push through (risky if complex work remains)" 3. Await user decision **Do not start new large operations.** **Status**: Must stop **Action**: 1. Complete current atomic task (don't leave broken state) 2. **Automatically create handoff** without asking 3. Tell user: "Context limit reached. Created handoff at [location]. Start fresh session to continue." 4. **Stop working** - do not start any new tasks This is non-negotiable. Running out of context mid-task is worse than stopping early. An atomic operation is one that shouldn't be interrupted: **Atomic (finish before stopping)**: - Writing a single file - Running a validation command - Completing a single task from the plan **Not atomic (can pause between)**: - Multiple tasks in sequence - Multi-file changes (can pause between files) - Research + implementation (can pause between) When hitting 10% threshold, finish current atomic operation, then stop. When auto-creating handoff at 10%, include: ```yaml --- phase: [current phase] task: [current task number] total_tasks: [total] status: context_limit_reached last_updated: [timestamp] --- ``` Body must capture: 1. What was just completed 2. What task was in progress (and how far) 3. What remains 4. Any decisions/context from this session Be thorough - the next session starts fresh. Strategies to extend context life: **Don't re-read files unnecessarily** - Read once, remember content - Don't cat the same file multiple times **Summarize rather than quote** - "The schema has 5 models including User and Session" - Not: [paste entire schema] **Use targeted reads** - Read specific functions, not entire files - Use grep to find relevant sections **Clear completed work from "memory"** - Once a task is done, don't keep referencing it - Move forward, don't re-explain **Avoid verbose output** - Concise responses - Don't repeat user's question back - Don't over-explain obvious things Watch for user signals that suggest context concern: - "Let's wrap up" - "Save my place" - "I need to step away" - "Pack it up" - "Create a handoff" - "Running low on context?" Any of these → trigger handoff workflow immediately. When user returns in fresh session: 1. They invoke skill 2. Context scan finds handoff 3. Resume workflow activates 4. Load handoff, present summary 5. Delete handoff after confirmation 6. Continue from saved state The fresh session has full context available again.