Desktop (Linux): Code tab session started without a project folder runs in a throwaway scratch workspace, silently disabling SessionStart hooks
Preflight Checklist
- [x] I have searched existing requests and this issue is not a duplicate
- [x] This is a single issue (not multiple)
Environment
- Claude Desktop 2.2553.1 (deb package)
- Ubuntu 26.04.1 LTS (server install with KDE Plasma added), Wayland
- Code tab, local session
Summary
When a Code tab session is started without picking a project folder, the app
does not fall back to a real directory. It creates a throwaway workspace:
~/.config/Claude/scratch-workspaces/<uuid>/<uuid>/scratch-<date>-<hash>
This differs from the behaviour described in #79804 (falls back to $HOME)
and #90736 (falls back to the globally last-used folder). In both of those the
cwd is at least a real, persistent directory. Here it is a directory that
exists only for the lifetime of the session.
Impact: SessionStart hooks fail silently
This is the part I have not seen reported. settings.json hooks are shared
between CLI and Desktop, and they do fire in the Desktop app — I verifiedUserPromptSubmit, PreToolUse and Stop all trigger normally.
But a SessionStart hook that derives a workspace identity from cwd gets a
path that matches nothing it knows, so it exits without output. In my setup
that meant no session notes, no required reading, and no issue inbox — and
crucially no error, because "unknown directory, stay quiet" is the correct
behaviour for such a hook. The failure is indistinguishable from "nothing to
report".
A user with project-scoped hooks therefore loses them entirely, with no signal
that anything was skipped.
Steps to reproduce
- On Linux, launch the Desktop app and open the Code tab.
- Start a new session without selecting a project folder.
- Run
pwdin the session.
Expected
The session starts in a real directory — the last-used folder, a configurable
default, or an explicit prompt to choose one.
Actual
The session starts in a per-session scratch directory that is removed when the
session ends.
Request
Either of these would resolve it:
- A configurable default project folder for new Code tab sessions. Cowork
appears to have gained this (see #44933); the Code tab has not. I could not
find any such setting in Settings → Claude Code, nor a documented key in the
settings reference.
- Failing that, do not fall back to a scratch workspace at all — require a
folder, or reuse the last one.
Notes on workarounds I checked
- No CLI flag equivalent exists (the "CLI flag equivalents" table in the
desktop docs lists none for the working directory).
- The
.desktopentry cannot carry one:Exec=claude-desktop %Utakes URLs,
and /usr/bin/claude-desktop is a binary, not a wrapper script.
- The
claude://deep links shipped in the app bundle (code/new,
code/continue, code/needs-input) accept no folder parameter.
Related
- #44933 — Cowork: default project folder (same need, different surface)
- #90736 — new session inherits global last-used folder
- #79804 — session without project folder defaults cwd to
$HOME
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗