Implement unique filename generation to prevent overwriting existing session files

This commit is contained in:
Space-Banane
2026-04-08 20:12:36 +02:00
parent c626c73e40
commit 058e2f4df4
3 changed files with 31 additions and 1 deletions

View File

@@ -17,6 +17,9 @@ metadata:
Writes full user/assistant transcript context from the previous session into
`<workspace>/memory/YYYY-MM-DD-slug.md` when `/new` or `/reset` runs.
This hook avoids overwriting existing files by choosing a unique filename
when a collision occurs (it appends `-1`, `-2`, etc. to the base name).
Differences from bundled session-memory:
- Uses full session context in output file