Using Claude Code: Session Management & 1M Context
- Source
- x.com
- Publisher
- Thariq Shihipar
- Author
- Thariq
- Date

Context
A long coding conversation can preserve useful discoveries alongside failed approaches and unrelated work. In a session-management guide, Thariq explains two ways to choose what Anthropic's Claude Code carries forward: summarize the existing conversation, or start a fresh with a deliberately written handoff.
asks the model to select and summarize what mattered. A fresh-session handoff lets the user specify the remaining task, constraints, relevant files and rejected approaches. The choice depends on what the next task needs. Thariq's rule of thumb is to start a new session for a new task, while a closely related follow-up, such as documenting a feature that was just built, may justify keeping the existing so files need not be reread.
- Rewind beats correcting. Typing 'that didn't work, try X' leaves the failed attempt sitting in context; double-tapping Esc drops every message after the point you jump to, so you re-prompt from the file reads with what you learned and none of the wreckage.
- Before you rewind, ask Claude to 'summarize from here'. You get a handoff note from the attempt that failed — effectively a message to the next iteration of Claude explaining what was already ruled out.
- Compact and clear trade the same thing in opposite directions. Compact is lossy but free: Claude decides what mattered, and you can steer it ('/compact focus on the auth refactor, drop the test '). Clear costs you writing the brief, and the survivors are your pick.
- The one-session-per-task rule has an exception for genuinely adjacent work. Documenting a feature you just built in a fresh session means Claude re-reads the same files — slower and more expensive than carrying the context over.
- Session — One conversation or piece of work as a harness keeps it: a record of messages, tool calls and observations that can be saved and resumed.
- Compaction — Replacing older content in the model's context with a summary of it, usually keeping recent messages, so that a session can go on.
- Context and context window — Context is the information available for a generation; the context window is the capacity available to hold it.
- Debugging — Following a failure back along the data path to the place where the data first goes wrong.
“Context rot is the observation that model performance degrades as context grows because attention gets spread across more tokens, and older, irrelevant content starts to distract from the current task.”
“If I had to pick one habit that signals good context management, it’s rewind.”
“Our general rule of thumb is when you start a new task, you should also start a new session.”





