Compaction loses operational knowledge, causing repeated user corrections
Resolved 💬 3 comments Opened May 2, 2026 by logimania Closed May 2, 2026
Problem
When context compaction occurs during a session, Claude Code loses all operational knowledge gained during the conversation. This forces the user to re-teach the same information repeatedly, significantly reducing productivity.
What gets lost
Compaction preserves high-level summaries (e.g., "strategy was changed from X to Y") but drops practical operational details:
- Server connection info: SSH host, paths, node binary locations
- Database schemas: column names, date formats (e.g., YYYYMMDD vs YYYY-MM-DD)
- Service management: systemd service names, restart commands, which operations require sudo
- Deploy workflows: build → scp → commit → push → restart (as a single workflow)
- Display preferences: how the user wants data formatted and presented
- Environment context: whether the user is on the server or local machine
Impact
In a real session today, compaction caused:
- Wasted ~30 minutes re-discovering VPS connection info, DB schema, and service management
- Incorrectly reported "zero bets today" due to wrong date format in query
- Manually killed a running service instead of using systemctl restart, causing a service outage
- Repeatedly added unnecessary ssh/! prefixes when the user was already on the server
- User had to correct the same mistakes 5+ times in a single session
Current workaround
Manually saving operational knowledge to the memory system. But this is reactive — knowledge only gets saved after the user corrects a mistake, not proactively when it's first learned.
Suggestions
- Auto-extract operational facts before compaction: Identify connection strings, paths, schemas, commands, and user-corrected behaviors and persist them automatically
- Compaction should preserve corrections: When a user corrects Claude's behavior, these should be treated as high-priority retention items
- Proactive memory saving: When Claude learns something environment-specific, save to memory immediately rather than waiting for compaction to lose it
- Same problem exists across agent switches and new sessions: Operational knowledge doesn't transfer, requiring re-teaching for every new context
Environment
- Claude Code CLI on Windows 11
- Model: Claude Opus 4.6 (1M context)
- Project involves SSH to VPS, systemd services, SQLite databases, Node.js deployment
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗