| name | session-end |
| description | End or checkpoint a coding session with a durable four-step handoff. Use when the user says `/session-end`, `/SESSION-END`, "세션 종료", "session end", "checkpoint this session", "save handoff", or asks to prepare the next session. Updates roadmap progress when present, gitignored local handoff, metadata/cost line, and long-term session log. |
Session End
Purpose
Create a reliable handoff so a new Codex session can immediately know what changed, what to do first, and where durable history lives.
Workflow
Run this workflow before the final response when the user asks to end or checkpoint the session.
1. Inspect Project State
Collect:
- repo root:
git rev-parse --show-toplevel
- branch:
git branch --show-current
- dirty state:
git status --short
- device label:
hostname
- local time:
date '+%Y-%m-%d %H:%M:%S %Z (%z)'
Read these if present:
roadmap.md
roadmap.progress.json
CLAUDE.local.md
- latest
docs/session-logs/YYYY-MM-DD.md
AGENTS.md
2. Update Short-Term Handoff
Update CLAUDE.local.md in the repo root. It is expected to be gitignored.
Rules:
- Keep it short.
- Include 2-5 next actions.
- Avoid vague wording.
- Include concrete file paths and commands where useful.
- Put the next first action first.
Required fields:
- updated local time
- device label
- branch
- cost/token line
- next actions
Use this shape:
# Local Handoff
Updated: YYYY-MM-DD HH:mm:ss ZZZ
Device: <hostname>
Branch: <branch>
Cost/token: <exact usage or unavailable in current Codex runtime>
Next:
1. <first exact action>
2. <second exact action>
3. Update Progress Tracking
Update roadmap.md checkboxes and roadmap.progress.json if they exist.
Rules:
- Mark completed tasks as
done / [x].
- Mark active tasks as
in_progress / [~].
- Keep future tasks as
todo / [ ].
- Update
updatedAt, deviceLabel, branch, currentFocus, and handoff.nextFirstAction.
- Validate JSON with:
node -e "JSON.parse(require('fs').readFileSync('roadmap.progress.json','utf8')); console.log('roadmap.progress.json OK')"
If no roadmap exists, create a minimal tracker only when the user explicitly wants tracking. Otherwise update only CLAUDE.local.md and the session log.
4. Append Long-Term Log
Append to docs/session-logs/YYYY-MM-DD.md.
Use exactly these sections:
## 한 일
## 이어할 것
- optional
## 막힌 것
## 책 메모
Writing rule:
한 일 must describe what changed, how it changed, and the result in 2-4 lines.
- Do not only list file names.
이어할 것 must name the next first action.
- Omit
막힌 것 if there is no blocker.
책 메모 is for unexpected discoveries, mistakes, or lessons that should survive context loss.
5. Cost/Token Line
If exact usage is available, write it. If the current runtime does not expose usage, write:
Cost/token: unavailable in current Codex runtime.
Do not invent numbers.
6. Verify
Run:
git check-ignore -v CLAUDE.local.md || true
git status --short
If roadmap.progress.json exists, run the JSON validation command above.
7. Final Response
Keep the final response brief:
- list files updated
- report JSON validation if applicable
- report whether
CLAUDE.local.md is gitignored
- mention if cost/token was unavailable
Do not claim tests/builds were run unless they were.
Optional Script
Use scripts/session_end.py to generate or refresh boilerplate handoff/log/progress files, then inspect and edit the result as needed:
python3 ~/.codex/skills/session-end/scripts/session_end.py --repo .