You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: /compact <instructions> sent with the Compact chip on runs two compactions, and the first one ignores the instructions #20222
I searched existing issues and did not find a duplicate.
I included enough detail to reproduce or investigate the problem.
Area
apps/web
Steps to reproduce
Open a Claude thread that shows the Compact {tokens} chip next to the send button (≥100K tokens, prompt cache expired).
Leave the chip on. Type /compact Keep the interface decisions, drop the debugging output and press Enter.
Expected behavior
A single compaction that uses the typed instructions. That's what a bare /compact already does: compact-before-send skips a draft that is itself /compact.
Actual behavior
The client dispatches two turns about 15 ms apart:
a bare /compact from compact-before-send, then
the typed /compact <instructions>, queued behind it.
The first compaction summarizes the full history without the instructions. The second one then runs the instructions against a summary that's already been made. So the instructions can't keep anything the first pass dropped, and the user pays for two compactions.
The cause is that the skip check in ChatView.tsx only matches the exact text /compact:
/compact <instructions> doesn't equal "/compact", so it still gets a bare /compact placed in front of it (L9747-L9753). The check is the same on main @ cfafb4b (line 8879).
Observed three times in one day. In T3's event log, both turns of each pair are separate message.dispatch commands from the web client. Token counts are from Claude Code's compaction records:
Gap between the two dispatches
Compaction 1 (bare)
Compaction 2 (with instructions)
15 ms
130,532 → 12,896 tokens
12,998 → 17,156 tokens
18 ms
201,213 → 16,089 tokens
16,191 → 20,362 tokens
13 ms
122,302 → 9,672 tokens
9,774 → 8,215 tokens
On the same day, 12 other /compact <instructions> sends ran a single compaction as expected. In each of those, the chip wasn't on (the thread was under the token threshold or its cache was still warm).
Impact
Minor bug or occasional failure
Version or commit
0.1.0 (81493ef); the check is unchanged on main @ cfafb4b
Environment
macOS, T3 Code (Beta) desktop, Claude provider
Workaround
Click the chip to switch it to Full before sending /compact <instructions>.
Suggested fix
Skip compact-before-send for any draft that is a /compact command, not only the exact text /compact. For example, use /^\/compact(\s|$)/i.test(messageTextForSend.trim()), plus a test for /compact <args> with the chip on.
Related, but not the same: #17467 / discussion #17170 (whether the chip should default to on), and discussion #19939 (routing /compact <text> through the server's compactThread).
Confirmed on main: the compact-before-send skip in apps/web/src/components/ChatView.tsx only matches the exact text /compact (messageTextForSend.toLowerCase() !== "/compact"). So with the Compact chip on, /compact <instructions> still gets a bare /compact queued in front of it. The first compaction then runs without your instructions.
Until there's a fix, switch the chip to Full before sending /compact <instructions>.
Not a duplicate. #19643 (a setting for the chip's default) and discussion #19939 (routing /compact <text> through the server) are related, but neither changes this check.
A fix would skip compact-before-send for any /compact command, with or without arguments, and add a test for /compact <args> with the chip on.
Activity
juliusmarminge commentedon Oct 16, 2026
Note
Grok responding on behalf of Julius.
Confirmed on main: the compact-before-send skip in
apps/web/src/components/ChatView.tsxonly matches the exact text/compact(messageTextForSend.toLowerCase() !== "/compact"). So with the Compact chip on,/compact <instructions>still gets a bare/compactqueued in front of it. The first compaction then runs without your instructions.Until there's a fix, switch the chip to Full before sending
/compact <instructions>.Not a duplicate. #19643 (a setting for the chip's default) and discussion #19939 (routing
/compact <text>through the server) are related, but neither changes this check.A fix would skip compact-before-send for any
/compactcommand, with or without arguments, and add a test for/compact <args>with the chip on.