[Bug] Compact/resume replays stale slash-command ARGUMENTS as current turn

Resolved 💬 3 comments Opened Apr 21, 2026 by KsPsD Closed Apr 24, 2026

Bug Description
Compact/resume re-injects stale slash command ARGUMENTS as current turn

After a session is compacted and resumed, the system-reminder block for
the most recently invoked slash command is replayed with its ARGUMENTS
field intact. The assistant mistakes this replayed ARGUMENTS for a fresh
user request and acts on it.

Reproduction:

  1. Invoke a slash command with args: /my-skill <query text>
  2. Continue the session past the auto-compact threshold
  3. Resume the same session later

Expected: After resume, the next turn starts clean — only the new user
message should drive assistant behavior.

Actual: The skill's system-reminder block is re-injected with the old
ARGUMENTS attached. The assistant treats the stale ARGUMENTS as a new
instruction and executes it (in my case: ran a production DB query the
user did not ask for in the current turn).

Evidence from session jsonl:

  • A {"type":"last-prompt","lastPrompt":"/my-skill ..."} entry

persists across compact.

  • On resume, the skill block contains ARGUMENTS: <old text> sourced

from that last-prompt cache — even though the user's current message
is unrelated.

Impact:

  • Safety issue — assistant can execute unintended actions (DB queries,

writes, external API calls) based on stale ARGUMENTS.

  • Trust issue — looks to the user like the assistant is acting on its

own / hallucinating a task.

Session affected: 8a30a2c4-05d1-4681-9363-8eb4bf7b96f3
Claude Code version: 2.1.112

Environment Info

  • Platform: darwin
  • Terminal: tmux
  • Version: 2.1.112
  • Feedback ID: e17099a8-a7f9-4237-8a51-69456c2348f6

Errors

[{"error":"Error: NON-FATAL: Lock acquisition failed for /Users/<redacted>.local/share/claude/versions/2.1.112 (expected in multi-process scenarios)\n    at Od_ (/$bunfs/root/src/entrypoints/cli.js:2748:2177)\n    at Ke6 (/$bunfs/root/src/entrypoints/cli.js:2748:1257)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-17T00:19:27.404Z"},{"error":"AxiosError: timeout of 5000ms exceeded\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:13335)\n    at emit (node:events:92:22)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:114:3321)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at async doExport (/$bunfs/root/src/entrypoints/cli.js:2685:36234)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-17T01:00:54.827Z"},{"error":"AxiosError: timeout of 5000ms exceeded\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:13335)\n    at emit (node:events:92:22)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:114:3321)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at async doExport (/$bunfs/root/src/entrypoints/cli.js:2685:36234)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-17T10:23:19.782Z"},{"error":"AxiosError: timeout of 5000ms exceeded\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:13335)\n    at emit (node:events:92:22)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:114:3321)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at async QC6 (/$bunfs/root/src/entrypoints/cli.js:439:4055)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-17T16:58:35.948Z"},{"error":"AxiosError: Request failed with status code 401\n    at XU (/$bunfs/root/src/entrypoints/cli.js:110:1194)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12736)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:865:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at async sc1 (unknown)\n    at async Ee9 (unknown)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-19T11:39:24.089Z"},{"error":"Error: ECONNREFUSED\n    at from (/$bunfs/root/src/entrypoints/cli.js:107:7862)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:115:12917)\n    at emitError (node:events:43:23)\n    at <anonymous> (/$bunfs/root/src/entrypoints/cli.js:114:1149)\n    at emitError (node:events:43:23)\n    at <anonymous> (node:_http_client:253:22)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/src/entrypoints/cli.js:117:2467)\n    at async yQH (/$bunfs/root/src/entrypoints/cli.js:253:275814)\n    at async NS6 (/$bunfs/root/src/entrypoints/cli.js:406:3883)\n    at processTicksAndRejections (native:7:39)","timestamp":"2026-04-19T14:48:22.589Z"},{"error":"Error: Was there a typo in the url or port?\n    at from (/$bunfs/root/src/entrypoints/cli.js:107:7862)\n    at <anonymous> (/$bunfs/root/src/ent…

Note: Content was truncated.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗