Claude Code loses context between sessions. This solves it.
Automatically generates a session resume file every time Claude Code stops. On the next session, Claude reads it first — zero context rebuilding, zero "where were we?".
Claude Code has no persistent memory between sessions. Every new conversation starts cold:
- You re-explain what you're building
- You re-list open threads
- You re-state decisions already made
- Claude re-discovers the codebase
For long-running projects this is expensive — both in tokens and in time.
Claude Code STOP event
│
▼
generate_resume.py
│
├── Reads STATE.json (project state, milestone, blockers)
├── Reads session_context.json (active topics, open threads, decisions)
└── Reads git log --oneline -10 (what actually changed)
│
▼
Writes RESUME.txt
Next session: Claude reads RESUME.txt → starts with full context
The stop hook integrates with Claude Code's hook system (.claude/settings.json):
{
"hooks": {
"Stop": [
{
"matcher": "",
"hooks": [
{ "type": "command", "command": "cmd /c generate_resume.bat" }
]
}
]
}
}=== SESSION RESUME #15 — 30/05/2026 ===
WE WERE WORKING ON:
Built NEXUS swarm orchestrator v1.0, RAG graph-aware v5.0,
MCP v1.3. Fixed stop hook .bat wrapper for Git Bash.
OPEN THREADS:
→ WhatsApp bot — API setup pending
→ AgentsView: show Claude→agent consultations
→ GitHub profile update
DECISIONS MADE:
✓ NEXUS uses ThreadPoolExecutor for agent parallelism
✓ Centralized logging — 34 files updated
NEXT ACTION:
Weld 4x 200mm gussets on left Z column
BLOCKERS:
⚠ Spindle 2.2kW ER20 — to order
pip install gitpython- Create
STATE.jsonwith your project state - Create
session_context.json(updated mid-session or via MCP tool) - Add the stop hook to
.claude/settings.json - Run
python generate_resume.pyonce to verify
Includes an MCP tool update_session_context for updating context mid-session without leaving Claude Code:
update_session_context(
topic="switched to database migration",
decision="use alembic instead of raw SQL",
open_thread="test coverage for new schema"
)| Version | Date | Status |
|---|---|---|
| v1.0 | 2026-05-30 | ACTIVE — stop hook + MCP tool + STATE+git integration |
| v0.1 | 2026-05-28 | REPLACED by v1.0 — manual only, no hook |
TITANIUM_OS — personal cognitive OS.
Full source: generate_restart_prompt.py + DATA/session_context.json + MCP/titanium_mcp_server.py
Claude Code perde il contesto tra una sessione e l'altra. Questo lo risolve.
Genera automaticamente un file di ripresa sessione ogni volta che Claude Code si ferma. Alla sessione successiva, Claude lo legge per primo — zero ricostruzione del contesto.
Come funziona: al STOP di Claude Code, lo script legge STATE.json (stato progetto), session_context.json (topic attivi, thread aperti, decisioni prese) e git log recente → genera RESUME.txt.
Integrazione MCP opzionale: tool update_session_context per aggiornare il contesto durante la sessione senza uscire da Claude Code.
Codice sorgente: TITANIUM_OS → generate_restart_prompt.py + MCP/titanium_mcp_server.py