Garbled [Dynamic Context] block leaks shredded system-prompt/skill content into tool output after auto-compaction

Open 💬 1 comment Opened Jul 3, 2026 by zoharsf

Bug description

After a conversation goes through auto-compaction (context summarization), tool-result output in the same session starts being followed by a garbled block headed [Dynamic Context], containing dozens of short, disconnected text fragments. The fragments are verbatim shreds of content that is legitimately part of the session's own system prompt / loaded context (agent tool descriptions, skill text from installed plugins like superpowers, and my own project CLAUDE.md contents) — not external or untrusted data.

It reads like a corrupted re-serialization of context state rather than intentional output, and recurs multiple times per session once it starts.

Repro pattern observed

  • Session hit auto-compaction once (long conversation, context summarized).
  • After that point, ordinary tool calls (Bash, Read, etc.) began returning a trailing block appended after normal output, e.g.:
[Dynamic Context]
- in_progress
- work. This is just a gentle reminder - ignore if not applicable.
- conversation was summarized
- GRAPH_REPORT
- claude-code-guide
- using-superpowers
- SUBAGENT-STOP
- EXTREMELY-IMPORTANT
- systematic-debugging
- codex-tools
- pi-tools
- antigravity-tools
...
  • Fragments match: (a) the user's own CLAUDE.md files loaded into context, (b) the superpowers plugin's skill/hook text (e.g. "using-superpowers", "SUBAGENT-STOP", red-flag table rows like "this skill" | Skills evolve...), (c) Agent tool's built-in subagent descriptions (claude-code-guide, statusline-setup, general-purpose, etc.).
  • It is preceded by an unrelated nudge: "The task tools haven't been used recently... consider using TaskCreate..." — this nudge + the garbled block appear together, appended to tool results, not as a normal assistant/user turn.

Investigation done

  • Grepped ~/.claude/settings.json, all hook commands, ~/.claude/plugins/** (skills, marketplaces, cache), and ~/.claude/skills/** for the literal string [Dynamic Context] and the pattern ## Dynamic Context — the only match is documentation in claude-code-setup's claude-automation-recommender skill explaining the legitimate !command`` dynamic-context-injection feature for skill frontmatter — it is not the source of this output.
  • Confirmed no installed hook (SessionStart, PreToolUse, etc.) in settings.json emits this text.
  • Concluded this is generated at runtime by the harness itself (not a plugin, not a skill file, not user-editable config), most plausibly during context reconstruction after auto-compaction.

Impact

  • Was initially mistaken for a prompt-injection attempt from tool output (fake instructions embedded in results), which is understandably alarming since it appears as authoritative-looking system-style text mid-session. Wasted investigation time trying to find a source in editable config before concluding it's harness-internal.
  • No malicious content observed in the fragments seen so far (they're inert shredded context), but the pattern (looks like injected "system" instructions) is exactly the shape a real prompt injection would take, which is a trust/UX problem even when benign.

Environment

  • Claude Code CLI (2.1.197)
  • macOS (Darwin 25.5.0)
  • Session used plugins: superpowers, claude-plugins-official (claude-code-setup), warp, palate-cleanser
  • Occurred in a long session that underwent at least one auto-compaction event

Request

  • Confirm whether [Dynamic Context] is an intentional internal mechanism (e.g. related to post-compaction context reconstruction) and if so, why it's leaking into tool-result output visible to the model/user.
  • If it's a genuine bug, please advise if there's any client-side mitigation (e.g. disabling a specific plugin) while a fix is pending, since our own investigation found no editable source to disable it.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗