Claude Code

Verified against Claude Code · 2026-08-07

Resume a Claude Code task after a compaction or restart without losing decisions

A session-recovery prompt that forces Claude Code to reconstruct exactly where a multi-step task stands from git state and any saved plan, rather than trusting a compacted summary or its own confident-sounding recollection of what already happened.

Claude CodeCursorWindsurf

The prompt

Ready to copy — highlighted parts are example details you can swap.

This session's context was compacted, resumed from a saved transcript, or otherwise interrupted partway through a task. Do not continue as if you remember everything that happened before this point, and do not silently fill gaps with a plausible-sounding guess. Reconstruct the actual current state from ground truth before writing or changing anything else.

ORIGINAL GOAL
Migrate the reports module from the legacy REST client to the new typed API client, file by file, keeping all existing tests green.

WHERE TO LOOK FOR PRIOR STATE
There should be a PLAN.md at the repo root written at the start of this task, or a todo list from earlier in this conversation if it's still visible above.

RECONSTRUCT BEFORE DOING ANYTHING ELSE
1. Run git status and git diff to see exactly what is currently uncommitted. List every added, modified, and deleted file, and summarize what each change does in one line.
2. Run git log --oneline -20 to see what has already been committed toward this goal, if anything, on this branch.
3. Check the location named above for any plan, todo list, or design note written earlier in this task, and read it in full.
4. Compare the current diff and commit history against the original goal: state which parts are done, which are in progress, and which have not been started, citing the specific file or commit that proves each claim.
5. Write one paragraph stating your understanding of exactly where this task stands right now, based only on what steps 1 through 3 actually show, not on inference about what probably happened.

IF SOMETHING DOESN'T ADD UP
If the current diff contains a change you cannot explain from the goal or the plan artifact, stop and name it as unexplained rather than building on top of it or assuming it was intentional. If an earlier decision seems to have been made that isn't written down anywhere you can verify, say plainly that the reasoning is unrecoverable from available evidence and ask, rather than inventing a plausible rationale for it.

ONLY THEN
Propose what happens next, and wait for confirmation before resuming edits.
Customize the highlighted detailsoptional — the prompt above already works

Why this works

Claude Code compacts a long conversation's context automatically as it nears the model's context window limit, and /compact can be triggered manually — in both cases what carries forward into the rest of the session is a generated summary standing in for the original turns, not the turns themselves, and claude --continue or --resume reload a saved transcript that has the same property. A summary is lossy by construction: it reliably keeps the stated goal and the obvious file changes, and just as reliably drops the specific reasoning behind a judgment call, such as why one of two viable approaches was chosen, because that reasoning lived in a sentence of discussion rather than in a diff. This prompt's core mechanic is refusing to trust the compacted summary or the model's own fluent-sounding recollection, and instead re-deriving task state from git status, git diff, and git log — sources that cannot be silently rewritten by a summarization pass, the same principle behind verifying a claim against its primary source rather than trusting someone's paraphrase of it. Explicitly allowing the reasoning is unrecoverable, ask as a valid output is the load-bearing part: a model motivated to appear continuous and competent will otherwise fabricate a plausible justification for a decision it cannot actually verify, and a fabricated rationale that gets built on top of is far more expensive to unwind later than an honest gap flagged immediately after a restart.

What you get back

git status shows 3 modified files (lib/reports/api-client.ts, lib/reports/summary.ts, tests/reports/summary.spec.ts) and one new file (lib/reports/typed-client.ts) not yet committed. git log shows one prior commit, 'migrate reports/filters.ts to typed client,' so filters.ts is done and already merged into this branch's history. PLAN.md at the repo root lists five files to migrate in order: filters.ts, api-client.ts, summary.ts, export.ts, dashboard.ts. Based on git state, filters.ts is complete and committed; api-client.ts and summary.ts have uncommitted in-progress changes; export.ts and dashboard.ts have not been started. Current state: 1 of 5 files fully done, 2 of 5 in progress with uncommitted changes, 2 of 5 not started. One thing doesn't add up — tests/reports/summary.spec.ts has a modification that isn't explained by PLAN.md or the summary.ts diff alone; flagging this rather than assuming it was intentional. Proposed next step: finish summary.ts's migration, resolve what changed in its test file, run the full reports test suite, then commit before starting export.ts. Waiting for confirmation.

Verified against

Claude Code Sonnet 4.6 · 2026-08-07

Changelog

  • 2026-08-07 Initial publish, verified against Claude Code (Sonnet 4.6).

Building this for real?

This is a free starting point. If you'd rather have custom software built and running for your business, that's Scult's day job.

EXPLORE CUSTOM SOFTWARE
All Claude Code prompts

Check your AI visibility

One URL in, a 0–100 score and the exact fixes out.

RUN THE CHECK

Browse all the tools

15 tools across six categories
13 of them never send your data anywhere

Free · No signup · No trial clock

SEE THE DIRECTORY