Desktop app: Run button on a bash code block always fails with "Failed to send the command result to Claude"

Status Open
Reported on v2.1.271
Maintainer reply None cached
Activity 0 comments · opened Sep 16, 2026

Environment

  • Claude desktop app 2.110.0 (macOS, Apple Silicon, Darwin 25.6.0)
  • App-managed CLI: 2.1.271
  • Login shell: /bin/bash (macOS system bash 3.2.57(1)-release), set via chsh
  • Locale: fr-FR
  • Started with the 2026-09-15 app update. Was working before.

Symptom

Clicking Run on a bash code block in the Code tab:

  • the command does run in the Terminal panel tab, output is visible there
  • an inline output box appears under the code block in the chat
  • a toast fires every single time: "Failed to send the command result to Claude. Check the terminal tab." (fr: "Impossible d'envoyer le résultat de la commande à Claude. Vérifiez l'onglet du terminal.")
  • nothing reaches the conversation

100% reproducible, with a command as trivial as echo test-$(date +%s).

Root cause

The app's OSC 133 shell integration is never installed in the terminal PTYs, so the app has no command-start/command-end marks and cannot delimit the output it is supposed to send back.

Evidence

  1. Terminal tabs are spawned as plain /bin/bash -l, with no --init-file:
$ ps -eo pid,ppid,command | grep 'bin/bash -l'
46935 46928 /bin/bash -l
47776 46928 /bin/bash -l
...
$ ps -p 46928 -o command
/Applications/Claude.app/Contents/Frameworks/Claude Helper.app/Contents/MacOS/Claude Helper --type=utility --utility-sub-type=node.mojom.NodeService ...

Per Te() in the bundle, a bash shell invoked with args exactly ["-l"] should be re-spawned as ["--init-file", <dir>/bash/<file>]. It is not.

  1. Inside a freshly opened terminal tab:
PC=[rename_tab]     # PROMPT_COMMAND, not wrapped by __claude_desktop_precmd / __claude_desktop_arm
ARM=no              # declare -F __claude_desktop_arm -> not found
NONCE=              # __claude_desktop_nonce empty
SHELL=/bin/bash BASH=3.2.57(1)-release
  1. The integration directory is never created:
$ ls -d ~/Library/Application\ Support/Claude/terminal-shell-integration
ls: ...: No such file or directory
$ ls -d ~/Library/Application\ Support/Claude/terminal-scrollback
ls: ...: No such file or directory

A full-disk search for files containing __claude_desktop_arm or __claude_desktop_precmd returns nothing, so Ee(r.dir) has never run.

  1. In app.asar, the gate is:
shellIntegration: {
  dir: join(this.userDataPath, "terminal-shell-integration"),
  enabled: () => lF("4044603026")
}
...
async shellIntegrationForSpawn(e, n) {
  let r = this.config.shellIntegration;
  if (!r || this.quitting || !r.enabled() || !we(e.shell)) return;
  this.shellIntegrationDirReady ??= Ee(r.dir)...
}

we("/bin/bash") returns "bash" and the args are exactly ["-l"], so both of those checks pass. The directory is never created, which means the gate returns before Ee(r.dir). That leaves !r or !r.enabled(), i.e. feature flag 4044603026 resolving false on this install.

Nothing in the log files records this. main.log has no [ShellPtyManager] or shell_integration entry, and the toast itself is renderer-side and leaves no trace in claude.ai-web.log.

Ruled out

  • User PROMPT_COMMAND. a sourced shell script of mine sets PROMPT_COMMAND='rename_tab', but the integration script sources the user's dotfiles first and then wraps whatever it finds, so this would not break it.
  • bash 3.2. The integration script explicitly handles pre-5.1 bash (string form of PROMPT_COMMAND, DEBUG trap instead of bash-preexec).
  • Renderer reload. One Loaded https://claude.ai happened mid-test, but runs before and after it failed identically.

What would help

Either ship the integration to this install, or make the Run button degrade gracefully when no marks are available (capture the visible output, or disable the Run button) instead of running the command and then failing to deliver the result with a toast the user can do nothing about.

View original on GitHub ↗