Skip to main content
Session handoff assembles a continuation prompt from durable state so a fresh context can resume without scrolling.
This is not the same as agent-to-agent handoffs. Session handoff assembles a continuation prompt from durable state for a fresh context; agent-to-agent handoffs route control between agents mid-run.

Quick Start

1

Hand off the most recent session

2

Hand off a specific session

3

Build a handoff prompt from Python


How It Works

The CLI resolves a session, reads its durable stores, and calls build_handoff_prompt to render the prompt — no LLM call, no state mutation. Each section maps to one durable source and is omitted when that source has no data.

Example Output

The Quick Start inputs render this prompt verbatim:
Add a STATUS: line by setting last_reason on the goal state, and a KEY FILES: line by passing key_files=:

Python Options

build_handoff_prompt is keyword-only. Every argument maps to a durable source.

CLI Options

praisonai session handoff prints the continuation prompt for a session. When the id can’t be resolved the command exits with code 1:

Key Properties

No LLM call — the same durable state always renders the same prompt.
Assembly reads only local durable stores, so it never blocks the hot path and never raises into the loop.
The prompt is hard-capped at max_chars (default 4000) by trimming the middle recap while preserving the actionable NEXT: line verbatim.
Handoff assembles a prompt from durable state. It does not restore conversation (use --continue / resume) and does not mutate session state.

Choosing the Right Resume Path

Different goals call for different commands — pick the one that matches your intent.

Context Compaction

Durable recap and structured summaries that feed the handoff prompt

Session CLI

List, resume, recap, and hand off sessions from the terminal

/recap bot command

The chat counterpart of the read-only recap

Agent Handoffs

Not to be confused — agent-to-agent control routing