Validates that what the prior session claimed it left behind actually matches what the current session observes
Compares a prior handoffโs FILE_STATE claims against the current SESSION_GROUND_TRUTH captured during CWK-001, producing a STATE_DRIFT_REPORT with severity ratings for any divergences.
Cross-Session Consistency Validator
TL;DR
How To Start
STEP 1Provide Prior Handoff State and Current Ground Truth
-
prior_handoff_id
· string · required
ID of the prior handoff being validated (e.g., “H018”). Used in the STATE_DRIFT_REPORT summary and audit trail. -
prior_file_state
· dict · required
FILE_STATE claims from the prior handoff. Expected keys: git_branch, git_HEAD, uncommitted_changes, cowork_cookbook_recipes, lessons_learned_count, file_list (optional). Missing keys are skipped. -
current_ground_truth
· dict · required
SESSION_GROUND_TRUTH dict captured by CWK-001 Step 4b. Contains actual observed state from live tool observations: git_branch, git_HEAD, uncommitted_changes, cookbook_recipe_count, ll_count, workspace_files. -
report_mode
· string · optional · default: auto
Report mode: “auto” (report only if divergences), “full” (always report), “silent” (log but don’t report to user). Silent mode stores the STATE_DRIFT_REPORT in session context without user-visible output.
Usage Examples
How AI Reads This Recipe
- EXTRACT PRIOR HANDOFF STATE CLAIMS. Parse the prior handoff’s FILE_STATE section for 6 key fields: git_branch, git_HEAD, uncommitted_changes, cookbook_recipe_count, ll_count, file_list. These are assertions the prior session made about the state it left behind — they may be accurate or hallucinated.
- EXTRACT CURRENT OBSERVED STATE. Map the same 6 fields from the SESSION_GROUND_TRUTH captured by CWK-001 Step 4b. This is the source of truth — it was captured from live tool observations.
- COMPARE STATE FIELD BY FIELD. Run 6 checks: (A) git branch exact match — mismatch is HIGH. (B) git HEAD ancestry — if HEAD advanced normally, LOW; if diverged entirely, HIGH. (C) uncommitted changes status flip — MEDIUM either direction. (D) cookbook recipe count — LOW. (E) LL count — LOW. (F) file presence/absence — HIGH if critical files missing (cookbooks, chat history), MEDIUM otherwise; new files are LOW.
- GENERATE STATE_DRIFT_REPORT. Aggregate divergences into a report with prior_handoff ID, total_checks, divergence count, severity flags, per-divergence detail, summary, and recommendation (CONSISTENT, ACCEPTABLE, or INVESTIGATE).
- REPORT RESULTS. If report_mode is “auto,” only report when divergences exist. If “full,” always report. If “silent,” store without displaying. HIGH severity triggers a Warning notification. MEDIUM/LOW triggers a Note. Clean state triggers a confirmation Note.
When to Use This Recipe
- Are starting a new session and want to verify the prior handoff’s claims about project state before beginning work.
- Suspect external changes occurred between sessions — commits, reverts, or file edits made outside of Cowork.
- Want to detect hallucinated handoff state — claims the prior session made that do not match observed reality.
- Need an audit trail of cross-session state consistency for debugging drift issues over multiple sessions.
Recipe FAQ
Q.What fields does the consistency check cover?
Q.What severity levels exist?
Q.What are the three recommendations?
Q.What if the prior handoff has no FILE_STATE section?
Q.Does this recipe modify anything?
Q.How does report_mode “silent” work?
Version History
Get this recipe with CRAFT for Claude Cowork
Cowork recipes ship bundled with CRAFT for Claude Cowork — there’s no separate download. Clone the framework once, and your AI runs every recipe automatically when invoked.
Pull anytime to stay on the latest version — free to clone, no login or email required.
Then start your session
Once CRAFT is in your project folder, open a new Cowork session and ask Claude to initialize. For example:
You
Claude
Not familiar with Git? Download as a ZIP
No command line needed. Just download, move, and unzip:
- Open the CRAFT framework repo on GitHub.
- Click the green Code button, then choose Download ZIP.
- Move the downloaded ZIP into your Claude Cowork project folder.
- Unzip it: double-click on Mac, or right-click → Extract All on Windows.
