# openspec/changes/wf-hand-a-session-to-a-teammates-agent/proposal.md

## Why

A teammate goes on leave halfway through a task. Their Claude Code session holds the plan, the dead ends and the open questions, and the person taking over uses Codex, which starts from nothing. The next agent starts where the last one stopped instead of finding the same dead ends again.

## What Changes

- Turn on the `hand-a-session-to-a-teammates-agent` use case for a team. The agent does it inside its own session through the product's MCP tools; there is no workflow run.
- RepoOps: Check the teammate can see the source session (today: Built).
- RepoOps: Write the handoff in the target agent's resume format (get_agent_handoff) (today: Built).
- RepoOps: Log the handoff on the source session (today: Built).
- Count no workflow request: it is not a workflow run.

## Impact

- Products: RepoOps.
- Outside the family: Claude Code, Codex or Gemini CLI on the teammate's machine.
- State: Partly built. Handoff is built and off until switched on: get_agent_handoff and repoops handoff write a resume file for Claude Code, Codex or Gemini CLI with the recap, the files changed, open questions, approaches ruled out and links to the source session and its commits (repo-dashboard #7600). A teammate can take a handoff only for a session they can see, and each handoff is logged on the source session. The production check is still to go.
- Plan row: none yet (Proposed).

# openspec/changes/wf-hand-a-session-to-a-teammates-agent/tasks.md

## 1. Connect and authorize

- [ ] 1.1 Confirm the org has a connection for each of: RepoOps. Stop and tell the user which is missing.
- [ ] 1.2 Get a PromptReports ID agent token for each product the run calls (RFC 8693 exchange). Where a product does not accept ID tokens yet, use its connect key.
- [ ] 1.3 Confirm the team's admin has switched the feature on; each is off by default.

## 2. Build the steps

- [ ] 2.1 RepoOps: Check the teammate can see the source session.
- [ ] 2.2 RepoOps: Write the handoff in the target agent's resume format (get_agent_handoff).
- [ ] 2.3 RepoOps: Log the handoff on the source session.

## 3. Verify

- [ ] 3.1 Do it once in a real session with the user's inputs: Session = The source session id; To = codex.
- [ ] 3.2 Measure the outcomes: Handoffs taken; Approaches a handoff ruled out that the next session tries again.

# openspec/changes/wf-hand-a-session-to-a-teammates-agent/specs/workflow-hand-a-session-to-a-teammates-agent/spec.md

## ADDED Requirements

### Requirement: Only a session you can see

A handoff SHALL be written only for a session the person asking can see.

#### Scenario: Only a session you can see

- **WHEN** the source session is private to its author
- **THEN** the handoff is refused and nothing is written

### Requirement: Evidence stays honest

Each step SHALL report what it saw as measured, inferred or missing, and SHALL never report missing as measured.

#### Scenario: A product part is not built

- **WHEN** a step depends on a part that is Planned or Proposed
- **THEN** the step records `missing`, names the part, and the approval card shows the gap

### Requirement: Nothing is counted

The use case SHALL count no workflow request, because it is not a workflow run.

#### Scenario: An agent uses it ten times in one session

- **WHEN** the agent calls the tools ten times
- **THEN** the org's usage does not change
