Get startedGet started for free

Video: Steering Long Sessions

1. Video: Steering Long Sessions

You can prompt Claude and watch it finish a quick task, but running a long one is much harder. Refactoring across a dozen files or implementing a new feature can take hours, and if you aren't steering Claude in the right direction, it can potentially take longer. But there are many ways to help Claude during these long sessions. There are two important habits. The first is to scope the work before Claude starts. So if you use plan mode, Claude will do the research in read-only mode and hand you a plan. If the plan has been provided, actually read through it. The more thorough the plan, the less likely that you're going to have hiccups when Claude executes. And when it comes to revising the plan, just ask Claude to add it where you want. It's much faster to iterate over a plan than it is to simply hope for the best. The second habit is to steer Claude in the right direction. And here are some ways that you can do that. Compact summarizes your conversation and uses that as a new context while deleting the old, freeing up your context window. However, there is a risk that something important will be removed, causing Claude to drift in the wrong direction. So when you do the compact command, add in the changes you want. And adding instructions after the command tells Claude how to summarize. So if you were done debugging a while ago but want to just focus on those API changes, well here you can do that. When Claude goes down the wrong path, you don't have to prompt your way out of it. Rewind brings you to the last checkpoint. To open it, double tap escape on an empty prompt and you'll get the rewind menu. Every user prompt creates a checkpoint that you can revert back to with different options. One, you can restore the code, conversation, or both. Two, summarize from here will summarize everything after the checkpoint. Great if you had a side conversation and just want to free up some space. And summarize up to here will summarize everything before the checkpoint. So this is great if you want to summarize a long setup phase, but keep the implementation parts. When we talk about steering, we assume that you are hands-on. If you want something a little bit more autonomous, there is the goal and loop. Goal sets a completion condition. You describe what done looks like and Claude keeps working across turns until a fast evaluator confirms that those conditions have been met. Instead of just stopping for the first time, it thinks it's finished. So for example, I could do /goal, all tests in source billing, pass, and the type checker report zero errors. Doing /goal clear will cancel it. And one constraint here is that the evaluator only reads the transcript, so the condition has to be checkable from the output that Claude produces, like the test results that it ran. Loop runs a prompt on an interval between turns, fixed or self-paced. Use it to pull something external like a CI run or a deploy and act when the state changes. You can press escape to stop it. So our steering metaphor assumes one steering wheel in one car. But when we're working with multiple agents on the same code base, we don't want to have two steering wheels in one car. Well, that's just unsafe. This is where work trees come in. It prevents two or more Claude sessions from fighting over files in a repository. This prevents conflicts by having three independent file trees. On exit, a clean work tree is auto removed. A dot work tree include file at the repo root lists gitignored files to copy into each work tree, which is useful for a environment variable file or a local configuration that you need, but don't want to commit into the version control. When it comes to handling long Claude Code sessions, scope your work first and then steer. Direct your compaction so the summary keeps what matters. Use the rewind menu to course correct. Set a goal when you can describe done better than you can describe the steps and run parallel work and work trees. Do that and you can trust a long run without babysitting it.

2. Let's practice!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.