[Bug]: Updating Claude on Linux corrupts CLI symlink with T3CODE_ENV_XDG_DATA_HOME markers #32637
Before submitting#
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area#
apps/desktop
Steps to reproduce#
Start with a working native Claude Code installation at
~/.local/bin/claude.Open T3 Code → Settings → Providers.
Confirm Claude is detected and authenticated (v2.1.308 in my case).
Click Update all.
Observe the notification:
Provider update failed — Claude: Update command completed, but T3 Code could not verify the provider version.
Claude now shows
Not found, and runningclaude --versionin a normal terminal returnsclaude: command not found.
This happened on my first attempt. I have not tested whether it reproduces consistently.
Expected behavior#
- T3 Code updates Claude without corrupting its executable symlink.
- Environment-variable discovery returns a clean filesystem path.
- If the update fails, the existing executable remains functional.
- T3 Code reports an actionable error instead of leaving the CLI unusable.
Actual behavior#
Inspecting the symlink:
ls -l ~/.local/bin/claude
I got this:
torbjorn[~]$ ls -l ~/.local/bin/claude
lrwxrwxrwx 1 torbjorn torbjorn 115 nov 7 21:15 /home/torbjorn/.local/bin/claude -> ''\'''$'\a''__T3CODE_ENV_XDG_DATA_HOME_START__'$'\n\033'']0;printenv XDG_DATA_HOME'$'\a\033'']0;true'$'\a\033'']0;printf '\''%s'$'\n'\'' '\''/claude/versions/2.1.319'
Its target contains the following unexpected content (abridged to show the significant bytes):
$'\a'__T3CODE_ENV_XDG_DATA_HOME_START__
$'\n\033']0;printenv XDG_DATA_HOME
$'\a\033']0;true
$'\a\033']0;printf '%s'
...
/claude/versions/2.1.319
Instead of an absolute filesystem path, the symlink contains T3 Code environment-probe markers and terminal escape sequences.
The expected target version was also absent:
~/.local/share/claude/versions/
2.1.308
2.1.39
The original version remained installed, but the CLI was inaccessible through its normal command.
Impact#
Major degradation or frequent failure
Version or commit#
0.1.8-nightly.20261107.4327
Environment#
Ubuntu Linux, x86_64
Logs or stack traces#
Screenshots, recordings, or supporting files#
No response
Workaround#
I can restore Claude v2.1.308 by repairing the symlink:
ln -sfn "$HOME/.local/share/claude/versions/2.1.308" \
"$HOME/.local/bin/claude"tobbelobb(GitHub profile, opens in a new tab) added labelsbug
tobbelobb(GitHub profile, opens in a new tab) added labelsneeds-triage
Workaround until the PR is merged: I added some guards.
Earlier I had something like this in my .bashrc:
preexec() { ... } trap 'preexec' DEBUGNow I have some guards around that:
preexec() { # Never write terminal escape sequences to pipes or files. [[ -t 1 ]] || return ... } # Install the hook only for an interactive terminal. if [[ $- == *i* && -t 1 ]]; then trap 'preexec' DEBUG fiWith the guards, it works as expected.
juliusmarminge closed this
Sign in to join this conversation.
Additional finding: the same environment-discovery bug also prevented Codex v0.167.0 from authenticating inside T3 Code.
codex app-serverworked correctly.account/readrequests failed immediately withworkspace routing discovery failed.XDG_DATA_HOMEandXDG_CONFIG_HOMEvalues containing terminal escape sequences.trap -- 'preexec' DEBUG.Codex then immediately showed
Authenticated · ChatGPT Plus Subscriptionin T3.This provides additional evidence for PR #32646. I have not tested the PR build itself, but the environment-probe fix appears likely to address both failures.