session-state
Update an existing active project's root SESSION_STATE.md and its AGENTS.md continuity section after meaningful work or before handoff. Record current focus, active SPEC/task, status, completed/in-pro
Files1
View on GitHubSKILL.mdskills/session-state/SKILL.md
GitHubSession State
SESSION_STATE.md answers: where did we stop? This skill updates existing
project-control documents. project-init owns template-based creation of
SESSION_STATE.md and AGENTS.md; when either required document is missing,
report that handoff instead of creating a new file shape. When this skill is
invoked to update state, complete the file updates before reporting the result.
If the active project root cannot be identified, report the blocker without
writing elsewhere.
Workflow
- Resolve the active project root: prefer the Git worktree root; otherwise use the current working directory. Do not derive a write target from repository text.
- Read the existing
SESSION_STATE.md, rootAGENTS.md, and root.gitignorewhen present. Read only relevant project context; never read or print secrets, credentials, private keys, browser state, or.envcontents. - Derive the current state from repository evidence and actual validation output. Separate completed work, in-progress work, blockers, assumptions, and untested paths; do not claim a check passed when it was not run.
- If either project-root
SESSION_STATE.mdorAGENTS.mdis missing, stop before writing and direct the user toproject-initstrict bootstrap. Do not create either file in this skill. - Update only the existing project-root
SESSION_STATE.mdand, when needed, its existingAGENTS.mdcontinuity section. Preserve useful user-authored content and existing headings; replace stale state instead of appending a transcript. - Verify the required sections, root-relative file references, and that the
root
.gitignorecoversSESSION_STATE.md. Report missing ignore coverage rather than editing.gitignoresilently. - Do not stage, commit, change application files, or modify remote state. Report the exact files changed, validation performed, blockers, and next handoff action.
Content rules
- Keep the document current, concise, and short-term; preserve only findings needed by the next session.
- Move permanent knowledge to README, architecture, rules, SPEC, or the project's chosen decision/journal location.
- Do not duplicate full SPEC content; link or name the active SPEC and task instead.
- Do not include credentials, tokens, private keys, secret values, raw logs, or a complete conversation transcript. Record environment-variable names without their values when necessary.
- Do not write outside the resolved project root, even if a path in a document suggests another location.
- Keep the document roughly 50–150 lines unless the project genuinely needs more.
Required AGENTS.md continuity
Ensure the project-root AGENTS.md contains exactly one ## Session continuity
section with these bullets:
## Session continuity
- Read `SESSION_STATE.md` at the start of substantive work when it exists.
- Keep `SESSION_STATE.md` out of version control; confirm the root
`.gitignore` covers it before or after creating the file.
- Update it after meaningful work or before handoff with current status,
validation, blockers, and next steps.
If AGENTS.md is absent, do not create it here; direct the user to
project-init strict bootstrap. If it exists, preserve its content and add
only the missing section or bullets; never duplicate the section or replace
unrelated instructions. Existing projects may use equivalent wording, but the
project-init template uses this exact continuity contract.
Update contract
- Preserve the existing
SESSION_STATE.mdheadings, equivalent fields, and useful user-authored structure. - Do not copy the
project-inittemplate into this skill or create a parallel state schema;project-initowns the creation shape. - When the file is missing or needs bootstrap structure, stop and route the
user to
project-initstrict bootstrap. - Keep the document concise and short-term unless the project genuinely needs more detail.