From e71024c4bd886977dda0bda0d70d11e9a247cb3f Mon Sep 17 00:00:00 2001 From: avesh-devx Date: Mon, 9 Mar 2026 13:23:50 +0530 Subject: [PATCH] docs: enhance session file naming guidelines in save-session command Updated the documentation for the `/save-session` command to include detailed rules for generating the session short-id, including allowed characters, minimum length, and examples of valid and invalid formats. This improves clarity and helps users adhere to the required naming conventions. --- commands/save-session.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/commands/save-session.md b/commands/save-session.md index a9a155cc..348fd2e1 100644 --- a/commands/save-session.md +++ b/commands/save-session.md @@ -32,7 +32,16 @@ mkdir -p ~/.claude/sessions ### Step 3: Write the session file -Create `~/.claude/sessions/YYYY-MM-DD--session.tmp` using today's actual date and a short random alphanumeric ID (e.g., `2024-01-15-abc123de-session.tmp`). +Create `~/.claude/sessions/YYYY-MM-DD--session.tmp` using today's actual date and a short-id that satisfies the rules enforced by `SESSION_FILENAME_REGEX` in `session-manager.js`: + +- Allowed characters: lowercase `a-z`, digits `0-9`, hyphens `-` +- Minimum length: 8 characters +- No uppercase letters, no underscores, no spaces + +Valid examples: `abc123de`, `a1b2c3d4`, `frontend-worktree-1` +Invalid examples: `ABC123de` (uppercase), `short` (under 8 chars), `test_id1` (underscore) + +Full valid filename example: `2024-01-15-abc123de-session.tmp` Each session always gets a unique short-id, so multiple sessions on the same day never collide.