Background command completion notification HTML-escapes shell metacharacters

Resolved 💬 2 comments Opened May 23, 2026 by mtoy-googly-moogly Closed May 27, 2026

What I saw

After a Bash tool call with run_in_background: true, the completion notification rendered shell metacharacters as HTML entities. For example, the command:

npm run precheck > /tmp/precheck.log 2>&1

was reported back as:

Background command "npm run precheck > /tmp/precheck.log 2>&1" completed (exit code 0)

> shown as > and & as &.

Expected

Raw shell characters in the notification, matching what was passed to the tool.

Actual

HTML-entity-encoded characters.

Impact

  • Copy-paste of the displayed command into a terminal fails (entities are taken literally).
  • Transcripts read awkwardly when shell pipelines are involved.
  • Looks like a "render-to-HTML then re-display-as-text" path that forgot to decode on the second hop.

Repro

Any background Bash tool call whose command contains >, <, &, |, etc. Easy reproducer: echo hi > /tmp/x in the background, then look at the completion notification text.

Environment

  • Claude Code in terminal
  • Model: claude-opus-4-7[1m]
  • OS: macOS (Darwin 25.5.0)

View original on GitHub ↗

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