<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Long Tasks on KnightLi Blog</title>
        <link>https://knightli.com/en/tags/long-tasks/</link>
        <description>Recent content in Long Tasks on KnightLi Blog</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en</language>
        <lastBuildDate>Fri, 10 Jul 2026 11:39:57 +0800</lastBuildDate><atom:link href="https://knightli.com/en/tags/long-tasks/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>How to Resume an Interrupted Long-Running AI Agent Task: Checkpoints, Context Rebuild, and Recovery Workflow</title>
        <link>https://knightli.com/en/2026/07/10/ai-agent-long-task-resume-guide/</link>
        <pubDate>Fri, 10 Jul 2026 11:39:57 +0800</pubDate>
        
        <guid>https://knightli.com/en/2026/07/10/ai-agent-long-task-resume-guide/</guid>
        <description>&lt;p&gt;When an AI Agent runs a long task, the painful part is often not the failure itself. It is the moment after the interruption: the terminal is gone, the context window has been reset, the model only remembers half of the plan, and you are no longer sure which files were changed.&lt;/p&gt;
&lt;p&gt;The practical answer is not to hope the Agent never breaks. It is to design the task so it can be resumed.&lt;/p&gt;
&lt;p&gt;This article focuses on a very concrete question: when an AI Agent is interrupted during a long task, how do you recover it without starting from scratch?&lt;/p&gt;
&lt;h2 id=&#34;quick-answer&#34;&gt;Quick Answer
&lt;/h2&gt;&lt;p&gt;To make long AI Agent tasks recoverable, keep three things visible throughout the run: a task goal, a checkpoint list, and a current workspace state. After interruption, first inspect &lt;code&gt;git status&lt;/code&gt;, changed files, logs, and generated artifacts; then rebuild the task context from the latest checkpoint; finally ask the Agent to continue only from the unfinished items.&lt;/p&gt;
&lt;p&gt;In one sentence: do not let the Agent rely only on chat memory. Let the repository and checkpoint notes become the memory.&lt;/p&gt;
&lt;h2 id=&#34;why-long-agent-tasks-are-easy-to-break&#34;&gt;Why Long Agent Tasks Are Easy to Break
&lt;/h2&gt;&lt;p&gt;Long-running Agent tasks usually fail for a few common reasons:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the model context becomes too long;&lt;/li&gt;
&lt;li&gt;a command times out or the terminal session disappears;&lt;/li&gt;
&lt;li&gt;the user opens a new conversation without enough background;&lt;/li&gt;
&lt;li&gt;the Agent forgets which files it already touched;&lt;/li&gt;
&lt;li&gt;generated files and source files are mixed together;&lt;/li&gt;
&lt;li&gt;tests fail midway and the next step is unclear.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The risk increases when the task includes writing content, editing code, running tests, generating translations, or touching multiple directories.&lt;/p&gt;
&lt;p&gt;For example, after building a reusable workflow with &lt;a class=&#34;link&#34; href=&#34;https://knightli.com/en/2026/07/10/codex-skills-custom-workflow-guide/&#34; &gt;Codex Skills&lt;/a&gt;, you may ask the Agent to process many posts in sequence. If it stops halfway, you need a clear way to know which posts are finished and which ones are still pending.&lt;/p&gt;
&lt;h2 id=&#34;the-minimum-recovery-structure&#34;&gt;The Minimum Recovery Structure
&lt;/h2&gt;&lt;p&gt;A resumable Agent task needs a small but explicit structure.&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;15
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;16
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Goal:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- What exactly should be finished?
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Scope:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- Which directories or files may be changed?
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Progress:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- Done
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- In progress
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- Pending
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Verification:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- Which commands or checks prove the work is usable?
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Recovery note:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- If interrupted, where should the next Agent continue?
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;This does not need to be a large project document. A short checklist in the chat, a temporary Markdown file, or a task-specific &lt;code&gt;SKILL.md&lt;/code&gt; is enough.&lt;/p&gt;
&lt;p&gt;The key is that the state must be reconstructable outside the model&amp;rsquo;s memory.&lt;/p&gt;
&lt;h2 id=&#34;step-1-inspect-the-workspace-first&#34;&gt;Step 1: Inspect the Workspace First
&lt;/h2&gt;&lt;p&gt;After an interruption, resist the urge to immediately say &amp;ldquo;continue.&amp;rdquo; First inspect the repository.&lt;/p&gt;
&lt;p&gt;Useful commands:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git status --short
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git diff --stat
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;git diff -- path/to/file
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;For generated content, also list the target directories:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;ls content/post/2026/07/38
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;For code tasks, check recent test output, build artifacts, and any files the Agent mentioned before the interruption.&lt;/p&gt;
&lt;p&gt;The goal of this step is simple: separate completed work from half-written work.&lt;/p&gt;
&lt;h2 id=&#34;step-2-rebuild-a-compact-context&#34;&gt;Step 2: Rebuild a Compact Context
&lt;/h2&gt;&lt;p&gt;When starting a new Agent session, give it a compact recovery prompt instead of pasting the entire old conversation.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;15
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;16
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;17
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;18
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;19
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;20
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;21
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Continue the interrupted task.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Goal:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- Translate posts 36, 37, and 38 into en, zh-tw, ja, and es.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Already completed:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- 36: all target files created.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- 37: all target files created.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Still pending:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- 38: create index.en.md, index.zh-tw.md, index.ja.md, index.es.md.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Rules:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- Preserve source date and slug.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- Skip existing target files.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- Do not commit.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Verification:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- Check target files exist.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- Check date/slug match source.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- Check front matter and code fences are valid.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;This kind of prompt gives the Agent enough state to continue without re-litigating the whole task.&lt;/p&gt;
&lt;h2 id=&#34;step-3-continue-from-the-next-small-unit&#34;&gt;Step 3: Continue From the Next Small Unit
&lt;/h2&gt;&lt;p&gt;Do not restart the entire long task unless you have to. Resume from the next small unit.&lt;/p&gt;
&lt;p&gt;Good units include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;one article;&lt;/li&gt;
&lt;li&gt;one translation language;&lt;/li&gt;
&lt;li&gt;one test file;&lt;/li&gt;
&lt;li&gt;one module;&lt;/li&gt;
&lt;li&gt;one batch of generated assets;&lt;/li&gt;
&lt;li&gt;one command plus its verification.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For AI coding tasks, this is especially important. If you also use hooks to run tests automatically, as in &lt;a class=&#34;link&#34; href=&#34;https://knightli.com/en/2026/07/10/claude-code-hooks-auto-run-tests/&#34; &gt;Claude Code hooks automatic test runs&lt;/a&gt;, keep the recovery unit small enough that a failing test points to a clear file or behavior.&lt;/p&gt;
&lt;h2 id=&#34;step-4-ask-the-agent-to-verify-before-moving-on&#34;&gt;Step 4: Ask the Agent to Verify Before Moving On
&lt;/h2&gt;&lt;p&gt;The safest resume pattern is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Inspect current state, finish only the pending part, then verify before doing anything else.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;For content tasks, verification may include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;file existence;&lt;/li&gt;
&lt;li&gt;front matter fields;&lt;/li&gt;
&lt;li&gt;slug/date consistency;&lt;/li&gt;
&lt;li&gt;internal link syntax;&lt;/li&gt;
&lt;li&gt;Markdown code fences;&lt;/li&gt;
&lt;li&gt;no obvious encoding damage.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For code tasks, verification may include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;targeted unit tests;&lt;/li&gt;
&lt;li&gt;type check;&lt;/li&gt;
&lt;li&gt;lint;&lt;/li&gt;
&lt;li&gt;a narrow build;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;git diff&lt;/code&gt; review.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The Agent should not treat &amp;ldquo;file exists&amp;rdquo; as the same as &amp;ldquo;task completed.&amp;rdquo;&lt;/p&gt;
&lt;h2 id=&#34;what-to-save-before-starting-a-long-task&#34;&gt;What to Save Before Starting a Long Task
&lt;/h2&gt;&lt;p&gt;Before a long Agent task begins, it helps to save:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the exact goal;&lt;/li&gt;
&lt;li&gt;the allowed paths;&lt;/li&gt;
&lt;li&gt;the forbidden paths;&lt;/li&gt;
&lt;li&gt;the batch order;&lt;/li&gt;
&lt;li&gt;the verification command;&lt;/li&gt;
&lt;li&gt;the rollback or recovery rule.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt;1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;5
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Process posts 36, 37, 38 in that order.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Only create missing target language files.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Do not edit existing translated files.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;After each post, verify date and slug.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;If interrupted, continue from the first post with missing targets.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;This single paragraph can save a surprising amount of cleanup later.&lt;/p&gt;
&lt;h2 id=&#34;how-to-handle-context-window-pressure&#34;&gt;How to Handle Context Window Pressure
&lt;/h2&gt;&lt;p&gt;Long tasks often fail because the prompt becomes too large. The solution is to compress context aggressively.&lt;/p&gt;
&lt;p&gt;Keep:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;current objective;&lt;/li&gt;
&lt;li&gt;changed file list;&lt;/li&gt;
&lt;li&gt;decisions already made;&lt;/li&gt;
&lt;li&gt;pending items;&lt;/li&gt;
&lt;li&gt;verification results.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Drop:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;repeated discussion;&lt;/li&gt;
&lt;li&gt;old failed attempts after the fix is known;&lt;/li&gt;
&lt;li&gt;verbose command output;&lt;/li&gt;
&lt;li&gt;unrelated file content;&lt;/li&gt;
&lt;li&gt;speculative plans that were not used.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If token usage itself becomes a problem, the same idea applies to debugging. Keep only the facts needed for the next action. I discussed a related symptom in &lt;a class=&#34;link&#34; href=&#34;https://knightli.com/en/2026/07/08/claude-code-token-usage-spike-troubleshooting-faq/&#34; &gt;Claude Code token spike troubleshooting&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;when-to-use-a-skill-or-workflow-file&#34;&gt;When to Use a Skill or Workflow File
&lt;/h2&gt;&lt;p&gt;If the same recovery pattern appears again and again, turn it into a workflow.&lt;/p&gt;
&lt;p&gt;A reusable workflow can define:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;how to discover source files;&lt;/li&gt;
&lt;li&gt;how to decide what is already done;&lt;/li&gt;
&lt;li&gt;what must be skipped;&lt;/li&gt;
&lt;li&gt;how to preserve metadata;&lt;/li&gt;
&lt;li&gt;how to verify the result;&lt;/li&gt;
&lt;li&gt;what the final report should include.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is where a local skill becomes useful. Instead of relying on a long prompt every time, you encode the recovery rules once and reuse them.&lt;/p&gt;
&lt;p&gt;For cross-tool handoff, the idea is similar. If Codex starts the task and Claude Code finishes it, or the other way around, use an explicit checkpoint. I covered this direction in &lt;a class=&#34;link&#34; href=&#34;https://knightli.com/en/2026/07/06/codex-plugin-cc-claude-code-codex-plugin/&#34; &gt;Codex and Claude Code task handoff&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id=&#34;a-practical-resume-prompt-template&#34;&gt;A Practical Resume Prompt Template
&lt;/h2&gt;&lt;p&gt;You can reuse this template:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;div class=&#34;chroma&#34;&gt;
&lt;table class=&#34;lntable&#34;&gt;&lt;tr&gt;&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code&gt;&lt;span class=&#34;lnt&#34;&gt; 1
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 2
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 3
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 4
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 5
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 6
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 7
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 8
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt; 9
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;10
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;11
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;12
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;13
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;14
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;15
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;16
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;17
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;18
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;19
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;20
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;21
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;22
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;23
&lt;/span&gt;&lt;span class=&#34;lnt&#34;&gt;24
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;
&lt;td class=&#34;lntd&#34;&gt;
&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;This is a resumed AI Agent task.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Objective:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- ...
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Source of truth:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- Repository files and git status are more reliable than prior chat memory.
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Allowed changes:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- ...
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Already done:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- ...
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Pending:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- ...
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Rules:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- ...
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Verification:
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;- ...
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;Please inspect the current workspace first, continue only the pending items, and report exactly what changed.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;The most important line is the source-of-truth rule. It prevents the Agent from confidently following stale memory when the workspace says something else.&lt;/p&gt;
&lt;h2 id=&#34;common-mistakes&#34;&gt;Common Mistakes
&lt;/h2&gt;&lt;p&gt;The most common recovery mistakes are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;saying only &amp;ldquo;continue&amp;rdquo; without state;&lt;/li&gt;
&lt;li&gt;asking the Agent to redo everything;&lt;/li&gt;
&lt;li&gt;ignoring &lt;code&gt;git status&lt;/code&gt;;&lt;/li&gt;
&lt;li&gt;mixing generated files with source edits;&lt;/li&gt;
&lt;li&gt;skipping verification because the task &amp;ldquo;looks done&amp;rdquo;;&lt;/li&gt;
&lt;li&gt;letting the Agent edit unrelated files while recovering context.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Recovery is not just about continuing. It is about narrowing the task until continuing is safe.&lt;/p&gt;
&lt;h2 id=&#34;conclusion&#34;&gt;Conclusion
&lt;/h2&gt;&lt;p&gt;An interrupted AI Agent task is not automatically a failed task. It becomes a failed task only when there is no external state to recover from.&lt;/p&gt;
&lt;p&gt;For long tasks, keep a goal, a checkpoint list, and a verification rule. After interruption, inspect the workspace first, rebuild a compact context, resume from the next small unit, and verify before expanding the scope again.&lt;/p&gt;
&lt;p&gt;Once this becomes a habit, long Agent work feels much less fragile. The Agent can forget, the terminal can close, and the conversation can restart, but the task still has a trail to follow.&lt;/p&gt;
</description>
        </item>
        
    </channel>
</rss>
