
session-continuity
Persistent task workflow with state machine. Every message MUST announce state. Uses .claude/ files
by jagreehal|Open Source
Session Continuity
Critical rules
- State lives in project
.claude/files (tasks.md,requirements.md,session.md), not conversation memory. - EVERY message must start with the current state prefix.
- Never re-derive progress by investigating the codebase — read
session.md. - Never auto-advance tasks; never commit for the user; never use TodoWrite.
- VERIFY before COMPLETE; mark
[x]only after user yes in AWAITING_COMMIT. - Before operating or setting up, read references/state-machine.md and references/setup-and-antipatterns.md.
Workflow
- On "continue": enter
CHECK_STATUS— read onlysession.md, route by Status. WORKING: implement current task only; updatesession.mdat triggers.VERIFY: run all requirements verification commands; show output; fail → WORKING.COMPLETE→ CHECK_STATUS →AWAITING_COMMIT(ask permission, STOP).- On yes:
MARK_COMPLETEthen CHECK_STATUS for next task. - On "create a plan" / "setup tasks": create the three files per setup reference.
Resources
- references/state-machine.md — states, transitions, file roles. Read every session.
- references/setup-and-antipatterns.md — file templates, anti-patterns, path fixes. Read on setup or resume failures.
Validation
- Every message has state prefix
- Three
.claude/files exist at project root - CHECK_STATUS only reads session.md
- VERIFY ran all commands with verbatim output
- No
[x]without user approval; no TodoWrite; no agent commits
Constraints
- Not for single self-contained one-session changes.
- Related:
implementation-planning,verification-before-completion,tdd-workflow,investigation-modes,create-tasks.