Skip to main content
Hand off unfinished work from a local coding agent to an Orq.ai agent session without committing or pushing first. The orq sessions handoff command sends the working-tree diff as a patch and starts a session whose first run sees the patch already applied in the cloned workspace.

Prerequisites

  • The orq CLI installed and authenticated (orq login).
  • A factory whose policy allows the repository and agent.
  • A local git checkout with the changes to hand off.

Hand off the current diff

The command resolves the repository URL from the origin remote and the ref from the current branch, sends the diff on stdin as the patch, creates the session, and prints the session URL to stdout.

Flags

How the patch is applied

The patch is a unified diff, at most 1 MiB, applied with git apply --3way in the cloned workspace after the clone (or snapshot restore) and before the first run. The session log records a session.patch_applied event with the file, insertion, and deletion counts. A patch that does not apply records session.patch_failed with the git message and the run still starts, so the agent can resolve the conflict markers itself. The patch is applied exactly once; pausing and resuming the session does not re-apply it.

From a file instead of a pipe

Continue an existing session

Use the REST API (POST /v2/agent-sessions/{session_id}/runs) or the session page to send the next message. The handoff command starts the first run; follow-up messages are continue runs on the same conversation.