evgeniy-mikhailove/rlm-claude-code-os/session-context-mastery

Claude Code and agent skill by evgeniy-mikhailove/rlm-claude-code-os

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

Master context window management for long Claude Code sessions. Use when starting complex multi-hour tasks, when sessions approach context limits, or when output quality degrades mid-session. Covers context budgeting, rewind strategy, compaction, subagent handoffs, and CLAUDE.md progressive disclosure. From Boris Cherny (Claude Code creator) and Thariq (Anthropic).

Install

npx vskill@latest install evgeniy-mikhailove/rlm-claude-code-os/session-context-mastery

SKILL.md

The same SKILL.md was published earlier as evgeniy-mikhailove/rlm-claude-code-os/session-context-mastery.

Session Context Mastery

Prevent context rot. Manage the 200k window deliberately.

Context Budget Zones

ZoneFill %StateAction
Green0–30%Full capabilityNone
Yellow30–50%Slight degradation beginsMonitor
Orange / Dumb Zone50–70%Noticeable quality lossCompact or delegate
Red70%+High context rot riskRewind or clear

Rule: Compact or rewind before hitting 50% on complex tasks.

Three Strategies

1. Rewind (Precision Tool)

When: A tool call went wrong or context got polluted with bad output.

Ctrl+Z / /rewind
  • Rewind to the point before the failed attempt
  • Never try to fix a bad outcome on top of polluted context
  • Before rewinding: ask subagent to "summarize findings from this section" first
2. Compact (Mid-Task Compression)

When: Context is filling but task isn't done yet.

/compact
  • Lossy — appropriate for mid-task, non-critical context
  • Claude summarizes what's happened, preserves goal state
  • Best for: long research sessions, iterative debugging
3. Clear (Fresh Start)

When: Task is complete, or you need a fully clean slate.

/clear
  • Complete reset — use only between major tasks
  • Write key findings to files BEFORE clearing

Subagent Handoff Protocol

Delegate intermediate work instead of filling main context:

  1. Give subagent only the specific task + only relevant files
  2. Subagent works in isolation (fresh 200k context)
  3. Subagent returns ONLY the conclusion — not the reasoning trail
  4. You integrate the conclusion (small) not the process (large)

Keeps main context at 30-40% even for complex multi-step tasks.

CLAUDE.md Progressive Disclosure

Split large CLAUDE.md into modular rule files:

.claude/
CLAUDE.md # Entry point — short, links others
rules/
security.md # Load only for security tasks
n8n-patterns.md # Load only for n8n work
api-contracts.md # Load only for API work

Reference with glob: @.claude/rules/security.md loads only when needed.

Target: <2,000 lines of focused context per task.

compact vs clear — Decision

SituationUse
Mid-task, continuing the same goal/compact
Task complete, switching topics/clear
Last output was wrong/polluted/rewind
About to start fresh project/clear

Warning Signs of Context Rot

  • AI starts repeating itself or looping
  • Suggestions contradict earlier decisions in the same session
  • Code quality noticeably drops without explanation
  • AI "forgets" conventions established earlier in the session

Act immediately: compact, rewind, or delegate to subagent.

Session Start Checklist

  • [ ] Clear context from previous session (unless explicitly continuing)
  • [ ] Load ONLY files relevant to this specific task
  • [ ] Set explicit goal for this session in first message
  • [ ] For multi-session projects: load STATE artifacts (see gsd-workflow skill)

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/evgeniy-mikhailove/rlm-claude-code-os/session-context-mastery/badge)](https://verified-skill.com/skills/evgeniy-mikhailove/rlm-claude-code-os/session-context-mastery)

Something wrong with this skill or its page? Tell us.