Agent sessions should coordinate work across worktrees
Agent Host sessions can operate in separate worktrees of the same repository. As a result, multiple active sessions may be working on overlapping feature areas even when they have different working directories.
Today, an agent with session-management tools does not consistently check for overlapping work before beginning code changes or creating another session. This can lead to duplicated effort or concurrent edits to the same files.
Before beginning code changes or creating a new session, the agent should use list_sessions to check for relevant active work in the same project or repository, including sessions in other worktrees. If another session may overlap based on its activity, branch, pull request, or changes, the agent should use get_session_context to understand that work and send_message to coordinate when appropriate.
The agent should prefer reusing, coordinating with, or waiting for existing work rather than starting duplicate or conflicting work.
Codex already appears to perform this coordination automatically. Agent Host has the necessary session-management capabilities, so we should provide similar behavior.
Proposed implementation: #330289
Agent sessions should coordinate work across worktrees
Agent Host sessions can operate in separate worktrees of the same repository. As a result, multiple active sessions may be working on overlapping feature areas even when they have different working directories.
Today, an agent with session-management tools does not consistently check for overlapping work before beginning code changes or creating another session. This can lead to duplicated effort or concurrent edits to the same files.
Before beginning code changes or creating a new session, the agent should use
list_sessionsto check for relevant active work in the same project or repository, including sessions in other worktrees. If another session may overlap based on its activity, branch, pull request, or changes, the agent should useget_session_contextto understand that work andsend_messageto coordinate when appropriate.The agent should prefer reusing, coordinating with, or waiting for existing work rather than starting duplicate or conflicting work.
Codex already appears to perform this coordination automatically. Agent Host has the necessary session-management capabilities, so we should provide similar behavior.
Proposed implementation: #330289