feat: add memory state check between Phase 3 and Phase 4

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 <noreply@anthropic.com>
This commit is contained in:
catlog22
2025-10-12 22:23:32 +08:00
parent f090c713ca
commit 61997f8db8

View File

@@ -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