0xGondarxyz/claude-code-mods/tree/main/save-game
save-game
유휴, 늦은 밤, /save, 세션 종료 때 3줄 저장 카드(doing, next step, open question)를 쓰고 다음에 해당 repo에서 프롬프트 위에 Continue 버튼과 함께 보여 주는 Claude Code 모드입니다.
이 mod 소개
save-game은 작업을 멈출 때 신경 쓸 일을 줄여 주는 Claude Code 모드입니다. 유휴 상태, 늦은 밤, /save, 세션 종료 때 3줄 저장 카드를 씁니다. 카드에는 Doing(나와 Claude가 처리 중인 내용), Next(다음 단계), Open(해결되지 않은 질문이나 차단 요인, 또는 none)이 들어갑니다. 카드는 repo별로 저장하고(session 폴더의 git toplevel 기준), 각 repo에는 최신 5개를 남깁니다. 같은 session의 새 카드는 이전 카드를 대체합니다.
카드가 만들어지는 때: (1) 유휴: 메인 스레드 턴이 끝난 뒤 4분; (2) 자정 01:00 이후: 최근 30분 안에 턴이 있었다면 매일 밤 한 번 toast로 알림; (3) /save 실행: 즉시 생성; (4) 세션 종료: 저장하지 않은 턴이 있으면 모델을 호출하지 않고 session을 큐에 넣으며, 다음에 어느 repo에서든 session이 열릴 때 백그라운드에서 Sonnet이 transcript 끝부분으로 카드를 만듭니다. 1~3의 카드는 live session의 fork를 사용하고 prompt cache를 재사용하므로 저렴하지만 cache가 따뜻할 때(최소 5분)만 작동합니다.
명령: /save는 카드를 즉시 만들고 resume 명령을 붙입니다. /save list는 이 repo의 최근 5개 카드를 나열합니다. 세션이 시작될 때 이 repo에 14일 이내의 카드가 있으면 프롬프트 위 band에 Doing/Next/Open과 Continue, Dismiss 버튼이 표시됩니다. Continue는 세 줄의 내용을 붙여 “Continue where I stopped. Save card:”를 첫 프롬프트로 보냅니다.
claude -p와 SDK의 headless 실행에서는 모드가 아무 동작도 하지 않습니다. 설정 옵션도 없습니다. 제한 사항은 모드를 다시 로드하면 상태가 초기화되고, session 시작 시 큐를 읽고 지우며, transcript 경로가 session 폴더와 id에서 파생되고, transcript의 마지막 3 MB만 읽어 마지막 30,000자로 자르며, 컴퓨터에 tail이 있어야 한다는 점입니다. 라이선스는 MIT입니다.
주의: 이 모드는 샌드박스 격리를 하지 않고 Claude Code와 같은 권한을 가집니다. 설치하기 전에 소스 코드를 읽으세요.
설치
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add 0xGondarxyz/claude-code-mods claude plugin install save-game
원문 / README
save-game
A Claude Code mod that makes stopping painless. It writes a 3 line save card when you stop. The next time a session opens in that repo, the card shows above the prompt with a Continue button.
Install
/plugin marketplace add 0xGondarxyz/claude-code-mods
/plugin install save-game@claude-code-mods
Or try it without installing:
git clone https://github.com/0xGondarxyz/claude-code-mods
claude --plugin-dir claude-code-mods/save-game
Mods are not sandboxed. They run with the same access as Claude Code. Read the source before you install any mod, including this one.
The card
Doing: <what you and Claude were working on: files, feature, bug>
Next: <the single next step>
Open: <the open question or blocker, or "none">
Cards are kept per repo (the git toplevel of the session folder, else the folder). The store holds the 5 newest per repo. A newer card of the same session replaces the older one.
When a card is made
- Idle: 4 minutes after a main thread turn ends. A new prompt or turn cancels the timer. No new turn since the last card means no card.
- Past 01:00 local time: once per night, if the session had a turn in the last 30 minutes. A toast says it is a good point to stop.
/save: makes a card now.- Session end: if there were turns since the last card, the mod does not call a model (exit time is short). It queues the session. The next session that starts, in any repo, turns the queue into cards in the background with Sonnet, from the tail of the transcript file (your prompts and Claude's text only).
Cards from 1 to 3 use a fork of the live session. It reuses the prompt cache, so it is cheap. The fork only works while the cache is warm (the shortest cache lifetime is 5 minutes, hence 4).
Commands
/save: make a card now and print it withfull context: claude --resume <session id>. With no new turns it prints the newest card again./save list: the last 5 cards of this repo, each with its age, its 3 lines and its resume line.
The band
At session start, if this repo has a card younger than 14 days, a band shows above the prompt:
Saved 3h ago (session ab12cd3)
Doing: ...
Next: ...
Open: ...
[ Continue ] [ Dismiss ]
Continue sends Continue where I stopped. Save card: and the 3 lines as your first prompt. Dismiss hides the band. The band also hides after the first prompt you send. If a queued card for this repo finishes during startup, the band updates to it.
Headless runs
In claude -p and SDK runs the mod does nothing: no timers, no queue, no band, no /save.
Options
None.
Limits
- Module state (turn counts, timers) resets when the mod reloads. Cards and the queue live in the plugin store and stay.
- The queue is read and cleared at session start. Two sessions that start in the same instant can both process the same entry.
- The transcript path is derived from the session folder and id. If the file is missing, the queued session is skipped without a message.
- Only the last 3 MB of the transcript file is read, then cut to the last 30,000 characters of text.
- Needs
tailon the machine for the queue step (Linux and macOS have it).
License
MIT
