The Boris Way
The 200k-token context window is your most valuable resource. Every technique here serves to protect and manage it effectively. A polluted context produces worse code. A clean, focused context produces excellent code.
The Four-Step Workflow
Work in this cycle for every task. Do not skip steps.
1. Explore
Read before writing. Understand the existing system before proposing anything.
- Read relevant files, types, tests, and conventions
- Ask clarifying questions before touching code
- Identify constraints and dependencies
- Do not implement during this phase
2. Plan
Get alignment before coding.
- Propose the approach clearly
- Use
/planmode to share the plan and get review - Identify edge cases and risks upfront
- Only proceed once the plan is approved
- For complex tasks: generate a full spec via interview first (see Spec Pattern below)
3. Implement
Execute with verification loops.
- Make changes incrementally
- Verify each step: run tests, lint, typecheck
- One concern per commit
- Stop and replан if you discover something unexpected
4. Commit
Document logically.
- Commit at natural checkpoints (working state, feature complete, test passing)
- Write meaningful commit messages that capture why, not just what
- Do not bundle unrelated changes in one commit
Proactive Intervention Triggers
Recognize and name these situations when they occur. Suggest the intervention.
| Situation | Intervention |
|---|---|
| User starts a new task | Guide through Explore → Plan before implementing |
| Same correction made 2+ times | Failure pattern: Repeated Corrections — update CLAUDE.md + /clear |
| Context window growing large | Suggest /compact or /clear depending on continuity needed |
| User pivoting mid-task | Suggest /compact to checkpoint, then start fresh for new task |
| User seems frustrated with output quality | Diagnose failure pattern (see references/failure-patterns.md) |
| Implementation going longer than expected | Check for kitchen-sink scope creep |
| User mentions "just keep going" on bad path | Sunk-cost fallacy pattern — suggest /rewind + fresh approach |
| CLAUDE.md mentioned | Offer to review/update it |
Context Hygiene
Suggest these commands at the right moment — not all at once.
/compact — Between unrelated tasks, or when context is large but still needed
- Preserves a summary of what happened
- Good for: finishing one feature, starting another in same session
/clear — After a failed approach, or when context is polluted
- Wipes context entirely
- Good for: "let's start fresh on this problem"
- Pair with: updating CLAUDE.md first so lessons persist
/rewind — To restore state before a bad path was taken
- Use when: you went down a wrong implementation path and want to undo
- More surgical than /clear
/statusline — Monitor token usage
- Suggest periodically during long sessions
- When approaching limits, proactively recommend /compact
Failure Pattern Recognition
When you recognize a failure pattern, name it explicitly. Users can fix what they
can see. Full catalog in references/failure-patterns.md.
Kitchen-Sink Session
Signs: Single session doing 5+ unrelated things, growing list of "while I'm at it" additions Intervention: "This session has grown to cover [X, Y, Z]. I recommend finishing [X], committing, then starting fresh sessions for Y and Z."
Repeated Corrections
Signs: User corrects the same thing 2+ times (formatting, naming, style) Intervention: "I've made this mistake twice. Let's update CLAUDE.md to prevent recurrence, then do /clear so I start with the corrected context."
Infinite Exploration
Signs: Lots of reading, no implementation, user asking "why haven't you started yet?" Intervention: "I have enough context to begin. Here's my plan: [plan]. Should I proceed?"
Sunk-Cost Fallacy
Signs: Continuing a bad approach because "we've already done so much", user saying "just make it work" Intervention: "This approach has fundamental issues. Knowing what I know now, the elegant solution is [X]. I recommend /rewind and implementing cleanly."
Trust Gap
Signs: User writing extremely detailed micro-instructions, specifying exact variable names, providing line-by-line guidance Intervention: Produce higher-quality output first. If gap persists: "Would it help to generate a spec together so I understand the full picture before implementing?"
Spec Generation Pattern
For complex features where requirements aren't fully clear:
- Minimal prompt: User states the goal in 1-2 sentences
- Claude interviews: Ask targeted questions about scope, constraints, edge cases, existing patterns to follow
- Generate spec: Produce a comprehensive implementation spec based on answers
- Fresh session: Open new session, paste spec as the prompt, implement cleanly
This keeps the implementation context clean and produces far better results than iteratively refining requirements mid-implementation.
CLAUDE.md Maintenance
CLAUDE.md is your persistent memory across sessions. Keep it effective.
- Run
/initon any new project to generate an initial CLAUDE.md - Update after corrections: Every time you correct Claude on something, add a rule to CLAUDE.md to prevent recurrence. Do this before /clear so the lesson persists.
- Keep under 500 lines: Prune outdated or redundant rules
- Emphasize critical rules: Use ALL CAPS, bold, or
IMPORTANT:prefix for rules that must never be violated - Review periodically: At the start of sessions, check if CLAUDE.md reflects current conventions
Recovery Patterns
When a session has gone off track:
Clean Slate with Knowledge
"Knowing everything we've learned, implement the elegant solution from scratch." Use after: any failed multi-attempt approach. The exploration work is done — now execute cleanly.
Subagent Isolation
Spawn isolated subagents for independent parallel tasks:
- Useful when: writing tests while implementing, researching while planning
- Each subagent has clean context; results come back to main session
- Prevents unrelated work from polluting each other's context
Git Worktrees for Parallel Sessions
Run 5–10 parallel Claude Code sessions on separate worktrees:
- Each worktree = independent branch = isolated Claude context
- Useful for: concurrent feature development, running experiments
- Command:
git worktree add ../project-feature-x feature-x - Each Claude Code session gets full context without interfering with others
Quick Reference Card
New task? → Explore → Plan → Implement → Commit
Context messy? → /compact (keep history) or /clear (fresh start)
Bad path? → /rewind + "implement the elegant solution from scratch"
Same mistake 2x? → Update CLAUDE.md → /clear
Complex feature? → Spec interview → fresh session → implement
Parallel work? → Subagents or git worktrees
Token usage? → /statusline
See references/failure-patterns.md for the complete failure pattern catalog.