{
  "markdown": "# 🌙 session-end\n\n**A structured closing ritual for AI coding sessions.**  \nStop losing context. Stop repeating yourself next conversation.\n\n---\n\n每次对话结束时，AI 会忘记一切。`session-end` 是一套 6 步收尾流程——进度、经验、待办全部写入记忆，下次对话开口就能接着来。\n\n*When the session ends, AI forgets everything. `session-end` is a 6-step closing ritual — progress, lessons, and todos are saved so the next conversation picks up right where you left off.*\n\n---\n\n## What it does / 做什么\n\n```\n/session-end\n```\n\n| Step | EN | 中文 |\n|------|----|----|\n| 1 | ✅ Task Audit | 逐条核查本次任务完成情况 |\n| 2 | 🔍 Retrospective | 找出失误（不是总结成果） |\n| 3 | 🧠 Decide what to update | 判断哪些记忆/规则需要更新 |\n| 4 | 📝 Execute updates | 执行记忆、CLAUDE.md、Skill 更新 |\n| 5 | ✨ Memory compression | 压缩整理记忆文件（Claude Code: `dream` skill） |\n| 6 | 📋 Next session plan | 写下下次对话的 Top 5 待办 |\n\nThe retrospective step is intentional: **find mistakes, not just celebrate wins.** Known pitfalls walked into again, wrong tool choices, undefended scripts — all get surfaced and written to memory so they don't repeat.\n\n复盘步骤刻意聚焦于错误：已知的坑又踩了、工具选择绕路了、脚本没有防御性——全部记录，下次不再重犯。\n\n---\n\n## Install / 安装\n\n### Claude Code (plugin — recommended)\n\n```bash\nclaude plugins install github:zeshuochen/session-end\n```\n\nThen invoke with `/session-end`.\n\nTo also install the automatic trigger hooks, merge `hooks/hooks.json` into your `~/.claude/settings.json` under the `\"hooks\"` key.\n\n### Claude Code (manual)\n\n```bash\nmkdir -p ~/.claude/skills/session-end\ncurl -o ~/.claude/skills/session-end/SKILL.md \\\n  https://raw.githubusercontent.com/zeshuochen/session-end/main/skills/session-end/SKILL.md\n```\n\n### Other agents / 其他 Agent\n\nThe skill is plain markdown — paste `skills/session-end/SKILL.md` into your agent's context, system prompt, or skill system as-is. Steps 1–4 and 6 are fully agent-agnostic. Step 5 references `dream`, a Claude Code–specific skill; skip or replace with your own memory tool.\n\n---\n\n## Hooks / 自动触发（可选）\n\nThe hook watches every message for trigger phrases and injects structured instructions automatically.\n\n| Trigger phrase | Effect |\n|---|---|\n| `end session` / `结束对话` | Injects instruction to invoke `/session-end` immediately |\n\n**Install:** merge the contents of `hooks/hooks.json` into your `~/.claude/settings.json`:\n\n```json\n{\n  \"hooks\": {\n    \"UserPromptSubmit\": [\n      {\n        \"hooks\": [\n          {\n            \"type\": \"command\",\n            \"command\": \"python \\\"${CLAUDE_PLUGIN_ROOT}/hooks/trigger.py\\\"\",\n            \"timeout\": 5\n          }\n        ]\n      }\n    ]\n  }\n}\n```\n\nThe hook requires Python 3 (stdlib only, no dependencies).\n\n---\n\n## Memory system / 记忆系统\n\n`session-end` is most powerful paired with a persistent memory structure:\n\n```\n~/.claude/\n├── CLAUDE.md                    ← global rules and conventions\n└── projects/<project>/\n    └── memory/\n        ├── MEMORY.md            ← index of all memory files\n        ├── project_*.md         ← project state\n        ├── feedback_*.md        ← lessons and corrections\n        └── reference_*.md       ← external resource pointers\n```\n\nEach session-end run updates these files. The `start session` hook reads them back on next open. No context lost.\n\n---\n\n## Agent compatibility / 兼容性\n\n| Agent | Skill | Hooks | Notes |\n|---|---|---|---|\n| Claude Code | ✅ `/session-end` via plugin | ✅ `UserPromptSubmit` | Full support incl. `dream` compression |\n| Gemini CLI | ✅ via `activate_skill` | ⚠️ Adapt format | See `gemini-extension.json` |\n| Copilot CLI | ✅ Paste as context | ❌ No hook system | Manual invoke only |\n| Cursor | ✅ Add to `.cursorrules` | ⚠️ See `.cursor-plugin/` | Manual invoke |\n| Codex / others | ✅ Paste as context | ❌ | Manual invoke |\n\n---\n\n## License\n\nMIT © [Zeshuo Chen](https://github.com/zeshuochen)\n",
  "bytes": 3697,
  "sha": "7160b510c593db72439fc8c7c72520196729132a36ae9677878695545d7adf80",
  "repo_slug": "zeshuochen/session-end",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_zeshuochen_session_end_e4877db1/readme"
}