From 61997f8db8f631d7b7e989fec1c790cb4a6feab8 Mon Sep 17 00:00:00 2001 From: catlog22 Date: Sun, 12 Oct 2025 22:23:32 +0800 Subject: [PATCH] feat: add memory state check between Phase 3 and Phase 4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add automatic memory compaction trigger when context usage exceeds 110K tokens: - Evaluates memory state after analysis phase (Phase 3) - Triggers /compact command if approaching context limits - Prevents context overflow and ensures optimal performance - Particularly important after extensive documentation generation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .claude/commands/workflow/plan.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.claude/commands/workflow/plan.md b/.claude/commands/workflow/plan.md index 7a22c990..02d746c1 100644 --- a/.claude/commands/workflow/plan.md +++ b/.claude/commands/workflow/plan.md @@ -109,6 +109,14 @@ CONTEXT: Existing user database schema, REST API endpoints **After Phase 3**: Return to user showing Phase 3 results, then auto-continue to Phase 4 +**Memory State Check**: +- Evaluate current context window usage and memory state +- If memory usage is high (>110K tokens or approaching context limits): + - **Command**: `SlashCommand(command="/compact")` + - This optimizes memory before proceeding to Phase 4 +- Memory compaction is particularly important after analysis phase which may generate extensive documentation +- Ensures optimal performance and prevents context overflow + --- ### Phase 4: Task Generation