RCP-CWK-025 Cross-Session Consistency Validator

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

Tags: Introduced in Beta, QA, Consistency, Drift, Handoff, Validation, State, Cross-Session, Cowork

TL;DR

What It Does
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.
How It Works
The recipe extracts state claims from the prior handoff — git branch, HEAD commit, uncommitted changes, cookbook recipe count, Lessons Learned count, and file list. It then extracts the same fields from the current session’s ground truth (captured by CWK-001 Step 4b using live tool observations). Six field-by-field comparisons run in sequence: (A) git branch match, (B) git HEAD ancestry check, (C) uncommitted changes status, (D) cookbook recipe count, (E) Lessons Learned count, and (F) file presence/absence. Each divergence is classified as HIGH, MEDIUM, or LOW severity. The results feed into a STATE_DRIFT_REPORT with one of three recommendations: CONSISTENT (no divergences), ACCEPTABLE (minor drift), or INVESTIGATE (high-severity issues requiring resolution before session work begins).
What To Expect
A STATE_DRIFT_REPORT containing the total number of checks run, any divergences found with their severity and detail, and a recommendation. High-severity divergences trigger a Warning notification before work proceeds. Minor divergences get a Note. No divergences produce a clean confirmation.
Best Results When You
Ensure the prior handoff includes a FILE_STATE section with specific, verifiable claims. The more fields the handoff populates (especially git_HEAD and file_list), the more thorough the consistency check. Run this immediately after CWK-001 ground truth capture — before any session work modifies state.
Typical Time
Under 30 seconds. The comparison is field-by-field against already-captured data. The only potentially slow operation is the git log ancestry check in Check B, which is fast for small repositories.
Difficulty
Intermediate — the recipe itself is automatic, but interpreting divergences requires understanding of git state, handoff conventions, and what constitutes expected versus unexpected drift between sessions.

How To Start

This recipe is called by CWK-001 (Step 4d) during session initialization. It can also be invoked manually when you want to spot-check handoff accuracy.

STEP 1Provide Prior Handoff State and Current Ground Truth

Supply the prior handoff ID, its FILE_STATE claims, the current SESSION_GROUND_TRUTH, and optionally the report mode.
Available parameters
  • 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.
Invocations
Standard (called by CWK-001)
#H->AI::Directive: (Validate cross-session consistency with prior_handoff_id=“H018”, prior_file_state={…}, current_ground_truth={…})
Full Report Mode
#H->AI::Directive: (Validate cross-session consistency with prior_handoff_id=“H018”, prior_file_state={…}, current_ground_truth={…}, report_mode=“full”)
Manual Spot-Check
#H->AI::Directive: (Validate cross-session consistency with prior_handoff_id=“H103”, prior_file_state={“git_branch”: “main”, “git_HEAD”: “abc1234”}, current_ground_truth={“git_branch”: “main”, “git_HEAD”: “def5678”})

Usage Examples

Three scenarios — clean consistency, mixed-severity divergences, and silent mode for automated pipelines.
Example 1 · Clean consistency check
CWK-001: Passes H045 state claims and current ground truth to CWK-025 at Step 4d.
Cat: Cross-Session Consistency Check: All state claims from H045 match current observations. Git branch: main (match). HEAD: abc1234 (match). Uncommitted changes: none (match). Cookbook recipes: 128 (match). LL count: 56 (match). Recommendation: CONSISTENT.
Example 2 · Divergences detected with mixed severity
CWK-001: Passes H092 state claims. Prior handoff claimed git_HEAD = “f8e2a1b”, uncommitted changes present, 54 LL entries.
Cat: Cross-Session Consistency Check: 3 divergence(s) from H092. HIGH severity in: git_HEAD. [HIGH] git_HEAD: expected f8e2a1b, actual c3d9f02 — HEAD diverged, prior commit not in current history. [MEDIUM] uncommitted_changes: expected uncommitted changes present, actual clean working tree — someone committed or reverted. [LOW] ll_count: expected 54, actual 56 — may reflect new entries between sessions. Recommendation: INVESTIGATE.
Example 3 · Silent mode for batch pipelines
CWK-001: Calls CWK-025 with report_mode=“silent” during a batch session where drift is expected.
Cat: (No user-visible output.) STATE_DRIFT_REPORT stored in session context. 1 LOW divergence (LL count +2). Recommendation: ACCEPTABLE. Downstream recipes can query SESSION_DRIFT_REPORT if needed.

How AI Reads This Recipe

When this recipe is triggered, the AI processes state consistency through a systematic 5-step pipeline. The AI should:
  1. 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.
  2. 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.
  3. 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.
  4. 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).
  5. 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.
This recipe depends on CWK-001 for ground truth capture and is called at CWK-001 Step 4d. It does not modify any state — it is purely diagnostic. The SESSION_DRIFT_REPORT is stored in session context for downstream reference. R-11 (QA Enhancement, Phase D) added file_list comparison with severity-aware classification. R-12 audit trail is recorded.

When to Use This Recipe

Use this recipe when you:
  • 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.
Do not use this recipe when:
You are mid-session and want to verify claims about current state. CWK-024 (Verification Gate Sub-Routine) is more appropriate for claim-level verification within a session. CWK-025 specifically targets the cross-session boundary — comparing what a prior session said versus what the current session observes.

Recipe FAQ

Q.What fields does the consistency check cover?

Six fields: git branch, git HEAD commit, uncommitted changes status, cookbook recipe count, Lessons Learned count, and file list (presence/absence). Each maps to a verifiable, tool-observable state claim.

Q.What severity levels exist?

Three: HIGH (investigate before proceeding — branch mismatch, HEAD diverged, critical files missing), MEDIUM (notable but potentially expected — uncommitted changes flipped, non-critical files missing), LOW (minor drift — HEAD advanced, counts differ, new files appeared).

Q.What are the three recommendations?

CONSISTENT: zero divergences, all claims match. ACCEPTABLE: divergences exist but all are LOW or MEDIUM severity — likely normal drift. INVESTIGATE: at least one HIGH-severity divergence that should be resolved before session work begins.

Q.What if the prior handoff has no FILE_STATE section?

The recipe still runs but produces fewer checks. Any field with a None prior claim is skipped. The report notes which checks were skippable due to missing prior data.

Q.Does this recipe modify anything?

No. CWK-025 is purely diagnostic. It reads state, compares, and reports. No files are created, modified, or deleted. The only side effect is storing the STATE_DRIFT_REPORT in session context.

Q.How does report_mode “silent” work?

The STATE_DRIFT_REPORT is generated and stored in session context but no user-visible output is produced. Downstream recipes can query SESSION_DRIFT_REPORT for the results. Useful for batch pipelines where drift is expected and should not interrupt flow.

Version History

Changes to this recipe over time. Most recent first.
v1.01a 2026-03-15
R-11 (QA Enhancement, Phase D). Added file_list comparison (Check F) with severity-aware classification — critical files (cookbooks, chat history) get HIGH severity on absence; other files get MEDIUM. New files are always LOW. Added workspace_files field to current_ground_truth extraction. Updated STATE_DRIFT_REPORT to include total_checks field. Full folder path support for 7-folder project structure.

v1.00a 2026-02-28
Initial release. Cross-session state comparison with 5 field checks (git_branch, git_HEAD, uncommitted_changes, cookbook_recipe_count, ll_count). Three recommendations (CONSISTENT, ACCEPTABLE, INVESTIGATE). Three report modes (auto, full, silent). Called by CWK-001 Step 4d. Depends on CWK-001 ground truth capture.

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

Please initialize my CRAFT session.

Claude

CRAFT session ready. Your project is loaded, your persona is active, and your recipes are available. What would you like to work on?

What is CRAFT for Claude Cowork?

Not familiar with Git? Download as a ZIP

No command line needed. Just download, move, and unzip:

  1. Open the CRAFT framework repo on GitHub.
  2. Click the green Code button, then choose Download ZIP.
  3. Move the downloaded ZIP into your Claude Cowork project folder.
  4. Unzip it: double-click on Mac, or right-click → Extract All on Windows.

Similar Posts