catalog / tool-behaviors

Claude Desktop's bash has no state carryover between calls

schema-only

On Claude Desktop, each bash call runs in a fresh shell — exported variables, cd, and background jobs from a previous call do not carry over to the next.

  • Category: tool-behaviors
  • Applies to: Claude.ai ❌ (cwd persists) | Claude Code ✅ (resets — see note) | Claude Desktop ✅
  • Verification tier: schema-only
  • Severity: Behavioral divergence

Symptom

A SKILL.md that runs cd somewhere in one bash call and a follow-up command in another finds itself back at the default working directory.

Cause

On Desktop, each mcp__workspace__bash call is independent — no cwd carryover, no shell state, no environment-variable carryover.

Fix

Combine related shell operations into a single bash call, or pass absolute paths to every command. Don't rely on cd persisting across calls.

Notes

Claude.ai's bash_tool persists cwd across calls. Code's Bash does not (verified on Opus 4.8, 2026-06-14 — it resets to the project directory after each call); see code-bash-no-cwd-or-state-carryover.md. So this non-carryover behavior affects both Desktop and Code — only Claude.ai persists cwd. Skills written and tested on Claude.ai will silently misbehave on the other two.