Skip to content

Commit ac89e2d

Browse files
committed
docs: add session auto-save setup guide for new users
Documents how to verify and use session auto-save: - Verification steps for hooks and settings - What gets saved in session snapshots - How to view saved sessions - Manual save workarounds - Troubleshooting table for common issues Signed-off-by: Jose Alekhinne <alekhinejose@gmail.com>
1 parent b03da29 commit ac89e2d

2 files changed

Lines changed: 55 additions & 1 deletion

File tree

.context/TASKS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
### Documentation `#priority:medium` `#area:docs`
1111
- [x] Document Claude Code integration in README — 2026-01-21
1212
- [x] Add "Dogfooding Guide" — how to use ctx on ctx itself — 2026-01-21
13-
- [ ] Document session auto-save setup for new users
13+
- [x] Document session auto-save setup for new users — 2026-01-21
1414

1515
## Completed (Recent)
1616

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,60 @@ ctx session parse transcript.jsonl --extract
238238

239239
This gives Claude **temporal continuity** — it knows what happened in previous sessions.
240240

241+
### Session Auto-Save Setup
242+
243+
After running `ctx init`, session auto-save is configured automatically. Here's how to verify and use it:
244+
245+
**1. Verify the setup:**
246+
247+
```bash
248+
# Check hooks directory exists
249+
ls .claude/hooks/
250+
# Should show: auto-save-session.sh
251+
252+
# Check settings file
253+
cat .claude/settings.local.json
254+
# Should show PreToolUse and SessionEnd hooks
255+
```
256+
257+
**2. What gets saved:**
258+
259+
When a Claude Code session ends, the `SessionEnd` hook saves:
260+
- Current date/time
261+
- Session type (auto-save)
262+
- Summary of active tasks from `.context/TASKS.md`
263+
- Recent decisions and learnings
264+
265+
Sessions are saved to: `.context/sessions/YYYY-MM-DD-HHMMSS-session-*.md`
266+
267+
**3. View saved sessions:**
268+
269+
```bash
270+
# List all sessions
271+
ctx session list
272+
273+
# Load a specific session
274+
ctx session load 1 # most recent
275+
```
276+
277+
**4. Manual save (if hooks aren't working):**
278+
279+
```bash
280+
# Save current context snapshot
281+
ctx session save "description"
282+
283+
# Or run the hook script directly
284+
.claude/hooks/auto-save-session.sh
285+
```
286+
287+
**5. Troubleshooting:**
288+
289+
| Issue | Solution |
290+
|-------|----------|
291+
| No sessions saved | Check `.claude/settings.local.json` has `SessionEnd` hook |
292+
| Hook script fails | Ensure `ctx` binary path in script is correct |
293+
| Missing sessions dir | Run `mkdir -p .context/sessions` |
294+
241295
### Automated Context Updates
242296

243297
Use `ctx watch` to automatically process context-update commands from AI output:

0 commit comments

Comments
 (0)