[FEATURE] Allow specifying working directory for agent teams

Resolved 💬 3 comments Opened Feb 22, 2026 by ro0sterjam Closed Feb 25, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

I work in a multi repo environment and sometimes work is split across these repos.

At the same time, the LSP servers seem to load only if claude is opened in the corresponding project's directory.

The problem is that claude does not seem to be able to specify which directory in which to spawn these team mates.

e.g.

main agent loaded in ~/dev/
spawn team mate 1 in ~/dev/project1
spawn team mate 2 in ~/dev/project2

Proposed Solution

Add a flag to the team mate spawn tool to allow specifying the working directory for the new team mate.

Task({
  subagent_type: "general-purpose",
  team_name: "worktree-test",
  name: "teammate-main",
  working_directory: "~/dev/project1",
  prompt: "Work on the main branch"
})

Alternative Solutions

_No response_

Priority

High - Significant impact on productivity

Feature Category

CLI commands and flags

Use Case Example

  1. Microservice environment
  2. Each service lives in a different repo
  3. Work spans multiple repos
  4. Use agent teams to work across all repos
  5. Launch each agent in the repo dir so that LSP servers for each project load appropriately

Additional Context

Additionally it would be great if simultaneously new worktrees can be created for these new agents and for them to be spawned under those worktrees.

e.g.

  1. main agent spawns 2 mates
  2. mate 1 spawned in ~/dev/project1/.claude/worktrees/task1
  3. mate 2 spawned in ~/dev/project2/.claude/worktrees/task1

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗