From 5c4b44d4c7db845597fad540f172572f76dcf9b7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 31 Oct 2025 21:02:02 +0000 Subject: [PATCH 1/3] Initial plan From 140a5f346993438905010ae79ad44fbe38526f41 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 31 Oct 2025 21:06:59 +0000 Subject: [PATCH 2/3] Clarify Stop hook behavior and /clear vs exit in docs - Changed "Stop Claude" to "Claude finishes responding" to clarify that the Stop hook fires automatically - Explained Stop hook triggers summary generation automatically, not as a user action - Added detailed section explaining /clear behavior vs completely exiting Claude Code - Clarified when new context is injected (new session start, not after /clear) - Fixed session count: changed "last 3 sessions" to "last 10 sessions" (matches implementation) Co-authored-by: thedotmack <683968+thedotmack@users.noreply.github.com> --- docs/usage/getting-started.mdx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/usage/getting-started.mdx b/docs/usage/getting-started.mdx index 4f36e9ba..d2c2ae3a 100644 --- a/docs/usage/getting-started.mdx +++ b/docs/usage/getting-started.mdx @@ -11,9 +11,9 @@ Claude-Mem works automatically once installed. No manual intervention required! ### The Full Cycle -1. **Start Claude Code** - Context from last 3 sessions appears automatically +1. **Start Claude Code** - Context from last 10 sessions appears automatically 2. **Work normally** - Every tool execution is captured -3. **Stop Claude** - Summary is generated and saved +3. **Claude finishes responding** - Stop hook automatically generates and saves a summary 4. **Next session** - Previous work appears in context ### What Gets Captured @@ -42,7 +42,7 @@ The worker service processes tool observations and extracts: ### Session Summaries -When you stop Claude (or a session ends), a summary is generated with: +When Claude finishes responding (triggering the Stop hook), a summary is automatically generated with: - **Request** - What you asked for - **Investigated** - What Claude explored @@ -159,7 +159,7 @@ Context injection uses three-tier verbosity for efficient token usage: This ensures you get maximum detail for recent work while still having context from older sessions. -## Multi-Prompt Sessions +## Multi-Prompt Sessions & `/clear` Behavior Claude-Mem supports sessions that span multiple user prompts: @@ -167,7 +167,15 @@ Claude-Mem supports sessions that span multiple user prompts: - **prompt_number**: Identifies specific prompt within session - **Session continuity**: Observations and summaries link across prompts -When you use `/clear`, the session doesn't end - it continues with a new prompt number. This preserves context across conversation restarts. +### Important Note About `/clear` + +When you use `/clear`, the session doesn't end - it continues with a new prompt number. This means: + +- ✅ **Observations are still being captured** and added to the current session +- ✅ **A summary will be generated** when Claude finishes responding (Stop hook fires) +- ❌ **New context won't be injected** until you start a completely new session (exit and restart Claude Code) + +To get fresh context from previous sessions, you need to **exit Claude Code completely** (Ctrl+C Ctrl+C or close the terminal) and start a new session. The `/clear` command only clears the conversation context visible to Claude, but the underlying session continues. ## Next Steps From 192adf5cbc08a033c65c34c9508db9a44364dec6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 31 Oct 2025 21:28:54 +0000 Subject: [PATCH 3/3] Fix: /clear DOES inject context via SessionStart hook Corrected incorrect documentation that claimed /clear doesn't inject context. The SessionStart hook fires with source: "clear" when /clear is used, which re-injects context from recent sessions. Updated docs to accurately reflect that /clear both clears conversation AND re-injects fresh context. Co-authored-by: thedotmack <683968+thedotmack@users.noreply.github.com> --- docs/usage/getting-started.mdx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/usage/getting-started.mdx b/docs/usage/getting-started.mdx index d2c2ae3a..20b516ea 100644 --- a/docs/usage/getting-started.mdx +++ b/docs/usage/getting-started.mdx @@ -171,11 +171,11 @@ Claude-Mem supports sessions that span multiple user prompts: When you use `/clear`, the session doesn't end - it continues with a new prompt number. This means: +- ✅ **Context is re-injected** from recent sessions (SessionStart hook fires with `source: "clear"`) - ✅ **Observations are still being captured** and added to the current session - ✅ **A summary will be generated** when Claude finishes responding (Stop hook fires) -- ❌ **New context won't be injected** until you start a completely new session (exit and restart Claude Code) -To get fresh context from previous sessions, you need to **exit Claude Code completely** (Ctrl+C Ctrl+C or close the terminal) and start a new session. The `/clear` command only clears the conversation context visible to Claude, but the underlying session continues. +The `/clear` command clears the conversation context visible to Claude AND re-injects fresh context from recent sessions, while the underlying session continues tracking observations. ## Next Steps