[BUG] Referencing a file in the compact command triggers a prompt
Resolved 💬 3 comments Opened Jul 20, 2025 by pegwymonie Closed Jan 5, 2026
Environment
- Platform (select one):
- [* ] Anthropic API
- [ ] AWS Bedrock
- [ ] Google Vertex AI
- [ ] Other: <!-- specify -->
- Claude CLI version: 1.0.56
- Operating System: Debian 12
- Terminal: JetBrains Terminal via SHH w/ Bash
Bug Description
When referencing a file using @filename when using /compact, it triggers both a compact, and a chat message.
Steps to Reproduce
- Have Claude create a multistep plan to implement a large feature.
- Write those steps to markdown files.
- Use the compact command and tell it to focus on the details needed to implement the file using
@filename
Expected Behavior
Just the compaction happens, and the contents of the file are considered for the compaction.
Actual Behavior
Claude Code begins compacting the context, but at the same time also reads the prompt and in this case begins implementing the details in the file included with @
Additional Context
I had approximately 10% context remaining when I invoked compact. The files I asked it to reference should have already been in the context, as they were just written, so it shouldn't have bumped me over the auto-compact threshold.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗