Save all session context before ending a Claude Code conversation. Seamless recovery next time.
在 Claude Code 会话结束前,自动保存所有工作上下文到文件,确保下次无缝恢复。
Pairs with
/resumefor seamless context recovery.
Claude Code loses conversation context when you:
- Run
/compactto free up the context window - Exit the session (restart Claude Code, load new hooks/settings)
- Session times out or disconnects
- Switch to a different project
- Call it a day and come back tomorrow
Important context — debugging conclusions, architecture decisions, environment state — gets lost. brace-compact saves it to files before the session ends. Next time, /resume brings it all back.
Claude Code 会在以下场景丢失上下文:/compact 压缩对话、退出会话、超时断连、切换项目、隔天继续。调试结论、架构决策、环境状态等重要信息都会丢失。brace-compact 在会话结束前保存到文件,下次用 /resume 恢复。
claude install github:4over7/brace-compactAlso install the companion:
claude install github:4over7/resume
Run before ending your session:
/brace-compact
With session notes:
/brace-compact migrating database to new schema, paused at step 3
Compact:
Working...
→ /brace-compact # save context
→ /compact # compress conversation
→ /resume # restore context
→ Continue working
Exit & restart:
Working...
→ /brace-compact # save context
→ exit # quit Claude Code
→ claude # restart
→ /resume # restore context
→ Continue working
Next day:
Working...
→ /brace-compact paused at database migration step 3
→ exit
... next morning ...
→ claude
→ /resume
→ Continue from step 3
| File | Content |
|---|---|
.claude/resume.md |
Structured checkpoint: task state, critical context, next steps, environment |
MEMORY.md |
Updated project memory: decisions, debugging conclusions, pending work |
| Feedback memories | User corrections saved for future sessions |
Companion: resume
brace-compact saves. resume restores. Install both:
claude install github:4over7/brace-compact
claude install github:4over7/resumeFollows Anthropic's skill design guidelines:
disable-model-invocation: true— only invoked manuallyallowed-tools: Read, Write, Edit, Bash, Glob, Grep- Portable: relative paths, works in any project
- Self-contained:
resume.md+MEMORY.mdis enough to continue