# Session End

> End the session, save context, and produce a handoff artifact

- Skill: `majiayu000/session-end-6` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds add majiayu000/session-end-6`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/session-end-6/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-09
- Page: https://skillmd.com/skills/majiayu000/session-end-6

---


# Session End

Uses **Orchestrator**. Orchestrator produces the handoff artifact directly — session operations run inline because they need conversation context. Produce a session handoff artifact that captures work completed, decisions made, and concrete next steps for continuity.

**Prerequisites:** Work performed during the session, understanding of what was accomplished

---

## Phase 1: Inventory Session Work

### Gather Session State

1. List all files created, modified, or deleted during the session
2. Enumerate decisions made and their rationale
3. Identify any open questions or blockers
4. Note the current branch and its status
5. Check board status for any tracked issues — ensure it reflects reality
   - Read `workspace.config.yaml` for `board.project_id`, `board.fields.status.field_id`, and status option IDs

---

## Phase 2: Produce Handoff Artifact

### Required Sections

| Section        | Required | Content                                              |
| -------------- | -------- | ---------------------------------------------------- |
| Context        | Yes      | Issue/PR links, branch, prior sessions               |
| Summary        | Yes      | What was accomplished this session                   |
| Files Touched  | Yes      | Files created, modified, or deleted (relative paths) |
| Decisions Made | If any   | Key decisions with rationale                         |
| Work Completed | Yes      | Checkboxes; unchecked = partial progress             |
| Open Questions | If any   | Unresolved items the next session should address     |
| Next Steps     | Yes      | Concrete actions, ordered by priority                |
| Blocked On     | If any   | What blocks further progress                         |
| Active Branch  | If any   | Git branch being worked on                           |

### File Naming

**Location:** `.tmp/sessions/`
**Format:** `YYYY-MM-DD-<kebab-title>.md`
**Example:** `.tmp/sessions/2026-03-15-redis-cache-service.md`

### Output

```markdown
## Context Anchors

- **Issue:** #<number> - <title>
- **Branch:** `<branch-name>`
- **Prior Session:** <prior session file if any>

## Session Handoff

### Summary

<What was accomplished this session>

### Files Touched

| File   | Action                   |
| ------ | ------------------------ |
| <path> | Created/Modified/Deleted |

### Decisions Made

- <Decision>: <Rationale>

### Work Completed

- [x] <completed item>
- [ ] <incomplete item>

### Open Questions

- <question needing human input>

### Next Steps

1. <highest priority next action>
2. <second priority>
3. <third priority>

### Blocked On

- <blocker> (if any)

### Active Branch

`<branch-name>`
```

---

## Phase 3: Verify and Close

### Checklist

- [ ] All section content is current and accurate
- [ ] Board status updated for tracked issues
- [ ] Next steps are concrete and actionable (not vague)
- [ ] Handoff file saved to `.tmp/sessions/`

### Output

```markdown
## Context Anchors

- **Issue:** #<number> - <title> (if applicable)
- **Branch:** `<branch-name>` (if applicable)

## Session Closure

**Handoff artifact:** `.tmp/sessions/<filename>.md`
**Board status:** Verified current for all tracked issues

## Next Step

Session complete. Handoff artifact produced.

**Approval Required:** No
```

### ⛔ CHECKPOINT

**STOP.** Verify the handoff artifact is complete and saved before closing session.

---

## Error Handling

| Situation                     | Recovery                                        |
| ----------------------------- | ----------------------------------------------- |
| Files touched list incomplete | Re-check git status and diff for missed changes |
| Board status can't be updated | Report failure, document in handoff             |
| Handoff file write fails      | Retry, or present content for manual save       |
| Prior session file conflicts  | Use a distinct filename with topic suffix       |
| Missing issue/PR links        | Search git log and forge for references         |

---

## When to Create a Session File

| Trigger                            | Example                                         |
| ---------------------------------- | ----------------------------------------------- |
| Multi-turn work on a tracked issue | Working on #42 across several conversations     |
| Decisions that need to persist     | Chose architecture A over B — rationale matters |
| Complex multi-step implementation  | 5+ step plan that can't complete in one session |
| Context approaching token limit    | Long conversation near context window           |
| Explicit user request              | "Save session state" or "Create a session file" |

**Skip session files for:** quick one-off questions, simple single-turn edits, work fully captured by commit messages.

