<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Steer the Work |</title><link>https://haobin-tan.netlify.app/doc/claude/claude-code-in-action/00-steer-the-work/</link><atom:link href="https://haobin-tan.netlify.app/doc/claude/claude-code-in-action/00-steer-the-work/index.xml" rel="self" type="application/rss+xml"/><description>Steer the Work</description><generator>HugoBlox Kit (https://hugoblox.com)</generator><language>en</language><lastBuildDate>Sat, 03 Oct 2026 00:00:00 +0000</lastBuildDate><image><url>https://haobin-tan.netlify.app/media/icon_hu_eee4a95885829ab2.png</url><title>Steer the Work</title><link>https://haobin-tan.netlify.app/doc/claude/claude-code-in-action/00-steer-the-work/</link></image><item><title>Steering Long Sessions</title><link>https://haobin-tan.netlify.app/doc/claude/claude-code-in-action/00-steer-the-work/steering_long_sessions/</link><pubDate>Sat, 03 Oct 2026 00:00:00 +0000</pubDate><guid>https://haobin-tan.netlify.app/doc/claude/claude-code-in-action/00-steer-the-work/steering_long_sessions/</guid><description>&lt;p&gt;A handful of habits for handling long Claude Code sessions without babysitting every step of it:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Scope&lt;/strong&gt; you work first, then&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Steer&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Direct your &lt;strong&gt;compact&lt;/strong&gt;ion so the summary keeps what matters.&lt;/li&gt;
&lt;li&gt;Use the &lt;strong&gt;rewind&lt;/strong&gt; menu to course correct when Claude drifts.&lt;/li&gt;
&lt;li&gt;Set a &lt;strong&gt;goal&lt;/strong&gt; when you can describe &amp;ldquo;done&amp;rdquo; better than you can describe the steps.&lt;/li&gt;
&lt;li&gt;Use &lt;strong&gt;loop&lt;/strong&gt; for waiting on something outside the session.&lt;/li&gt;
&lt;li&gt;Run parallel work in &lt;strong&gt;worktrees&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="scope-the-work-first-with-plan-mode"&gt;Scope the Work First with Plan Mode&lt;/h2&gt;
&lt;p&gt;Before Claude writes a single line, get it to lay out a plan. In &lt;strong&gt;plan&lt;/strong&gt; mode, Claude does its research in read-only mode. It reads the code, figures out what needs to change, and hands you a plan to review.&lt;/p&gt;
&lt;p&gt;When you get that plan, actually &lt;strong&gt;read it. Don&amp;rsquo;t skim it.&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The more thorough the plan, the fewer surprises you&amp;rsquo;ll hit once Claude starts executing.&lt;/li&gt;
&lt;li&gt;If something&amp;rsquo;s off or missing, just ask Claude to add it where you want.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Iterating on a plan is much faster than letting Claude run and hoping for the best, then cleaning up the mess!&lt;/strong&gt;&lt;/p&gt;
&lt;h2 id="steer-while-claude-works"&gt;Steer While Claude Works&lt;/h2&gt;
&lt;p&gt;Once Claude is running, you have a few ways to keep it pointed in the right direction.&lt;/p&gt;
&lt;h3 id="compact"&gt;Compact&lt;/h3&gt;
&lt;p&gt;Compact summarizes your conversation, uses that summary as the new context, and deletes the old messages.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;This frees up your context window so Claude can keep going.&lt;/li&gt;
&lt;li&gt;Risk: Something important may get dropped in the summary, and Claude drifts off course.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Don&amp;rsquo;t just run &lt;code&gt;/compact&lt;/code&gt; on its own. Add instructions after the command to tell Claude how to summarize.&lt;/strong&gt; Anything you write after the command shapes what the summary keeps. That&amp;rsquo;s your steering wheel for context.&lt;/p&gt;
&lt;!-- text: required trigger text; content is inserted from clipboard --&gt;
&lt;details class="spoiler " id="spoiler-0"&gt;
&lt;summary class="cursor-pointer"&gt;Example&lt;/summary&gt;
&lt;div class="rounded-lg bg-neutral-50 dark:bg-neutral-800 p-2"&gt;
&lt;p&gt;For example, if you finished debugging a while back and now you only care about some API changes, say so:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/compact Focus on the --version flag implementation
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/details&gt;
&lt;!-- text: required trigger text; content is inserted from clipboard --&gt;
&lt;details class="spoiler " id="spoiler-1"&gt;
&lt;summary class="cursor-pointer"&gt;Python Analogy&lt;/summary&gt;
&lt;div class="rounded-lg bg-neutral-50 dark:bg-neutral-800 p-2"&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# context window filling up&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;messages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;setup&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;debugging&lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;api_work&lt;/span&gt;&lt;span class="o"&gt;...&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# bare /compact: the summarizer decides what matters&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;messages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;summarize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# directed /compact: you pass a parameter&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;messages&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;summarize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;messages&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;focus&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;--version flag implementation&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/details&gt;
&lt;h3 id="rewind"&gt;Rewind&lt;/h3&gt;
&lt;p&gt;When Claude heads down the wrong path, you don&amp;rsquo;t have to prompt your way back out.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Rewind&lt;/strong&gt; takes you to your last checkpoint. (Every user prompt creates a checkpoint you can revert to. )&lt;/p&gt;
&lt;p&gt;To open the menu, &lt;strong&gt;double tap escape on an empty prompt&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;From the rewind menu you get a few options:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Restore code and conversation&lt;/strong&gt;: Roll back both together.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Restore conversation&lt;/strong&gt;: Roll back just the chat.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Restore code&lt;/strong&gt;: Roll back just the files.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Summarize from here&lt;/strong&gt;: Summarizes everything &lt;em&gt;after&lt;/em&gt; the checkpoint. Great if you had a side conversation and just want to free up some space.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Summarize up to here&lt;/strong&gt;: Summarizes everything &lt;em&gt;before&lt;/em&gt; the checkpoint. Great when you had a long setup phase you want to compress, but you want to keep the implementation parts intact.&lt;/li&gt;
&lt;/ul&gt;
&lt;details class="spoiler " id="spoiler-2"&gt;
&lt;summary class="cursor-pointer"&gt;Python Analogy&lt;/summary&gt;
&lt;div class="rounded-lg bg-neutral-50 dark:bg-neutral-800 p-2"&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="n"&gt;checkpoints&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;on_user_prompt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;checkpoints&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;copy&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;deepcopy&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;conversation&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="p"&gt;)))&lt;/span&gt; &lt;span class="c1"&gt;# one per prompt&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="o"&gt;...&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;rewind&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;restore&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;both&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;conv&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;checkpoints&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;restore&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;both&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;conversation&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="n"&gt;conversation&lt;/span&gt;&lt;span class="p"&gt;[:]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;conv&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;restore&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;both&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;code&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt; &lt;span class="n"&gt;files&lt;/span&gt;&lt;span class="p"&gt;[:]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;code&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/details&gt;
&lt;h3 id="let-claude-run-more-autonomously"&gt;Let Claude run more autonomously&lt;/h3&gt;
&lt;h4 id="goal"&gt;Goal&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Goal&lt;/strong&gt; sets a completion condition. You describe what &amp;ldquo;done&amp;rdquo; looks like, and Claude keeps working across turns until a fast evaluator confirms those conditions are met. It won&amp;rsquo;t just stop the first time it thinks it&amp;rsquo;s finished.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;/goal all tests in src/billing pass, and the &lt;span class="nb"&gt;type&lt;/span&gt; checker reports zero errors
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;To cancel it, run &lt;code&gt;/goal clear&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;One important constraint: &lt;strong&gt;the evaluator only reads the transcript&lt;/strong&gt;. So your condition has to be &lt;strong&gt;checkable&lt;/strong&gt; from the output Claude actually produces, like the results of a test run.s&lt;/p&gt;
&lt;h4 id="loop"&gt;Loop&lt;/h4&gt;
&lt;p&gt;&lt;strong&gt;Loop&lt;/strong&gt; runs a prompt on an interval between turns, either fixed or self-paced.&lt;/p&gt;
&lt;p&gt;Use it to pull something external, like a CI run or a deploy, and act when the state changes.&lt;/p&gt;
&lt;p&gt;To stop a loop, just press escape.&lt;/p&gt;
&lt;!-- text: required trigger text; content is inserted from clipboard --&gt;
&lt;details class="spoiler " id="spoiler-3"&gt;
&lt;summary class="cursor-pointer"&gt;Example: Check model training log every 10 minutes.&lt;/summary&gt;
&lt;div class="rounded-lg bg-neutral-50 dark:bg-neutral-800 p-2"&gt;
&lt;figure &gt;
&lt;div class="flex justify-center "&gt;
&lt;div class="w-full" &gt;&lt;img src="https://raw.githubusercontent.com/EckoTan0804/upic-repo/master/uPic/%E6%88%AA%E5%B1%8F2026-10-06%2017.06.54.png" alt="/loop example" loading="lazy" data-zoomable /&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/figure&gt;
&lt;/div&gt;
&lt;/details&gt;
&lt;!-- text: required trigger text; content is inserted from clipboard --&gt;
&lt;details class="spoiler " id="spoiler-4"&gt;
&lt;summary class="cursor-pointer"&gt;Python analogy&lt;/summary&gt;
&lt;div class="rounded-lg bg-neutral-50 dark:bg-neutral-800 p-2"&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;while&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="c1"&gt;# Esc stops it&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;log&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;logs/train.log&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;report&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;claude&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;log&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# your prompt, run between your turns&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;needs_attention&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;notify_you&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;report&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;time&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;sleep&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;interval&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# fixed (&amp;#34;10m&amp;#34;) or chosen by Claude&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/details&gt;
&lt;h4 id="run-parallel-work-with-worktrees"&gt;Run parallel work with worktrees&lt;/h4&gt;
&lt;p&gt;When you&amp;rsquo;re running multiple agents on the same codebase, it could happen that two Claude sessions fighting over the same files leads to conflicts - that&amp;rsquo;s unsafe!&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s where &lt;strong&gt;worktrees&lt;/strong&gt; come in: Instead of sessions stepping on each other, each one gets its own independent file tree.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Because each agent has its own tree, they can&amp;rsquo;t clobber each other&amp;rsquo;s changes.&lt;/li&gt;
&lt;li&gt;When a session exits, a clean worktree is automatically removed.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;A &lt;strong&gt;&lt;code&gt;.worktreeinclude&lt;/code&gt;&lt;/strong&gt; file at the repo root lists git-ignored files to copy into each worktree. This is useful for things like an environment variable file or a local config that you need in every worktree but don&amp;rsquo;t want to commit to version control.&lt;/p&gt;</description></item></channel></rss>