I've Used Claude Code for 2,000+ Hours - Here's How I Build Anything With It

Study Guide

The WISC Framework: Context Management for AI Coding Agents

Cole Medin, who has logged over 2,000 hours using Claude Code since before its general availability in May 2025, presents his battle-tested framework for getting reliable results from AI coding assistants. The core insight: roughly 80% of the time a coding agent produces bad output, it is not a model problem. It is a context management problem. The WISC framework (Write, Isolate, Select, Compress) is designed to keep your context window lean while still giving the agent everything it needs.

The Problem: Context Rot

Large language models suffer from the "needle in a haystack" problem. As the context window fills up, the model struggles to retrieve the specific piece of information it needs. Research from the Chroma technical report confirms this: just because tokens fit in the window does not mean you should fill it. "Distractor" content (similar but not identical patterns in a codebase) leads the model to pull wrong information with high confidence. This happens constantly with coding agents on larger codebases where files follow similar patterns.

The central question of the entire framework: How do we keep the context window as lean as possible while still giving the coding agent all of the context it needs?

W - Write: Externalize Agent Memory

1. Git Log as Long-Term Memory

Standardize your commit messages so your agent can read the git log and understand what has been worked on recently. Cole uses a dedicated /commit command that enforces a two-part format: what was built, and how the AI layer (rules/commands) was improved. This avoids over-engineered memory frameworks by leveraging a tool everyone already uses.

2. Separate Planning from Implementation

Always start a new context window for implementation. The workflow is: (1) plan with the agent in one session, producing a structured markdown spec, (2) start a brand-new session and pass only that spec as the initial context. The spec must contain everything the agent needs. Mixing research and implementation in the same session muddies the context window and degrades output quality.

3. Progress Files and Decision Logs

When sessions run long (e.g., extensive end-to-end testing that consumes 200K+ tokens), use a /handoff command to create a structured summary document. A fresh agent session picks up that document and continues the work without carrying hundreds of thousands of tokens of tool calls and prior conversation.

I - Isolate: Use Sub-Agents

1. Research Isolation

Sub-agents can perform tens or hundreds of thousands of tokens of research (across your codebase or the web) and return only a concise summary to the main context. Anthropic's own research shows a 90%+ improvement in outcomes when using sub-agents for research loading versus having the main agent do everything. In Cole's example, two parallel sub-agents did extensive research but the main context only consumed 44,000 tokens (4% of the window).

2. The Scout Pattern

Before committing context to your main session, send a sub-agent to explore documentation or code areas and report back whether that content is relevant. This prevents loading unnecessary context "just in case." For example, a scout sub-agent can scan a docs folder and recommend which documents actually matter for the current task.

S - Select: Load Context Just-in-Time, Not Just-in-Case

Context should be layered, with each layer loaded only when needed:

  • Layer 1: Global Rules - Always-loaded constraints and conventions (architecture, testing strategy, logging). Keep this concise, around 500-700 lines.
  • Layer 2: On-Demand Context - Rules for specific parts of the codebase (frontend rules, API endpoint rules, workflow YAML references). Loaded only when working on that area.
  • Layer 3: Skills - Progressive disclosure of capabilities. The agent sees a short description initially, then loads the full skill.md only when it decides it needs that capability (e.g., browser automation for end-to-end testing).
  • Layer 4: Prime Commands - Dynamic exploration of the live codebase at the start of a session. Different prime commands exist for different areas of the project, giving the agent a fresh understanding of the current state before planning begins.

C - Compress: The Last Resort

Compression should be rare if Write, Isolate, and Select are done well. When it is necessary, two options exist:

  • Handoff - Create a structured summary and start a completely fresh session. Preferred when you have compacted more than twice, indicating the conversation is too bloated to salvage.
  • Slash Compact - Claude Code's built-in summarization. Always provide focused instructions (e.g., "focus on the edge cases we just tested") so the summary retains the most relevant information. After compacting, ask the agent to summarize what it remembers to verify nothing critical was lost.

The best compression strategy is not needing compression at all.

Key Takeaways

  • Context rot is the root cause of most AI coding failures, not model capability.
  • Treat your context window as a precious, engineered resource.
  • Use git logs, structured specs, and handoff documents to externalize memory.
  • Sub-agents dramatically reduce main-context bloat for research tasks.
  • Layer your context: always-on global rules, on-demand docs, progressive skills, and dynamic prime commands.
  • Compress only as a last resort, and always with focused summarization instructions.
YouTube