Background-task chips: let the model recommend local vs worktree and preselect it

Status Open
Reported on v2.1.222
Maintainer reply None cached
Activity 0 comments · opened Aug 14, 2026

Feature request

Let the model declare a recommended workspace mode (local vs worktree) and a target cwd when it creates a background-task chip via the session spawn_task tool, and have the chip UI preselect that recommendation.

Problem

When Claude flags an out-of-scope issue with spawn_task, the desktop app shows a chip the user can start with one click. The start flow currently leads with the worktree option, so unless the user is deliberately careful, muscle memory starts the task in a worktree of the current repo — even when that is the wrong choice.

Concrete case: a session working in repo A spawned a chip whose task edits two other repos by absolute path (a shared CLI tool's canonical source repo, plus a second repo that vendors it). The correct choice was local — a worktree of repo A isolates nothing relevant and just leaves a stray worktree behind. The chip UI had no way to know that, and the model had no way to say it.

Proposal

  1. Add optional fields to spawn_task (session MCP), e.g.:
  • recommended_workspace: "local" | "worktree"
  • cwd already exists — but let it also drive where a worktree is created, so a reflexive worktree click on a cross-repo task still isolates the right repo rather than the spawning session's repo.
  1. In the chip's start flow, preselect the recommended option (and show a small hint like "recommended by the session"), keeping the other option one click away.

The model authoring the chip has the context to know whether the task is repo-local, cross-repo, or absolute-path work; today that knowledge has nowhere to go except prose in the title, which competes with a UI default pointing the other way. Making the careless path correct beats requiring care.

Environment

  • Claude Code desktop app (macOS), CLI 2.1.222
  • Chips created via mcp session spawn_task from an interactive session

🤖 Generated with Claude Code

View original on GitHub ↗