Workflow

Context Management

Keep context focused to preserve output quality.

Overview

Long conversations accumulate context that can degrade Claude's performance. As threads grow, responses become slower, less accurate, and sometimes contradictory. Managing context deliberately—keeping conversations focused, resetting when needed, and storing progress externally—maintains response quality throughout your session. Think of it like keeping your workspace organized instead of letting clutter pile up.

When to use

Use this workflow when conversations exceed 20-30 exchanges, switching between unrelated tasks, noticing degraded response quality, or working on multi-day projects that need persistent state.

Step-by-step process

1

Keep one task per thread

Start a new conversation for each distinct task. Don't mix refactoring, bug fixing, and feature work in a single thread—context switching confuses the model.

"Instead of: 'Fix the login bug, then refactor authentication, then add OAuth' — Start 3 separate threads: 1) Bug Fix: Login validation error, 2) Refactor: Auth module cleanup, 3) Feature: OAuth integration. Each stays focused."
2

Store progress in scratch files

When working on multi-step tasks, save intermediate results to files. This externalizes state so you can reset context without losing progress.

"After completing phase 1, write the plan to PROGRESS.md: '✅ Phase 1: Database schema updated ⏳ Phase 2: API endpoints (next) ⏳ Phase 3: Frontend integration'. If I reset context, I can reload from this file."
3

Reset the session when drift starts

When you notice repetitive responses, contradictions, or declining quality, start fresh. Copy critical context to a new thread rather than continuing a degraded session.

"This thread has 40 messages and responses are getting worse. Starting a new thread with: 'Continuing work on user authentication. Context: Database schema is ready (see schema.sql), working on API endpoints. Here's what's done and what's next...'"
4

Use explicit context boundaries

Signal major transitions within a thread. When changing topics, explicitly tell Claude you're moving to something new.

"That login bug is fixed and deployed. NEW TOPIC: Now I want to work on improving the search feature. This is separate from the authentication work we just finished."

Example prompts

Detecting context degradation

"I've noticed your recent responses are repeating previous suggestions and missing details we already discussed. Let's reset. Here's where we are: [summary of current state]. Let's continue from here with a fresh context."

Structured multi-day work

"I'm working on a large refactoring over several days. Create a PROGRESS.md file tracking: completed modules, current module, remaining modules, known issues. Update this after each module so I can resume work tomorrow in a new thread."

Context handoff between threads

"Our conversation hit 50 messages. Starting fresh. Previous context: We built a payment system with Stripe integration (see src/payments/*), added webhooks for payment events, tested happy path. Now: need to add refund functionality."

Preventing context pollution

"Before we start this new feature, I want to clarify: previous discussions about the authentication system are not relevant here. We're working on a completely separate analytics module. Please don't reference auth patterns in your responses."

Expected outputs

Cleaner context

Focused conversations without accumulated irrelevant history, making it easier for Claude to produce accurate responses

Higher response quality

Maintained accuracy and relevance throughout long projects by preventing context degradation

Less confusion

Reduced contradictions and repetitions that occur when Claude tries to reconcile too much conflicting context

Persistent progress

External state storage ensures work isn't lost when resetting context, enabling multi-day projects

Best practices

Start new threads for new tasks—don't chain unrelated work in a single conversation
Monitor thread length; consider resetting after 20-30 substantial exchanges
Document progress in files, not just conversation history—files persist across context resets
When resetting, provide a concise summary of critical context, not a full history dump
Use descriptive thread titles to make finding previous conversations easier

Common pitfalls

Continuing degraded conversations too long

Solution: When you notice quality decline, reset immediately. Don't try to 'fix' a degraded context—start fresh with a summary.

Not preserving important context when resetting

Solution: Before resetting, save critical details to files: current state, decisions made, what's working, what's next. Reference these in the new thread.

Mixing multiple tasks in one thread

Solution: One thread = one task. If you need to work on something unrelated, start a new conversation. You can always return to previous threads.

Pro tips

Create explicit checkpoints

""Every 10 exchanges or after completing a phase, ask: 'Summarize where we are, what's working, and next steps' — Save this summary. It becomes your resume point.""

Use thread naming conventions

""Name threads descriptively: '[Feature] OAuth Integration - Phase 2' or '[Bug] Login validation error' — Makes context retrieval easier when reviewing past work.""

Set context budgets upfront

""Start complex tasks with: 'This is a multi-step project. After each phase, I'll create a summary in PROGRESS.md. Remind me to do this after completing each step.'""

Related workflows