Resume a Session
Continue a previous conversation with full model/agent/history restored
Resume a previous conversation exactly where you left off — same model, same agent, same chat history.
graph LR
subgraph "Session Resume Flow"
ID[🔑 Session ID] --> PS[📂 Project Store]
PS -->|found| RS[✅ Restored State]
PS -->|not found| GS[🌐 Global Store]
GS --> RS
RS --> CP[▶️ Continue]
end
classDef input fill:#6366F1,stroke:#7C90A0,color:#fff
classDef store fill:#F59E0B,stroke:#7C90A0,color:#fff
classDef output fill:#10B981,stroke:#7C90A0,color:#fff
class ID input
class PS,GS store
class RS,CP outputQuick Start
- Find your session ID
bash praisonai session listCopy the session ID from the output table.
- Or skip the id — pick from a list
On an interactive terminal, omit the id to open a picker of recent sessions:
bash praisonai session resumeSelect a session to resume # Title Updated Messages Tokens Cost 1 fix-auth-bug 2026-09-22T14:31:07 12 12,440 $0.0710 2 draft-release 2026-09-22T11:02:44 5 3,120 $0.0180 Session number (0 to cancel):Type a number to resume that session, or
0to cancel. See Interactive Picker. - Resume the session
bash praisonai session resume <session_id>The CLI restores your prior model, agent name, full chat history, and cumulative usage totals, then shows:
╭─ Session Resumed ──────────────────────────────────╮ │ Session: my-assistant │ │ Model: anthropic/claude-3-5-sonnet-latest │ │ Messages restored: 12 │ │ Usage: 12,440 tokens · $0.0710 (3 requests) │ ╰─────────────────────────────────────────────────────╯ --- Restored Conversation --- [user] What is the capital of France? [assistant] Paris.The
Usageline appears only when token/cost data has been accumulated for the session. Cumulative totals keep accumulating from this point — they do not reset. - Continue with a new prompt
bash praisonai session resume <session_id> "What about Germany?"Passes the resumed state directly into the same run path as
praisonai run --session. - Give the session a friendly title (optional)
Rename the session so it’s easy to spot in
session list— the id you resume with never changes:bash praisonai session rename <session_id> "fix-auth-bug"The title then surfaces in the
Namecolumn ofsession list. See Session Rename for details. - View transcript only (read-only)
bash praisonai session resume <session_id> --transcriptPrints recent events without restoring state — useful for reviewing a session without continuing it.
Resume into the interactive TUI
The same resume primitive is available on the bare praisonai interactive launch — no need to type /continue inside a cold TUI. As of PR #4943, the interactive TUI auto-persists every conversation, so this primitive now has data to resume against on a fresh install — you no longer need to have previously passed --auto-save:
# Most recent session
praisonai -c
# Specific session id (equivalent to praisonai session resume <id> without a follow-up prompt)
praisonai --session <id>
# Fork non-destructively
praisonai --fork --session <id>The recorded session model is restored, the prior transcript is replayed into scrollback, and the primary agent is wired to the resumed session’s store so your next prompt continues the conversation with full memory of prior turns.
Added in PR #4912 as parity with run --continue / chat --continue. See Interactive TUI → Launching with a resumed session.
Interactive Picker
Omit the session id on an interactive terminal and the CLI opens a picker of recent sessions — no more copy-pasting an opaque id.
The picker fires only when all of these hold: a real TTY, no --json, and no id passed. It lists the same project-scoped sessions as session list (most-recently-updated first, up to 20).
Select a session to resume
# Title Updated Messages Tokens Cost
1 fix-auth-bug 2026-09-22T14:31:07 12 12,440 $0.0710
2 draft-release 2026-09-22T11:02:44 5 3,120 $0.0180
Session number (0 to cancel):Enter a number 1..N to resume that session, or 0 to cancel. Ctrl-C / EOF also cancels.
graph TB
Start([praisonai session resume]) --> Has{Session id<br/>passed?}
Has -->|Yes| Rehydrate[📂 rehydrate_session]
Has -->|No| Mode{TTY & not --json?}
Mode -->|No| Err[❌ Missing session id]
Mode -->|Yes| List[📋 list_project_sessions limit=20]
List --> Empty{Rows?}
Empty -->|None| NoS[ℹ️ No sessions found]
Empty -->|>=1| Pick[🔢 Session number<br/>0 to cancel]
Pick -->|0 / Ctrl-C| Cancel[ℹ️ Cancelled]
Pick -->|1..N| Rehydrate
classDef input fill:#6366F1,stroke:#7C90A0,color:#fff
classDef check fill:#F59E0B,stroke:#7C90A0,color:#fff
classDef action fill:#189AB4,stroke:#7C90A0,color:#fff
classDef ok fill:#10B981,stroke:#7C90A0,color:#fff
classDef err fill:#8B0000,stroke:#7C90A0,color:#fff
class Start input
class Has,Mode,Empty check
class List,Pick action
class Rehydrate ok
class Err,Cancel,NoS errWhen it exits without resuming
The picker never silently starts a fresh run. Three cases exit without resuming:
| Case | Message |
|---|---|
| Empty store | No sessions found |
Cancel (0, Ctrl-C, EOF) | Cancelled |
| Listing failure | Could not list sessions: <error> + → Use 'praisonai session list' to inspect the session store |
Non-TTY / --json
Scripts and CI are unaffected — the id stays required. With no id under --json or a non-TTY, the command errors instead of prompting:
Error: Missing session id
→ Pass a session id, or run interactively to pick oneHow It Works
sequenceDiagram
participant User
participant CLI
participant ProjStore as Project Store
participant GlobalStore as Global Store
participant Session as RehydratedSession
participant Run
User->>CLI: session resume <id>
CLI->>ProjStore: session_exists(id)?
alt found in project store
ProjStore-->>CLI: session data
else not found
CLI->>GlobalStore: session_exists(id)?
GlobalStore-->>CLI: session data
end
CLI->>Session: build RehydratedSession
Session-->>CLI: chat_history, model, agent_name
CLI-->>User: show "Session Resumed" panel
opt prompt supplied
CLI->>Run: _run_prompt(prompt, model, session)
endThe rehydrate_session() helper searches stores in order and returns a RehydratedSession dataclass:
from dataclasses import dataclass, field
from typing import Optional
@dataclass
class RehydratedSession:
session_id: str
chat_history: list[dict[str, str]] = field(default_factory=list)
model: Optional[str] = None
agent_name: Optional[str] = None
metadata: dict = field(default_factory=dict)
usage: dict = field(default_factory=dict) # cumulative token/cost totals
found: bool = FalseWhen found is False, the CLI prints:
Error: Session not found: <session_id>
→ Use 'praisonai session list' to see available sessionsModel Restoration
Resuming restores the model the session was running with — not the current default. Change your default model between runs and a resumed session still runs on the original model.
graph TB
Q{--model passed?} -->|Yes| M[Use --model<br/>update recorded]
Q -->|No| C{Config has agent.model?}
C -->|Yes| CM[Use config model]
C -->|No| R{Session has recorded model?}
R -->|Yes| RM[Restore recorded model]
R -->|No| D[Fall through to default]
classDef pick fill:#F59E0B,stroke:#7C90A0,color:#fff
classDef ans fill:#10B981,stroke:#7C90A0,color:#fff
classDef fall fill:#6366F1,stroke:#7C90A0,color:#fff
class Q,C,R pick
class M,CM,RM ans
class D fallWhen the recorded model is used, the CLI prints:
Restored session model: anthropic/claude-3-5-sonnet-latestPrecedence (first match wins): explicit --model → config agent.model → recorded session model → keyless local-first fallback → default resolution.
Override the recorded model
Pass --model on resume — it wins and becomes the new recorded model for subsequent turns.
praisonai session resume abc123 --model gpt-4o "continue with a different model"Where the model comes from
The store resolves the recorded model in this order: the session-level metadata["model"] (written by the session-continuity path), then the model on the most recent turn that recorded one. When neither exists, restoration is skipped and normal default resolution applies.
Legacy sessions
Sessions written by older PraisonAI versions stored model / llm as top-level fields rather than under metadata. The store folds those legacy fields back into metadata on load, so historical sessions recover their recorded model on resume without any migration step. Existing metadata values always win over the mirrored top-level value.
Cumulative Usage Across Resumes
Token and cost totals accumulate across all runs for a session. When you resume and run more prompts, the totals grow — they are never reset.
graph LR
Run1[▶️ First run] --> Store1[💾 Store: 1,240 in / 3,980 out]
Store1 --> Resume[⏩ Resume]
Resume --> Run2[▶️ Next run]
Run2 --> Store2[💾 Store: 2,480 in / 7,960 out]
classDef run fill:#8B0000,stroke:#7C90A0,color:#fff
classDef store fill:#189AB4,stroke:#7C90A0,color:#fff
classDef resume fill:#F59E0B,stroke:#7C90A0,color:#fff
class Run1,Run2 run
class Store1,Store2 store
class Resume resumeThe store that already holds usage metadata takes priority on resume — a globally-stored session resumed via the project store keeps its original totals intact.
Project vs Global Store
The resume helper always searches the project-scoped store first, then falls back to the global default store. This means sessions created inside a project are resolved with higher priority, and you can still resume cross-project sessions by ID.
graph TB
Start([Resume request]) --> PS{Project store<br/>has session?}
PS -->|Yes| Use1[Use project session]
PS -->|No| GS{Global store<br/>has session?}
GS -->|Yes| Use2[Use global session]
GS -->|No| Err[❌ Session not found]
classDef start fill:#8B0000,stroke:#7C90A0,color:#fff
classDef check fill:#F59E0B,stroke:#7C90A0,color:#fff
classDef ok fill:#10B981,stroke:#7C90A0,color:#fff
classDef err fill:#8B0000,stroke:#7C90A0,color:#fff
class Start start
class PS,GS check
class Use1,Use2 ok
class Err errThe project_path parameter (optional, defaults to cwd) controls which project store is searched first. Use it when running resume from a different working directory:
praisonai session resume <id>Flags
| Flag | Description |
|---|---|
<session_id> | Session ID to restore — optional on a TTY (omit to open the interactive picker); required in --json / non-TTY |
[PROMPT] | Optional prompt to continue the session immediately |
--transcript | Show transcript only — do not restore state |
Relation to run --continue / run --session
praisonai session resume and praisonai run --session <id> call the same rehydrate_session() helper under the hood. The outcomes are identical: same chat history, same model, same agent. Use whichever form fits your workflow.
# These are equivalent:
praisonai session resume abc123 "next question"
praisonai run --session abc123 "next question"As of the fix for PraisonAI #2655, run --continue also searches both stores when finding the last session — before, only session resume did.
As of praisonai/PraisonAI#3203, both the resume path and the show/delete/export path enumerate the same store instances (same classes, same order) by delegating to a single canonical_cli_stores() helper — so an id you can resume is guaranteed to also be show-able, delete-able, and export-able.
Best Practices
Pin a session ID in scripts for reproducibility
Store the session ID in an environment variable or config file so automation scripts always resume the correct conversation:
SESSION_ID="abc-123-def"
praisonai session resume "$SESSION_ID" "run daily report"Use –transcript only for read-only viewing
--transcript shows events without restoring state, making it safe to inspect a live session from a second terminal without risk of creating conflicting state.
Resume after switching machines
The global store covers cross-machine cases when the same project root is checked out. Sessions written to the project-scoped store travel with the project directory.
Check session list before resuming
Always run praisonai session list first to confirm the session ID and its message count before resuming — especially after long gaps.
Use the interactive picker for exploratory resume
Omit the id and let the picker surface recent sessions when you’re browsing rather than resuming a known id. Scripts and CI should still pass an explicit id — the picker never fires under --json or a non-TTY.