Session Stop Skill
Graceful session close, pause, or verification. Three intents: Pause | Finish | Verify.
All session operations use atlas-session MCP tools directly (prefixed session_* and contract_*). Use ToolSearch to discover them.
Hard Invariants
- User authority is absolute — AI NEVER closes without confirmation.
- Human-visible memory only — All state lives in files.
- Trust separation — for bounty verify, spawn a separate finality Task agent. Never the same agent that submits.
- AtlasCoin is optional — if down, skip bounty steps and continue.
- Idempotent — Running /stop on an already-closed session exits cleanly.
- Archive after verification — Soul purpose is archived AFTER bounty settlement, not before.
UX Contract
- User sees ONE intent question, then results. Nothing else.
- No step announcements, no narration, no internal process descriptions.
Phase 0: Sync + State Detection
First, save the current session state so context files are up to date:
- Invoke
/sync — updates all session-context files and MEMORY.md with current progress. Silent, no output shown.
Then detect state:
- Call
session_read_context(project_dir) — get soul purpose, status hint, open tasks.
- If
status_hint is no_purpose or soul purpose is empty: tell user "No active soul purpose to close." EXIT.
- Check bounty: if
session-context/BOUNTY_ID.txt exists, call contract_get_status(project_dir). Store HAS_BOUNTY.
Phase 1: Intent Question
Ask ONE question via AskUserQuestion:
Question: "Soul purpose: '[soul purpose text]'. What would you like to do?"
- "Pause for the day" — Save state, keep purpose active.
- "Finished — verify and close" — Full settlement + PR + archive.
- "Just verify" — Check status, show results, return to work.
- "Cancel" — Do nothing. EXIT.
Store the user's choice as INTENT.
Read custom.md if it exists, follow instructions under "During Settlement".
Intent A: Pause for the Day
Save progress. Soul purpose, bounty, and Ralph Loop all stay active.
Step 1: Harvest
- Call
session_harvest(project_dir).
- If promotable content exists, assess and present to user for approval.
- After approval, append promoted content to target files via Edit tool.
Step 2: Write Checkpoint
Read session-context/CLAUDE-activeContext.md, then append a timestamped checkpoint:
## [CHECKPOINT] HH:MM DD/MM/YY
### Session Paused — Progress Saved
**Accomplished this session:**
- [AI fills in based on what was done]
**In progress:**
- [AI fills in based on current state]
**Next steps:**
- [AI fills in based on remaining work]
**Blockers/Decisions pending:**
- [AI fills in, or "None"]
Fill each section with real, specific content — not placeholders.
Step 3: Optional Save-Point Commit
Ask: "Create a save-point commit?" (Yes / No)
If Yes and project is git: git add -A && git commit -m "checkpoint: [brief summary]". If commit fails, inform user and continue.
Step 4: Done
- Do NOT archive the soul purpose — it stays active.
- Do NOT settle the bounty — it stays active.
- Do NOT remove Ralph Loop indicator.
- Tell user: "Progress saved. Soul purpose '[text]' remains active. Run
/start to pick up where you left off."
Intent B: Finished — Verify and Close
Full settlement: harvest, verify, review, PR, bounty, archive.
Step 1: Harvest + Promote
- Call
session_harvest(project_dir).
- If promotable content exists, assess and present to user. Append approved content.
Step 2: Feature Verification
- Call
session_features_read(project_dir).
- If pending features exist, run their proofs. Update status in
CLAUDE-features.md.
Step 3: Verification Gate
- Invoke
superpowers:verification-before-completion — run doubt review on recent changes.
- If critical issues: present to user — "Fix first" / "Close anyway" / "Continue working".
- If "Continue working": EXIT (return to active work).
Step 4: Deactivate Hook
Call session_hook_deactivate(project_dir).
Step 5: PR Creation
- Push current branch:
git push -u origin HEAD
- Invoke
superpowers:requesting-code-review for review body.
- Create PR:
gh pr create --title "..." --body "..." with review summary.
- Return PR URL to user.
Step 6: Bounty Settlement (if bounty exists)
- Call
contract_run_tests(project_dir) — execute all criteria.
- If tests pass: call
contract_submit(project_dir).
- Spawn a single finality Task agent:
Task(subagent_type: "general-purpose", prompt: "You are finality-agent. Verify bounty [ID] independently. Call contract_verify(project_dir). Report pass/fail.")
- Wait for finality result.
- If verified: call
contract_settle(project_dir). Tell user tokens earned.
- If failed: "Fix and re-verify" / "Close anyway (forfeit)" / "Continue working".
Step 7: Archive + Cleanup
- If user chose to set a new purpose, ask for it now. Store as
NEW_PURPOSE.
- Call
session_archive(project_dir, OLD_PURPOSE, NEW_PURPOSE).
- Remove Ralph Loop indicator:
rm -f ~/.claude/ralph-loop.local.md
- Tell user: "Session closed. Soul purpose '[text]' archived." (Include token/PR info.)
Intent C: Just Verify
Check status without closing. Return to work after.
- Invoke
superpowers:verification-before-completion — doubt review.
- Call
session_features_read(project_dir) — show feature status.
- If bounty exists: call
contract_run_tests(project_dir) — show results.
- Present all findings to user. No close, no archive.
- Tell user: "Verification complete. Returning to work."
1---2name: stop-23description: Gracefully close, pause, or verify a session: harvest promotable content, save progress, archive soul purpose, settle AtlasCoin bounty. Use when user says /stop, wrap up, done for the day, finishing up, close session, pause, verify, or end session.4---5
6# Session Stop Skill
7
8> Graceful session close, pause, or verification. Three intents: Pause | Finish | Verify.
9
10All session operations use `atlas-session` MCP tools directly (prefixed `session_*` and `contract_*`). Use `ToolSearch` to discover them.
11
12## Hard Invariants
13
141. **User authority is absolute** — AI NEVER closes without confirmation.
152. **Human-visible memory only** — All state lives in files.
163. **Trust separation** — for bounty verify, spawn a separate finality Task agent. Never the same agent that submits.
174. **AtlasCoin is optional** — if down, skip bounty steps and continue.
185. **Idempotent** — Running /stop on an already-closed session exits cleanly.
196. **Archive after verification** — Soul purpose is archived AFTER bounty settlement, not before.
20
21## UX Contract
22
23- User sees ONE intent question, then results. Nothing else.
24- No step announcements, no narration, no internal process descriptions.
25
26---
27
28## Phase 0: Sync + State Detection
29
30First, save the current session state so context files are up to date:
31
321. Invoke `/sync` — updates all session-context files and MEMORY.md with current progress. Silent, no output shown.
33
34Then detect state:
35
362. Call `session_read_context(project_dir)` — get soul purpose, status hint, open tasks.
372. If `status_hint` is `no_purpose` or soul purpose is empty: tell user "No active soul purpose to close." **EXIT**.
383. Check bounty: if `session-context/BOUNTY_ID.txt` exists, call `contract_get_status(project_dir)`. Store `HAS_BOUNTY`.
39
40## Phase 1: Intent Question
41
42Ask ONE question via AskUserQuestion:
43
44**Question**: "Soul purpose: '[soul purpose text]'. What would you like to do?"
45- **"Pause for the day"** — Save state, keep purpose active.
46- **"Finished — verify and close"** — Full settlement + PR + archive.
47- **"Just verify"** — Check status, show results, return to work.
48- **"Cancel"** — Do nothing. **EXIT**.
49
50Store the user's choice as `INTENT`.
51
52Read `custom.md` if it exists, follow instructions under "During Settlement".
53
54---
55
56## Intent A: Pause for the Day
57
58> Save progress. Soul purpose, bounty, and Ralph Loop all stay active.
59
60### Step 1: Harvest
61
621. Call `session_harvest(project_dir)`.
632. If promotable content exists, assess and present to user for approval.
643. After approval, append promoted content to target files via Edit tool.
65
66### Step 2: Write Checkpoint
67
68Read `session-context/CLAUDE-activeContext.md`, then append a timestamped checkpoint:
69
70```markdown
71## [CHECKPOINT] HH:MM DD/MM/YY
72### Session Paused — Progress Saved
73
74**Accomplished this session:**
75- [AI fills in based on what was done]
76
77**In progress:**
78- [AI fills in based on current state]
79
80**Next steps:**
81- [AI fills in based on remaining work]
82
83**Blockers/Decisions pending:**
84- [AI fills in, or "None"]
85```
86
87Fill each section with real, specific content — not placeholders.
88
89### Step 3: Optional Save-Point Commit
90
91Ask: "Create a save-point commit?" (Yes / No)
92
93If Yes and project is git: `git add -A && git commit -m "checkpoint: [brief summary]"`. If commit fails, inform user and continue.
94
95### Step 4: Done
96
97- Do NOT archive the soul purpose — it stays active.
98- Do NOT settle the bounty — it stays active.
99- Do NOT remove Ralph Loop indicator.
100- Tell user: "Progress saved. Soul purpose '[text]' remains active. Run `/start` to pick up where you left off."
101
102---
103
104## Intent B: Finished — Verify and Close
105
106> Full settlement: harvest, verify, review, PR, bounty, archive.
107
108### Step 1: Harvest + Promote
109
1101. Call `session_harvest(project_dir)`.
1112. If promotable content exists, assess and present to user. Append approved content.
112
113### Step 2: Feature Verification
114
1151. Call `session_features_read(project_dir)`.
1162. If pending features exist, run their proofs. Update status in `CLAUDE-features.md`.
117
118### Step 3: Verification Gate
119
1201. Invoke `superpowers:verification-before-completion` — run doubt review on recent changes.
1212. If critical issues: present to user — "Fix first" / "Close anyway" / "Continue working".
1223. If "Continue working": **EXIT** (return to active work).
123
124### Step 4: Deactivate Hook
125
126Call `session_hook_deactivate(project_dir)`.
127
128### Step 5: PR Creation
129
1301. Push current branch: `git push -u origin HEAD`
1312. Invoke `superpowers:requesting-code-review` for review body.
1323. Create PR: `gh pr create --title "..." --body "..."` with review summary.
1334. Return PR URL to user.
134
135### Step 6: Bounty Settlement (if bounty exists)
136
1371. Call `contract_run_tests(project_dir)` — execute all criteria.
1382. If tests pass: call `contract_submit(project_dir)`.
1393. Spawn a single finality Task agent: `Task(subagent_type: "general-purpose", prompt: "You are finality-agent. Verify bounty [ID] independently. Call contract_verify(project_dir). Report pass/fail.")`
1404. Wait for finality result.
1415. If verified: call `contract_settle(project_dir)`. Tell user tokens earned.
1426. If failed: "Fix and re-verify" / "Close anyway (forfeit)" / "Continue working".
143
144### Step 7: Archive + Cleanup
145
1461. If user chose to set a new purpose, ask for it now. Store as `NEW_PURPOSE`.
1472. Call `session_archive(project_dir, OLD_PURPOSE, NEW_PURPOSE)`.
1483. Remove Ralph Loop indicator: `rm -f ~/.claude/ralph-loop.local.md`
1494. Tell user: "Session closed. Soul purpose '[text]' archived." (Include token/PR info.)
150
151---
152
153## Intent C: Just Verify
154
155> Check status without closing. Return to work after.
156
1571. Invoke `superpowers:verification-before-completion` — doubt review.
1582. Call `session_features_read(project_dir)` — show feature status.
1593. If bounty exists: call `contract_run_tests(project_dir)` — show results.
1604. Present all findings to user. No close, no archive.
1615. Tell user: "Verification complete. Returning to work."