원클릭으로
session-close-ritual
Run at session end to reconcile tasks, update skills, and write to brain. Enforces closure discipline across the fleet.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Run at session end to reconcile tasks, update skills, and write to brain. Enforces closure discipline across the fleet.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Guides Cloudflare One Zero Trust and SASE work across Access, Gateway, WARP, Tunnel, Cloudflare WAN, DLP, CASB, device posture, and identity. Use when designing, configuring, troubleshooting, or reviewing Cloudflare One deployments. Retrieval-first: use current Cloudflare docs/API schemas instead of embedded product docs.
Use when scheduling recurring polls, read-only monitors, or background jobs that must survive shell session boundaries.
Discover, register, and maintain Hermes skills from non-default paths (plugin directories, external repos, shared vaults). Use when skills are missing from `skills_list()`, when the user mentions plugin skills, when symlinking skills, or when reconciling duplicate/overlapping skills between the default tree and external sources.
Operate the Antigravity CLI (agy): plugins, auth, sandbox.
Tune HERMES_STREAM_RETRIES for mid-stream reconnect resilience.
Manage parallel Hermes sessions in Telegram topics.
| name | session-close-ritual |
| description | Run at session end to reconcile tasks, update skills, and write to brain. Enforces closure discipline across the fleet. |
| version | 1.0.0 |
| author | Hermes |
| license | MIT |
| metadata | {"hermes":{"tags":["session","closure","reconciliation","brain"],"related_skills":["verification-before-completion","memory-sop-drain"]}} |
Enforce per-session closure discipline to prevent stale context from leaking into the next session. Run after every 10 turns or context exhaustion (not daily).
Ant’s Guidance (2026-06-09):
"Session close is meant to be per session to align state, tasks, OB1, and Claude files after 10 turns or context exhaustion. Waiting until the end of the day to tidy up behind 3 sessions means those 3 sessions may already have experienced the problem that session close was trying to solve."
Context Exhaustion Triggers:
agent.max_turns).model.context_length (e.g., 102,400/128,000 for kimi-k2.6).compression.threshold in config)./compress or /close.Rule: Follow this sequence for session wrap-up (cold restart or context exhaustion):
Update Lifecycle Ledger:
=notes/claude/coordination/LEDGER.md.git add -A during wrap. Stage only files owned by this session, verify git diff --cached --name-only, and explicitly leave unrelated drift for its owner.Update Daily Note:
memory/<date>.md.Write Handoff Document:
=notes/claude/mcp-coordination/state/session-handoffs/<session-id>.md.Notify Fleet:
=notes/claude/coordination/inbox-fleet.md).Example:
## Session: 20260610_120000_hermes_fleet_review
**Owner**: Hermes
**Status**: Completed
### Work Completed
- Unblocked Codex lane via OpenAI API bypass.
- Updated `fleet-orchestration` skill.
### Files Updated
| File | Purpose |
|------|---------|
| `inbox-fleet.md` | Fleet updates |
| `fleet-orchestration/SKILL.md` | Updated skill |
### Next Steps
1. Monitor OpenAI API usage.
2. Regenerate Home Assistant token.
Anti-patterns:
python-telegram-bot may not be installed in the session runtime. If send_message fails with "python-telegram-bot not installed", the file-based notification (fleet inbox append) is sufficient — do not loop retrying Telegram. The inbox entry serves the same fleet-awareness purpose.memory tool will always accept writes. The tool's round-trip guard rejects writes when MEMORY.md contains non-§-delimited content (tables, nested bullets). If memory(action='add') fails repeatedly with "content that wouldn't round-trip", fall back to direct write_file on MEMORY.md (rewrite to clean §-delimited format, then append new facts). The handoff, inbox, ledger, and daily note already carry the durable record — memory drain is a convenience, not a hard requirement that should block closeout.memory tool has a char limit (default 6000). When adding multiple facts via operations, the batch may exceed the limit even if individual entries are small. Always include remove operations in the same batch to free space — the limit is checked on the FINAL result, so a single batch can remove stale entries AND add new ones. If a batch is rejected for exceeding the limit, shorten the new entries or remove more stale ones and retry as a single atomic batch.<<<<<<<, =======, and >>>>>>>; preserve both meaningful sides and remove markers before claiming wrap complete. If a path was conflicted, also check git ls-files -u -- <path> because the worktree can look clean while the index still needs reconciliation. See references/update-pickup-wrap-conflict-and-live-fanout-20260614.md.write_file. Daily notes (memory/YYYY-MM-DD.md), fleet inboxes, and ledgers are append-only surfaces — they accumulate entries across sessions. Using write_file on them replaces the entire file, destroying all prior entries. Always use patch with mode='replace' to append to these files, or read_file first to get the full content, prepend/append your entry, then write_file the combined result. If you do overwrite, recover from git: git show HEAD:<path> > /tmp/restore.md, then combine and rewrite. See references/daily-note-overwrite-recovery-20260617.md.LATEST_HANDOFF.md rotation happen after the first handoff/snapshot write, patch every already-written surface with the final evidence (message ID, PDF path, pointer target) before the final response.Companion: verification-before-completion (user-declared validation).
verification-before-completion to catch stale tasks.cancelled in todo().pending; mark completed wrap tasks as completed and approval-gated/deferred work as cancelled with a reason. See references/context-compression-task-reconciliation-20260615.md.Guiding principle (Christopher Alexander, A Pattern Language):
"When you build a thing you cannot merely build that thing in isolation, but must also repair the world around it, and within it, so that the larger world at that one place becomes more coherent, and more whole."
Every closeout is an opportunity to repair the skill library — not just the files you touched, but the skills that governed the work. If something was non-optimal, even slightly, fix it as part of the wrap. Be ACTIVE: most sessions produce at least one skill update. A pass that does nothing is a missed learning opportunity.
browser-automation-handoff — missing CACHE_VERSION bump").verification-before-completion").Capture durable session facts using the canonical fleet path (NOT the deprecated .hermes/brain/ directory):
/Users/jack.reis/Documents/=notes/bin/local-turn-sync capture "<one durable fact>" --source "<agent>" --session-id "session/YYYY-MM-DD-<slug>" --task-id "session/YYYY-MM-DD-<slug>" --kind "<decision|fact|correction|blocker|done|environment>"
eval "$("$HOME/.hermes/bin/ob1-token.sh" export)" && python3 /Users/jack.reis/Documents/=notes/bin/ob1-pull --capture "[SESSION] <summary>" --task-id "session/YYYY-MM-DD-<slug>" --source "<agent>"
memory(action='add', content='...', target='memory')If Hindsight (:9876) is reachable, local-turn-sync will also drain there. If it's down, holographic + OBn captures still succeed — never block on a single memory plane.
mentions, shares, decides, or follows_up.smart-graph skill to verify note relationships and avoid orphans.index.md).See references/exec-circle-kg.md for a detailed workflow.
# Run the ritual
h Hermes session-close-ritual
# Verify — check local-turn-sync capture + OB1 drain
/Users/jack.reis/Documents/=notes/bin/local-turn-sync brief "session close" --limit 3