Skip to content

polygraph session

Session management

Terminal window
polygraph session
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionbooleanShow the version number for the CLI

Start a new session

Terminal window
polygraph session start [title]
NameTypeDescription
titlestringSession title
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionbooleanShow the version number for the CLI
--repo, -rarray<string>Repositories (ID, full name, or short name)
--primarystring | booleanRepository ID or org/repo name that should host the main agent. Use "none" or --no-primary to start without a primary repo.
--primary-checkout, --prcstringWhat to do with the primary repo: in-place (default, run in the current checkout), fresh-checkout (a fresh copy via the configured strategy), or fresh-checkout-with-changes (a fresh copy with your uncommitted changes applied).
--multiplexer, -mstringOpen delegated child agents in a terminal multiplexer. Defaults to auto. One of: auto, none, tmux, iterm2, kitty, ghostty, cmux, zellij, windows-terminal.
--agent, -astringLaunch the given agent after the session is created. One of: claude, codex, opencode, auto, skip. When omitted, falls back to the interactive prompt (or 'skip' under --json).
--prompt, -pstringInitial task instruction passed to the launched agent. Replaces the default "ask the user what to do" trailer in the agent's startup message. Ignored when --launch is skip or omitted.

List sessions

Terminal window
polygraph session list
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionbooleanShow the version number for the CLI
--sincestringOnly return sessions created on or after this date (YYYY-MM-DD, UTC). Defaults to the last 30 days. Example: --since=2025-01-01
--limitnumber100Maximum number of sessions to return (1–500, default 100).
--filter, -fobjectFilter sessions under a single object option
--filter.statusstringMatch session status (open, archived, stale) using exact values, glob, or CSV patterns. Defaults to active (open) sessions; use '' to include archived and stale. Quote globs, for example 'arch'.
--filter.authorstringMatch session authors using case-insensitive substring, glob, or CSV patterns. Defaults to @me, the current user; use '*' to include all authors.
--filter.initiatorstringMatch the initiator repository using case-insensitive substring, glob, or CSV patterns. Supports @current.
--filter.repostringMatch repositories included in a session using case-insensitive substring, glob, or CSV patterns. Supports @current.
--filter.hasPrsbooleanFilter by whether sessions have at least one linked pull request.

Show session details

Terminal window
polygraph session show [session]
NameTypeDescription
sessionstringSession ID (auto-detects from cwd if omitted)
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionbooleanShow the version number for the CLI
--detailsbooleanfalseInclude a per-repo summary with PR id, url, and description.

Search sessions by free text or commit sha

Terminal window
polygraph session search [query]
NameTypeDescription
querystringSearch query: free text, or a commit sha (7-40 hex chars) to also match the linked session
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionbooleanShow the version number for the CLI
--limitnumberMaximum number of results (1–50, default 5). Ignored by the interactive browser.
--shastringExact lookup of the session linked to a commit by full or partial (7+ hex chars) sha, without free-text matches. Mutually exclusive with a query.

Show agent transcripts for a session (parent by default)

Terminal window
polygraph session logs [session]
NameTypeDescription
sessionstringSession ID (auto-detects from cwd if omitted)
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionbooleanShow the version number for the CLI
--tailstringPage size: show N transcript entries per page (default 20). Pass --tail none for the full log. --json returns the full transcript unless --tail or --page is set.
--pagenumber1-based page within the --tail-sized windows (default 1 = newest). Higher pages step backward through history.
--repo, -rstringShow the child agent transcript for one repository (ID, full name, or short name) instead of the parent transcript
--allbooleanShow the parent transcript plus every child agent transcript

Open a shell in a session repository

Terminal window
polygraph session dir [session] [repo]
NameTypeDescription
sessionstringSession ID (auto-detects from cwd if omitted)
repostringRepository (ID, full name, or short name)
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionbooleanShow the version number for the CLI
--rootbooleanfalseOpen the session root instead of a repo
--printbooleanfalsePrint the selected directory instead of launching a shell
--commandstringRun a shell command in the selected directory instead of launching a shell

Update the current session title and/or description

Terminal window
polygraph session update [session]
NameTypeDescription
sessionstringSession ID (auto-detects from cwd if omitted)
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionbooleanShow the version number for the CLI
--title, -tstringTitle text to save with the session
--descriptionstringDescription text to save with the session

Resume a session and wait for explicit user instructions

Terminal window
polygraph session resume [session]
NameTypeDescription
sessionstringSession ID (auto-detects from cwd if omitted)
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionbooleanShow the version number for the CLI
--multiplexer, -mstringSet the terminal multiplexer for this resume. Defaults to auto. Pass none for no multiplexer. One of: auto, none, tmux, iterm2, kitty, ghostty, cmux, zellij, windows-terminal.
--agent, -astring | booleanChoose the agent to resume the session with. Pass claude, codex, opencode, or auto to switch directly, or pass --agent with no value to choose interactively.

Resume a session for review — the agent answers questions instead of continuing the work

Terminal window
polygraph session review [session]
NameTypeDescription
sessionstringSession ID (auto-detects from cwd if omitted)
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionbooleanShow the version number for the CLI
--multiplexer, -mstringSet the terminal multiplexer for this review. Defaults to auto. Pass none for no multiplexer. One of: auto, none, tmux, iterm2, kitty, ghostty, cmux, zellij, windows-terminal.
--agent, -astring | booleanChoose the agent to review the session with. Pass claude, codex, opencode, or auto to switch directly, or pass --agent with no value to choose interactively.
--adversarialbooleanfalseRun an adversarial review: the agent loads the adversarial-review skill and spawns an independent reviewer agent per repository.

Archive a session

Terminal window
polygraph session archive [session]
NameTypeDescription
sessionstringSession ID (auto-detects from cwd if omitted)
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionbooleanShow the version number for the CLI
--cleanbooleanfalseRemove cloned repos after archiving

Clean up local files for archived or old sessions

Terminal window
polygraph session prune
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionbooleanShow the version number for the CLI
--sessionarray<string>Session ID(s) to prune directly. Repeat for multiple sessions.
--yes, -ybooleanfalseClean up all matching sessions without prompting
--statusstringFilter selected sessions by status using substring, glob, or CSV patterns.
--authorstringPreselect sessions by author using substring, glob, or CSV patterns.
--hasPrsbooleanPreselect sessions based on whether they have linked pull requests.
--older-thannumber30Preselect open sessions with no movement for more than this many days.

Link an external reference to a session

Terminal window
polygraph session link-reference
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionbooleanShow the version number for the CLI
--session, -sstringSession ID (auto-detects from cwd if omitted)
--typestringExternal reference type
--reference-url, --refstringReference URL
--labelstringDisplay label for the reference
--referenceSessionIdstringReferenced Polygraph session ID. Required when --type=session.

Add repositories to a session

Terminal window
polygraph session add-repo [repo]
NameTypeDescription
repoarray<string>Repositories to add (ID, full name, or short name)
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionbooleanShow the version number for the CLI
--session, -sstringSession ID (auto-detects from cwd if omitted)

Manage session artifacts

Terminal window
polygraph session artifacts
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionbooleanShow the version number for the CLI

Attach a plan, image, or file to a session (from --file or stdin)

Terminal window
polygraph session artifacts upload
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionbooleanShow the version number for the CLI
--session, -sstringSession ID (auto-detects from cwd if omitted)
--filestringPath to the file to upload. Omit to read content from stdin (requires --name).
--namestringArtifact name (unique per session; re-uploading a name adds a version). Defaults to the file name.
--kind"plan" | "image" | "file"Artifact kind. Inferred from the name/content type when omitted.
--format"markdown" | "html" | "text"Plan rendering format (plan artifacts only).

List a session’s artifacts

Terminal window
polygraph session artifacts list
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionbooleanShow the version number for the CLI
--session, -sstringSession ID (auto-detects from cwd if omitted)

Download an artifact by name

Terminal window
polygraph session artifacts download [name]
NameTypeDescription
namestringArtifact name to download
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionnumberVersion number to download. Defaults to the latest.
--session, -sstringSession ID (auto-detects from cwd if omitted)
--outstringWrite to this path. Omit to stream bytes to stdout.

Delete an artifact and all of its versions by name

Terminal window
polygraph session artifacts delete [name]
NameTypeDescription
namestringArtifact name to delete
FlagTypeDefaultDescription
--help, -hbooleanShow help for the current command
--versionbooleanShow the version number for the CLI
--session, -sstringSession ID (auto-detects from cwd if omitted)