-
Notifications
You must be signed in to change notification settings - Fork 266
Description
Problem
When entire explain --generate runs, it spawns a full Claude Code session to generate AI summaries for checkpoints. These sessions:
- Show up in Claude Code's
/resumelist - users see dozens of "This is your initialization prompt" entries alongside real work sessions - Show up in
entire statusas active sessions indefinitely (some persist 30+ days) - Contribute to the session count that drives post-commit hook latency (see ENCLI-123)
- Cannot be distinguished from real interactive sessions
Evidence from my repo right now
After entire clean --force, I still have 12 active sessions. 7 of them are summary generation artifacts:
[Claude Code] 6d7acb6 started 27d ago "This is your initialization prompt..."
[Claude Code] 79e5218 started 28d ago "This is your initialization prompt..."
[Claude Code] 6e453d5 started 31d ago "This is your initialization prompt..."
[Claude Code] 5ca15d9 started 31d ago "This is your initialization prompt..."
[Claude Code] 7d2c429 started 31d ago "This is your initialization prompt..."
[Claude Code] fcd3c15 started 32d ago "This is your initialization prompt..."
[Claude Code] 5ee97fe started 33d ago "This is your initialization prompt..."
That's 58% of my active sessions being ghost summary sessions. They're stale (27-33 days old), never cleaned, and inflate session count.
Root cause
entire explain --generate appears to launch a full Claude Code session (with initialization prompt) rather than making a direct API call. This session gets tracked by Entire like any other, but it's ephemeral work that shouldn't persist.
Proposed fix
Use a direct LLM API call instead of spawning a Claude Code session. The user already has ANTHROPIC_API_KEY available. Summary generation is a simple prompt-in/text-out operation - it doesn't need tool use, file access, or session context. A direct API call would:
- Not create trackable sessions
- Not appear in
/resumeorentire status - Be significantly faster (no session setup overhead)
- Not contribute to session count / latency scaling
If a full session is needed for some reason, at minimum spawn it as a sub-agent (Claude Code Task tool) rather than a top-level session - sub-agents don't appear in /resume by default.
Impact
- ENCLI-123 latency scales with session count - these ghost sessions directly worsen it
/resumebecomes unusable when 50%+ of entries are "initialization prompt" noiseentire cleandoesn't remove these since they're technically "active" sessions
Environment
- macOS Darwin 24.4.0
- Claude Code 2.1.58
entirewith manual-commit strategy- Daily latency monitoring via cron (see ENCLI-123 for dataset)