[BUG] Desktop Settings: "Branch prefix" (ccBranchPrefix) cannot be set empty — reverts to default "claude"

Open 💬 0 comments Opened Jul 10, 2026 by cuni0716

Environment: Claude Code desktop app (macOS), version 1.20186.0, macOS 26.5.2.

Summary: In Settings → Claude Code → Pull requests, the "Branch prefix" field cannot be cleared. Emptying it doesn't persist — the effective prefix stays claude, so every local/cloud branch is created as claude/<name>. There is no way to opt out of a branch prefix entirely.

Steps to reproduce:

  1. Settings → Claude Code → Pull requests → "Branch prefix" (shows claude).
  2. Delete the text so the field is empty; click away / save.
  3. Reopen settings → the field shows claude again.
  4. New sessions/worktrees still produce branches named claude/<name>.

Workaround attempted (also fails): Edit the store directly — ~/Library/Application Support/Claude/claude_desktop_config.jsonpreferences.ccBranchPrefix = "", then fully quit (⌘Q) and relaunch. The value persists as "" in the file, but branches are still created with the claude/ prefix.

Likely root cause (from reading the bundled app.asar): the branch-name builder is effectively

getBranchName(e){
  const r = He ?? getAppPreference("ccBranchPrefix");
  return r === "" ? e : `${valid(r) ? r : "claude"}/${e}`;
}

so an empty string is explicitly supported and means "no prefix". But the read path returns the default "claude" for an empty stored value (empty string appears to be coalesced to the default, e.g. value || default), so the r === "" branch is never reached. Net effect: an empty prefix is unreachable from both the Settings UI and the on-disk store.

Expected: clearing the branch prefix persists as empty and produces branches with no prefix (<name> instead of claude/<name>).

Possibly related: #63753 (ccBranchPrefix ignored in some worktree-creation paths).

View original on GitHub ↗