AI Session Handoff — Shift Change for Working Sessions
End a working session like a shift change, not an abandonment: state captured, decisions logged, next step named — ready for the next session to pick up.
Day three of a multi-day code change, chat nearly full: hand off the merged work, the chosen approach, the dangerous cache risk, and the cron audit still pending.
Multi-day coding efforts carry the most intricate session state: which units are merged, which approach won (and which broke the report builder), which invariant is dangerous to miss. This setup loads a tenant-isolation marathon in Forensic fidelity — the RLS-over-rewrite decision with its reason, the analytics-replica exception as a constraint, the cross-tenant cache risk flagged as the dangerous one, the unverified-cron-paths assumption, and the audit task that must precede the cache work. The forensic rules make the next session quote this state, not reconstruct it.
Carry approach plus reason
"RLS, because rewriting broke the report builder" — the why prevents relitigating the how.
Flag the dangerous risk by name
Cross-tenant cache leakage travels marked as the one to fear.
Sequence the pending work
The cron audit before the cache change — order survives the handoff.
The HANDOFF INSTRUCTIONS at Fidelity: Forensic tell the next session to accept everything as established context, preserve the KEY DECISIONS without silently reversing them, and quote this package rather than reconstruct from memory. So the RLS-over-query-rewriting choice travels with its reason (rewrite broke the report builder), and a fresh chat continues instead of relitigating the how.
The RISKS section flags that the cache keyspace change could silently serve cross-tenant data if a key format is missed — labeled that's the dangerous one — so the highest-cost invariant stays visible. The PENDING TASKS TODO then sequences audit the cron entry points before touching the cache, preserving the plan's order across the handoff, not just the task list.
It carries session state — CURRENT STATE, KEY DECISIONS, CONSTRAINTS, RISKS, and the RECOMMENDED NEXT STEP — not the code itself. notFor is explicit: sending the source files is the Long Prompt Splitter's codebase mode, and executing the refactor safely is the Refactor Prompt Builder's contract. The NOTE also reminds you items were extracted VERBATIM, so review and adjust before sending.
End a working session like a shift change, not an abandonment: state captured, decisions logged, next step named — ready for the next session to pick up.
When the window fills, don't retype the project from memory. A handoff package carries the decisions, constraints, and pending work into the new session as its first message.
Done work tells stories; open work needs carrying. The package separates completed from pending and resumes from the first open task.
Token budget planning for real workloads: how much of the window a transcript actually consumes, what is left for the answer, and how much headroom remains.
The "message too long" error has a structural fix: split at paragraph boundaries into sequenced chunks with wait rules, instead of pasting fragments and hoping.
What a converged conversation contains: a rejected voice, an accepted framing, a hard constraint, a format decision, and a final-version moment — each mapped to its prompt section.
Continue work in a new chat without losing context — decisions, constraints, and tasks extracted into a state package.
Get up to speed on an unfamiliar codebase in an afternoon — ground the AI in the project, have it explain the hard parts, and keep what you learn.