Checkpointing
A harness can save the state of the work outside the model. After an interruption, it loads that checkpoint and continues. For example, a support agent can resume its reply with the order lookup result that it already has.
4 min read4 মিনিটে পড়া যায় · 5 sections5টি সেকশন · 6 sources6টি সোর্স · updated Nov 2026আপডেট: Nov 2026
Save, break, rewindসেভ, ভাঙা, রিওয়াইন্ড
Save checkpoints before each prompt, then rewind a bad edit but not a database change.প্রতিটা prompt-এর আগে checkpoint সেভ করুন, তারপর একটা খারাপ এডিট rewind করুন, কিন্তু ডেটাবেসের বদল নয়।
You’ll learnআপনি শিখবেন
- When Claude Code saves a checkpointClaude Code কখন checkpoint সেভ করে✓
- How many checkpoints it keepsকয়টা checkpoint সে রাখে
- What /rewind restores/rewind কী ফিরিয়ে আনে
- Why a Bash-only file is not restoredBash-এর ফাইল কেন ফেরে না
- Why a database change staysডেটাবেসের বদল কেন থেকে যায়
Why a harness saves state
The Messages API is stateless Source 6সোর্স 6, so the model does not keep state. If the process stops, the work in the loop is lost, unless the harness saved it. A saved state is a checkpoint.
Support agent checks the order
│ save
▼
Checkpoint: order delivered
│ interruption ... restart and load
▼
Agent resumes → reply readyThe LangGraph docs give the reasons: persistence matters when an agent needs to continue a conversation, resume after an interruption, recover from a failure, or remember information across interactions Source 5সোর্স 5. Checkpoints also let a person look at the state at any time, which human-in-the-loop work needs Source 4সোর্স 4.
Two kinds of checkpoint are common:
- A checkpoint of the files that the agent changed, so you can undo the changes. Claude Code does this Source 1সোর্স 1.
- A checkpoint of the run state, so the run can continue later. LangGraph does this Source 4সোর্স 4.
সহজ English
The model does not save anything Source 6সোর্স 6. If the program stops, the work is lost, unless the harness saved it first. A saved state is a checkpoint.
Persistence in LangGraph helps an agent to continue a chat, to restart after a stop, to recover from a failure, and to remember things between chats Source 5সোর্স 5. Checkpoints cover one thread; a separate store keeps long-term memory Source 5সোর্স 5. It also lets a person look at the work at any time Source 4সোর্স 4.
There are two common kinds. One saves the files that the agent changed, so you can undo them. Claude Code does this Source 1সোর্স 1. The other saves the state of the run, so the run can continue later. LangGraph does this Source 4সোর্স 4.
বাংলা ব্যাখ্যা
মডেল নিজে কিছু সেভ করে না Source 6সোর্স 6। প্রোগ্রাম বন্ধ হয়ে গেলে কাজ হারিয়ে যায়, যদি না harness আগে সেটা সেভ করে রাখে। সেভ করা এই অবস্থাকে বলে checkpoint।
checkpoint একটা এজেন্টকে চ্যাট চালিয়ে যেতে, থেমে যাওয়ার পর আবার শুরু করতে, ফেইলিওর থেকে ফিরে আসতে আর এক চ্যাট থেকে আরেক চ্যাটে কিছু মনে রাখতে সাহায্য করে Source 5সোর্স 5। checkpoint শুধু একটা thread-এর জন্য; দীর্ঘমেয়াদি মেমরি রাখে আলাদা একটা store Source 5সোর্স 5। এতে একজন মানুষ যেকোনো সময় কাজের অবস্থা দেখতে পারে Source 4সোর্স 4।
সাধারণত দুই ধরনের checkpoint হয়। একটা এজেন্টের বদলানো ফাইল সেভ করে, যাতে বদলগুলো undo করা যায়। Claude Code এটা করে Source 1সোর্স 1। আরেকটা রানের অবস্থা সেভ করে, যাতে রানটা পরে আবার চলতে পারে। LangGraph এটা করে Source 4সোর্স 4।
Checkpoints in Claude Code
Claude Code captures the state of your code before each prompt that starts a turn Source 1সোর্স 1. Before Claude edits a file, it snapshots the current contents Source 2সোর্স 2. It keeps file snapshots for the 100 most recent checkpoints of a session Source 1সোর্স 1.
Run /rewind, or press Esc two times when the prompt input is empty, to open the rewind menu Source 1সোর্স 1. You can restore the code and the conversation, only the conversation, or only the code Source 1সোর্স 1. The checkpoints are saved with the conversation, so /rewind works also after you resume a session with claude --continue or claude --resume Source 1সোর্স 1 Source 2সোর্স 2.
What a checkpoint does not undo
A file that only Bash commands changed is not tracked Source 1সোর্স 1. Actions on remote systems (databases, APIs, deployments) cannot be checkpointed Source 2সোর্স 2. Changes outside Claude Code are normally not captured Source 1সোর্স 1. Edits made by most subagents, and symlinked or hard-linked files, are not restored Source 1সোর্স 1. Checkpoints are for quick recovery in a session. Keep using Git for permanent history Source 1সোর্স 1.
সহজ English
Claude Code saves the state of your code before each prompt that starts a turn Source 1সোর্স 1. Before Claude changes a file, it saves a copy of the file Source 2সোর্স 2.
To go back, run /rewind, or press Esc two times in an empty prompt Source 1সোর্স 1. You can go back with the code and the chat, only the chat, or only the code Source 1সোর্স 1. This works also after you reopen an old session Source 1সোর্স 1.
What a checkpoint does not undo
A file that only a Bash command changed is not saved Source 1সোর্স 1. A change to a database, an API, or a deployment cannot be undone Source 2সোর্স 2. Edits made by most subagents, and symlinked or hard-linked files, are not restored Source 1সোর্স 1. Keep using Git for real history Source 1সোর্স 1.
বাংলা ব্যাখ্যা
যে prompt একটা নতুন turn শুরু করে, তার আগে Claude Code আপনার কোডের অবস্থা সেভ করে Source 1সোর্স 1। Claude কোনো ফাইল বদলানোর আগে ফাইলটার একটা কপি সেভ করে Source 2সোর্স 2।
আগের অবস্থায় ফিরতে /rewind চালান, অথবা খালি prompt-এ দুবার Esc চাপুন Source 1সোর্স 1। আপনি কোড আর চ্যাট দুটোই, শুধু চ্যাট, অথবা শুধু কোড ফিরিয়ে আনতে পারেন Source 1সোর্স 1। claude --continue বা claude --resume দিয়ে পুরোনো সেশন খুললেও এটা কাজ করে Source 1সোর্স 1 Source 2সোর্স 2।
checkpoint যা undo করে না
যে ফাইল শুধু একটা Bash কমান্ড বদলেছে, সেটা সেভ হয় না Source 1সোর্স 1। ডেটাবেস, API বা deployment-এ করা বদল undo করা যায় না Source 2সোর্স 2। বেশিরভাগ subagent-এর করা এডিট এবং symlink বা hard link করা ফাইল ফিরিয়ে আনা হয় না Source 1সোর্স 1। আসল হিস্টোরির জন্য Git ব্যবহার করতে থাকুন Source 1সোর্স 1।
Checkpoints in an SDK
The Claude Agent SDK tracks file changes when you set enable_file_checkpointing=True (Python) or enableFileCheckpointing: true (TypeScript) Source 3সোর্স 3. To go back, call rewind_files() or rewindFiles() with the checkpoint UUID Source 3সোর্স 3. To receive the checkpoint UUIDs in the stream, also set extra_args={"replay-user-messages": None} (Python) or extraArgs: { 'replay-user-messages': null } (TypeScript) Source 3সোর্স 3. File rewinding restores the files on disk. It does not rewind the conversation Source 3সোর্স 3.
LangGraph saves the run state. A checkpointer saves a snapshot of the graph state at each super-step, organized into threads Source 4সোর্স 4. When you invoke a graph with a checkpointer, you must give a thread_id in the configurable part of the config Source 4সোর্স 4:
config = {"configurable": {"thread_id": "order-A-1001"}}
graph.invoke({"messages": [{"role": "user", "content": "Where is my order?"}]}, config)If a node fails at a super-step, you can restart the graph from the last successful step Source 4সোর্স 4. Checkpointers also allow "time travel": replay earlier runs to review or debug one step Source 4সোর্স 4.
সহজ English
The Claude Agent SDK can save file changes if you turn on file checkpointing Source 3সোর্স 3. Later it can put the files back as they were. It does not change the chat back Source 3সোর্স 3.
LangGraph saves the state of the whole run after each step Source 4সোর্স 4. Each conversation is a thread with its own thread_id, and its saved states are kept under it Source 4সোর্স 4.
If a step fails, the run can start again from the last step that worked Source 4সোর্স 4. You can also replay an old run to see what happened at one step Source 4সোর্স 4.
বাংলা ব্যাখ্যা
file checkpointing চালু করলে (enable_file_checkpointing=True) Claude Agent SDK ফাইলের বদলগুলো সেভ করে Source 3সোর্স 3। পরে rewind_files() দিয়ে ফাইলগুলো আগের অবস্থায় ফেরানো যায়। এতে চ্যাট আগের অবস্থায় ফেরে না Source 3সোর্স 3। stream-এ checkpoint UUID পেতে extra_args={"replay-user-messages": None} (Python) বা extraArgs: { 'replay-user-messages': null } (TypeScript)-ও সেট করুন Source 3সোর্স 3।
LangGraph প্রতিটা ধাপের (super-step) পরে পুরো রানের অবস্থা সেভ করে Source 4সোর্স 4। প্রতিটা কথোপকথন একটা thread, যার নিজের একটা thread_id থাকে, আর তার সেভ করা অবস্থাগুলো সেই thread_id-এর নিচে রাখা হয় Source 4সোর্স 4।
কোনো ধাপ ফেল করলে রানটা শেষ সফল ধাপ থেকে আবার শুরু হতে পারে Source 4সোর্স 4। কোনো এক ধাপে কী হয়েছিল দেখতে পুরোনো রান আবার চালানোও যায় Source 4সোর্স 4।
What a tester can check
Tutorial advice
Test the recovery, not only the save:
- Kill and resume: stop the agent after the order lookup and before the reply. On resume, the agent must use the saved result and must not repeat a side effect, such as a second refund.
- Rewind: rewind after an edit. Check every file that the agent changed, also the files that a shell command changed.
- Wrong thread: resume with the
thread_idof another customer. The agent must not show their data. - Remote effects: a rewind does not undo an email or a database write. Check that the harness asks before such actions.
সহজ English
Tutorial advice
Test the restart, not only the save:
- Stop the agent after the order lookup. When it starts again, it uses the saved result and does not do a side effect two times, such as a second refund.
- Go back after an edit, and check every file that the agent changed.
- Restart with the
thread_idof another customer. The agent must not show their data. - Going back does not undo an email or a database change. Check that the agent asks first.
বাংলা ব্যাখ্যা
Tutorial advice
শুধু সেভ না, আবার শুরু হওয়াটাও টেস্ট করুন:
- order lookup-এর পরে এজেন্টকে থামান। আবার শুরু হলে সে সেভ করা ফলাফল ব্যবহার করে, আর কোনো কাজ দুবার করে না, যেমন দ্বিতীয়বার refund।
- একটা এডিটের পরে rewind করুন, আর এজেন্টের বদলানো প্রতিটা ফাইল চেক করুন।
- অন্য কাস্টমারের
thread_idদিয়ে আবার শুরু করুন। এজেন্ট যেন তার ডেটা না দেখায়। - rewind একটা ইমেইল বা ডেটাবেসের বদল undo করে না। দেখুন এজেন্ট আগে অনুমতি চায় কি না।
Key words
| Term | Meaning |
|---|---|
| Checkpoint | A saved state of the work, outside the model |
| Rewind | Go back to a checkpoint |
/rewind | The Claude Code command that opens the rewind menu |
| File checkpointing | The Agent SDK option that tracks file changes for a rewind |
| Checkpointer | The LangGraph part that saves the graph state at each super-step |
thread_id | The LangGraph key of a thread. The checkpoints of a sequence of runs (for example one conversation) are saved under it. |
| Time travel | Replay an earlier run to review or debug a step |