[FEATURE] Allow specifying working directory for agent teams
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
- Microservice environment
- Each service lives in a different repo
- Work spans multiple repos
- Use agent teams to work across all repos
- 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.
- main agent spawns 2 mates
- mate 1 spawned in ~/dev/project1/.claude/worktrees/task1
- mate 2 spawned in ~/dev/project2/.claude/worktrees/task1
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗