Skip to main content

ai-sessions

The terminal interaction contract is documented in DESIGN.md.

ai-sessions is a searchable terminal browser for local Codex CLI, Claude Code, and OpenCode conversations. It indexes each harness's existing native history. Browsing is read-only; explicit rename and bridge actions use the provider-specific operations described below.

It runs as sessions on Linux and native Windows PowerShell.

Project and session handles

ses is a shorter name for sessions. Use ses list elev to list a project's sessions, ses open elev-mgr to resume its first manager, or ses desk elev-sup to open the quiet project conversation using the supervisor's current harness. elev-mgr and elev-mgr-1 mean the same session. The menu includes a Handle column.

Inside an agent session, run ! ses whoami or ! ses handle to print that session's handle and title. Add --short for just the handle, or --json for structured output. Lookup uses native thread or verified harness ancestry. If a new session is not indexed yet, open the sessions menu and let it refresh.

See Project and session handles for defaults, editing, project assignment, messaging, and cross-harness behavior. Native IDs and existing slugs remain supported.

In the menu, press m to read the selected conversation's full messages before opening it. Use p/n for older/newer messages, u/a for the latest user or assistant message, and arrows/Page Up/Page Down to scroll. Press q to return. Compressed histories can be previewed without restoring them permanently. Help (?) wraps and scrolls in narrow panes; expanded children have indented titles.

Permanently delete a session

Run from an ordinary interactive shell:

ses delete mine-ses-2 --dry-run
ses delete mine-ses-2
ses delete mine-ses-2 --all-copies

The default scope is the selected native copy; --all-copies selects its explicitly linked copies. The command lists the exact resources, then requires typing the displayed handle. There is no --yes bypass. Running sessions, uncertain ownership, changed storage, unsupported schemas, and dependent children cause refusal. See Deletion details for supported storage and limits.

Session slugs

Every native session copy has a unique, persistent slug, independent of its display name. Names can repeat; IDs and slugs both work in session commands:

sessions --resume elevate-futures
sessions --rename elevate-futures "Elevate futures research"
sessions --set-slug elevate-futures futures-research
sessions --supervise futures-research
sessions --target-log futures-research
sessions send futures-research --message "The build passed."

The same references work with --hide, --unhide, --compress, --decompress, and messaging --from. Message IDs for reply and receipts stay unchanged. Existing unique display names remain accepted for compatibility; ambiguous names fail without selecting a session.

New slugs default to the full session title, preserving capitalization. Characters outside ASCII letters/digits become hyphens; repeated separators are collapsed and leading/trailing separators removed. If the title yields no valid characters, the base is session. Conflicts append -v2, then -v3, and so on. The first assigned slug stays unchanged; each later allocation gets the next available version.

Renaming a session leaves its slug unchanged; --set-slug ID_OR_SLUG NEW_SLUG changes it explicitly. Custom slugs use ASCII letters/digits separated by single hyphens. Lookups and uniqueness checks ignore case. Slugs assigned by older versions remain unchanged. Retired slugs stay reserved, preventing old commands from silently targeting a different session.

Find slugs with sessions --list, --json, the browser's selected-session details or i view, and sessions messaging status. Linked copies and forks have separate slugs, including copies in different harness homes. Qualified tool:ID and tool:slug references also work; ambiguous references fail without acting.

Assignments live beside state.json in state.slugs.sqlite3 (following AI_SESSIONS_STATE_FILE when overridden). They survive catalog rebuilds and older launchers saving their state. The registry is updated during loading, never during table rendering or navigation. Messaging resolves only reachable sessions; a slug does not wake an offline session.

Features

  • One conversation-centered list for Codex, Claude Code, and OpenCode sessions
  • Expandable project/thread groups and collapsed cross-harness lineage copies
  • Search and filters for provider, directory, origin, open state, and visibility
  • Human, cross-provider, and subagent/automation origin labels
  • Started/updated timestamps plus compact turns / compactions / prompts activity
  • Rename that carries through to all three harnesses, plus utility-local hiding
  • Nickname labels that tell sibling subagent threads apart without exposing native IDs
  • Detection of currently open sessions on Linux and Windows
  • tmux pane and desktop-terminal focus on Linux when the environment exposes it
  • Cross-harness resume: continue any session in any of the three harnesses
  • Safe, dangerous, and custom launch profiles
  • Native paths and argument handling on both operating systems

Windows Terminal does not expose a stable session-ID-to-tab interface. On Windows, open sessions are identified, but exact tab focusing is intentionally not attempted. Pressing Enter on an open session instead offers to stop the running copy and resume it in the current terminal, so two processes never write to one session.

On Windows sessions stays running underneath the harness it launches. Claude Code now runs in a job tied to that launcher, so if sessions is killed the harness stops with it instead of lingering in the tab and fighting the shell for keystrokes; the conversation is already saved and resumes normally. A harness left in that state by an older version — "detached" — is stopped automatically when sessions next starts, unless it is in the middle of a turn, in which case it is left to finish. Each Windows Terminal tab also remembers the session sessions launched in it, so after an interruption run:

sessions --reattach

It resumes whatever that tab lost (stopping a detached copy still sitting in it first), or, in a fresh tab, lists the sessions that lost their terminal to pick from.

Neither Codex nor Claude Code can reload its settings, its login or a new session name while it runs. To pick them up, quit the session and, in the same tab, run:

sessions --reopen

It resumes the session that tab last ran, following its conversation if it has since moved to another harness, and reopens a supervisor as a supervisor. In a fresh tab it lists the sessions closed most recently. After a session closes, sessions prints this reminder.

To do both in one step, type this inside the session, in Claude Code or Codex:

! sessions --restart

The session closes and sessions reopens it in the same tab, reading its settings, names and login afresh. Run it between turns, as the ! prefix does: it stops the harness at once, so a reply still being written would be cut off. A Codex app-server another window depends on is left running.

To carry the conversation into another harness as it restarts, name that harness:

! sessions --restart --claude
! sessions --restart --codex
! sessions --restart --opencode

The session is copied across first, as when you pick another harness in the list, and reopens there in the same tab. If the conversation already has a copy there that is just as far along, that copy is opened instead of making a new one. --launch-tool NAME does the same thing. Naming the harness the session is already in is a plain restart.

Requirements

  • Python 3.11 or newer
  • Codex CLI, Claude Code, OpenCode, or any combination
  • Linux or native Windows PowerShell

The Windows-only windows-curses dependency is installed automatically. psutil is used for portable process inspection.

Install

From a checkout:

python -m pip install .
sessions

With pipx:

pipx install .
sessions

From PyPI:

pipx install ai-sessions

On Windows, py -m pip can be used in place of python -m pip.

Everyday use

Run sessions, navigate with the arrow keys or j/k, and press Enter to resume the selected conversation. Tracked cross-harness copies collapse to their logical conversation. Same-title independent threads in one project collapse to a presentation-only container; press Enter, Space, or Right to expand it and then choose the exact thread. No title or directory grouping creates lineage.

Key Action
Ctrl-F or / Start search mode
Tab Cycle single-tool filter presets
t Choose any combination of tools to show
o Cycle Human, Cross, Agent, Supervisor, and All origins
z Cycle Uncompressed, Compressed, and both
Z Compress the selected session, or decompress it
v Cycle visible, hidden, and all sessions
d Choose a directory
Space / Right Expand the selected conversation or thread group
Left Collapse the selected conversation or thread group
i Show full session, lineage, related-thread, storage, and native-ID details
f Focus the selected project; press again to show all projects
s Cycle sort order
x Cycle launch harness for selected session (bridges a copy when needed)
p Cycle Safe, Dangerous, and Custom launch modes
r Rename in the utility and provider
h Hide or restore locally
S Open or create the supervisor of the selected session; on a supervisor, go to its target
Ctrl-R Refresh
? Show complete help

Useful noninteractive forms include:

sessions --list --tool codex
sessions --list --query "is:open dir:my-project"
sessions --list --visibility hidden
sessions --resume SESSION_ID
sessions --resume SESSION_ID --launch-tool claude
sessions --resume SESSION_ID --launch-tool codex
sessions --resume SESSION_ID --launch-tool opencode
sessions --resume SESSION_ID --dry-run
sessions --launch-log

Each resume records the exact id and command handed to the harness. If a harness ever opens a different conversation than the row you picked, sessions --launch-log shows what was actually requested, which separates a wrong id from a harness resolving the right id to the wrong session.

Updated ages include days, hours, and minutes (for example, 4d 7h 23m); the detail pane retains exact timestamps. Activity counts are transcript messages (t), compactions (c), and user prompts (p). One agent response can generate several transcript messages.

If linked-history validation blocks an exact native row, choose the desired harness with x and press Enter. Recovery asks before using that selected copy as a new tracked starting point. Other copies remain separate; the previous relationship and utility state are backed up. Malformed or actively changing transcripts cannot be recovered this way. Recovery never rewrites native transcript content or silently merges competing histories.

Keeping sessions

Nothing is deleted by age. Sessions idle for 30 days are compressed instead, and stay in sessions.

  • What counts as idle: nothing written to the transcript and not opened from sessions for 30 days. Hidden sessions, agents and supervisors count like any other. Open sessions are left alone. A session and its subagents count as one: while any of them is active, none is compressed.
  • When it runs: in the background when sessions starts, at most every six hours, one run at a time. sessions --compress-idle runs it now, and adding --dry-run previews it. Each run is recorded in retention.log in the ai-sessions cache folder.
  • The setting: [retention] compress_after_days in config.toml. The default is 30; 0 turns it off.
  • Finding them: the default view includes compressed and uncompressed sessions. z cycles both → uncompressed → compressed; --compression selects the same filters.
  • By hand: Z, or sessions --compress ID and sessions --decompress ID.
  • Opening one: Enter asks, decompresses it, then opens it. It then has a fresh 30 days. Decompressing gives back the exact original bytes.
  • Safety: a transcript any program has open is left plain and tried again later. A compressed copy that does not match its plain file is never replaced: both are kept and the message says so.
  • Bridging and supervising: only uncompressed sessions can be bridged or get a new supervisor. A supervisor whose target is compressed says so and resumes once it is decompressed.
  • Outside sessions: Claude Code cannot read a compressed session, so claude --resume reports it missing; decompress it first. Codex restores a compressed rollout itself when resuming.
  • Claude Code's own cleanup: Claude Code deletes transcripts after cleanupPeriodDays, default 30. Set it high in ~/.claude/settings.json, for example "cleanupPeriodDays": 36500. Do not use 0, which it rejects. This is what stops the deletion; compression alone cannot.

Supervisor sessions

A supervisor is a second agent session that watches one of your sessions (the target) and answers your questions about it. It never writes to the target and never sends it messages; you read its answers and decide what to do.

  • Start or resume one: press S on a session. The first time, you pick the supervisor's harness (the other harness than the target's, unless [supervisor] default_tool is set in config.toml); after that, S resumes the same supervisor. The supervisor opens in the current terminal, like Enter. Keep the target in one terminal tab and sessions in another, and switch between them with Ctrl+Tab on Windows Terminal.

  • From the command line: sessions --supervise ID [--launch-tool claude|codex] does the same as S.

  • On a supervisor row: S moves the selection to the target. If the target is open in another tab it says so and does nothing else; it never offers to stop that session. If the target is closed, S resumes it as Enter would.

  • How they look: there are three states.

    • ◉ <title>: this session has a supervisor.
    • No mark: this session has no supervisor.
    • ◎ Supervisor: <title>: this row is the supervisor. It sits directly under its main session in every view that shows that session, in its own colour, with Super in the ORIGIN column.

    The details pane names the selected row as MAIN SESSION or SUPERVISOR of '<title>', and o still cycles to a view of supervisors alone. The title does not follow later renames of the target, and r renames it freely.

  • Reset: in i on either row, R then y archives the supervisor and hides its session. The next S starts a fresh one. The old ledger stays on disk.

  • What the supervisor sees: on your first question it is sent a brief (a digest of the target's conversation, with long pastes shortened, tool calls cleaned to one line each, and the most recent exchanges in full). On each later question it is sent only what the target did since. It can read more with sessions --target-log SUPERVISOR_OR_TARGET_ID [--tail N], which prints the target's cleaned exchanges without moving the supervisor's place.

  • The ledger: each supervisor keeps a notes file, supervisors/<record id>/ledger.md inside the ai-sessions config folder, next to its other working files. The supervisor edits it, and it is sent again with every brief, so it survives the supervisor's own compaction.

  • Hooks: supervisors need hooks in Claude Code and Codex. sessions --install-hooks adds them (keeping any hooks you already have) and sessions --uninstall-hooks removes them. Codex asks you to trust a changed hook, so the first Codex session after an install asks once.

  • Supervisors run with your current launch mode (p). Nothing makes them read-only.

What is written, and when

Resuming a session in the harness that recorded it is a read: sessions runs codex resume ID, claude --resume ID, or opencode --session ID against the original ID. Sessions at rest are never rewritten by sessions, and no transcript is ever edited in place.

Only three actions write to provider storage:

  • Rename (r) appends a custom-title record for Claude or a thread_name record for Codex. OpenCode has no rename command, so its adapter performs one bounded, transactional update of the exact existing session title and verifies the row afterward; semantic checkpoints exclude this metadata-only change.
  • Upgrading stored sessions lets the recording harness modernize its own storage before a native resume, and only when that harness asks for it. Codex rejects rewind and prompt editing on a session recorded before its paginated thread history, so resuming one first runs Codex's own migrate-rollouts --apply for that single session and reports what happened. A session another process is writing is reported and left alone, never forced, and a failed upgrade never blocks the resume.
  • Bridging creates a new native target session. Claude and Codex receive new session files; OpenCode receives export JSON through its official import command. The source remains read-only.

Everything else — hiding, sort order, per-session harness preference — stays in this utility's own state.json.

Cross-harness resume

The three harnesses store sessions differently and do not recognise one another's native IDs, so a conversation cannot simply be handed across by reference. Press x (or pass --launch-tool) and ai-sessions bridges it instead: it reads the source transcript, converts the conversation into the target harness's own on-disk format, and writes it there as a new native session. That copy is an ordinary session — the target CLI resumes it, appends to it, and lists it like any other.

sessions --resume CODEX_SESSION_ID --launch-tool claude
sessions --resume CLAUDE_SESSION_ID --launch-tool codex
sessions --resume OPENCODE_SESSION_ID --launch-tool claude
sessions --resume CLAUDE_SESSION_ID --launch-tool opencode

The user/assistant conversation crosses over as messages. Tool calls cross over summarised, folded into the turn that made them:

⟦Bash⟧ python -m unittest discover -s tests
   → Ran 75 tests in 0.066s
     OK

They are deliberately not replayed as live tool calls: a tool_use block would name tools the target harness does not have, and would need a matching result to stay a valid conversation. Summarising keeps what was run and what it returned — usually the part worth having — without inventing structure the target cannot honour. Arguments and output are clipped, Codex's fixed result preamble is stripped, and a Codex exec snippet is reduced to the shell command it actually ran. Reasoning and attachments are dropped entirely.

Because a summary is a record and not a result, the copy opens with a note saying where it came from and warning that the filesystem state is unverified. The source transcript is never modified, and the copy is named <title> (from Codex), <title> (from Claude), or <title> (from OpenCode) so the two are never confused in the list.

Sessions that have been compacted

A long session is not one conversation but a chain of context windows. When a harness runs out of room it summarises everything so far and carries on from the summary, so the transcript on disk holds every superseded window and a summary of each.

Replaying all of that is both wasteful and untrue to where the session actually stands, so a bridged copy starts at the most recent summary — exactly where the source session itself picks up. On a real 7-compaction session here that is the difference between 949,000 characters with 739 messages silently dropped to fit, and 147,000 characters with nothing dropped at all. Set latest_window = false to replay the whole transcript instead.

The harnesses record this differently, and all three are usable. Claude Code writes a plain-text summary. Codex seals its summary as encrypted_content — unreadable to anyone but the provider, including Codex itself — but records the messages it carries forward beside it, so the copy resumes from those. What crosses is the conversation the source kept, not a paraphrase of it; what cannot cross is the sealed summary of the assistant's own work in that window. Only a compaction with no carried context falls back to replaying the pre-compaction history. The handoff note says which happened, so an over-large copy is always explainable.

OpenCode stores a readable summary, compaction request, and retained-tail boundary in its shared SQLite database. The adapter follows the newest completed summary. A failed-only attempt retains full history, and a successful retry keeps the retained tail after its completed summary; this is a deliberate safety correction to OpenCode 1.18.21's failed-attempt reorder behavior.

Budget

Whatever survives the above is fitted to a target-owned token policy. Claude Code and Codex use the 1M-context models configured for this deployment, reserving 5% for target scaffolding: about 950,000 tokens / 1,900,000 projected characters. OpenCode target preparation queries installed models and uses the selected model's effective input limit; when verbose metadata is unavailable it warns and falls back to a 128,000-token compatibility floor. Selection happens at source-message boundaries before same-role messages are assembled for the target. The first message of the selected context and one contiguous newest suffix survive; oversized anchors carry an explicit truncation marker, and the note reports dropped, truncated, source, and assembled counts. These target defaults intentionally replace the previous global 950,000-character ceiling; they are smaller so an unknown target model is less likely to compact immediately on resume.

The bridge refuses before calling the target writer if the selected context would drop messages or truncate an anchor. max_tokens and max_chars choose capacity; they do not authorize omission. The error reports projected source cost, the current budget, loss counts, and the minimum setting needed to fit. Set allow_lossy = true under [bridge] only to deliberately restore the old first-message-plus-newest-suffix behavior; this is dangerous and exact losses remain reported. Starting at the source's latest native compaction summary under latest_window is not budget loss, because that summary replaces earlier windows in the source context.

Set max_tokens in config.toml for an explicit token-denominated ceiling, or tool_calls = false for a conversation-only copy. The deprecated max_chars remains an exact override. Version-1 files automatically written with max_chars = 950000 migrate to the target default; add version = 2 or use max_tokens to make an override explicit.

Every first bridge creates a utility-owned conversation id. The original and each native copy are materializations of that conversation. Equivalent copies share a frontier; byte bookmarks on their transcripts reveal which copy received real work after that frontier. New bookmarks retain ordered fingerprints of conversation records as well as a byte position. Formatting and instruction-metadata rewrites can therefore relocate the position without losing its meaning; edits or missing conversation records still block automatic routing. Timestamps choose the default copy to continue; they do not merge histories or claim that different branches contain equivalent work.

A conversation row continues its most recently updated current copy. If two copies advance independently, both remain labeled diverged, but the latest one opens without a head-selection blocker. Expand a conversation and select a native copy to open exactly that copy in its own harness, including an older branch. Requesting a different harness continues to use validated conversation routing and can create a new copy of the newest branch. Other histories are preserved. Same-title sessions without recorded lineage remain independent thread or standalone; their visual grouping never creates lineage or merges histories.

The CONNECTION column shows standalone or linked. STATUS separately shows latest, superseded, diverged, or a validation problem. Standalone sessions have no copy status.

The conversation id is stored in state.json and included in new copies as a structured [ai-sessions-provenance v1] marker. State is authoritative today; the marker makes copies auditable and provides a future recovery path, but state reconstruction from transcripts is not implemented yet. Version 5 bridge records migrate conservatively: a possibly edited copy wins over its ancestor so old state cannot silently discard work.

Adding a harness

Conversions run through a harness-neutral conversation rather than pairwise. OpenCode is the first production proof: all six ordered cross-harness directions and all three same-harness identities use one core, with no pairwise converter. Support for another CLI costs one adapter rather than a converter per existing harness. The registry requires a name and label, a conservative budget policy, plus operations to read a NativeRef into Turn objects with an opaque checkpoint, write turns as a resumable native session, resolve a native ID, test exact availability, and compare meaningful native state against that checkpoint. The same adapter also owns native discovery, resume arguments, title publication, liveness evidence, native-id patterns, labels, ordering, home-directory semantics, and its launch/budget policy. Bridging and head tracking in both directions then work without pairwise logic.

The registry is dynamic: CLI choices, keyed schema-3 provider profiles, list/browser rendering, discovery, liveness, naming, and conversion all query it at runtime. Unsupported capabilities and unknown harnesses fail explicitly instead of borrowing built-in behavior. An independent fourth-format fixture exercises the whole contract without reusing a built-in adapter. The complete target contract is specified in specs/conversation-log/HARNESS_CONTRACT.md.

A Codex writer has one non-obvious obligation. Codex records the model's context (response_item) separately from what its TUI redraws (user_message and agent_message events), and groups both into turns delimited by task_started/task_complete. A rollout carrying only the first kind resumes with the full conversation in context but a blank screen, which looks exactly like a failed bridge. Writers for other harnesses should expect a similar split and check the resumed session visually, not just by asking the model what it remembers.

One more wrinkle: Codex enumerates its sessions from a local state database rather than from the rollout files, so a copy bridged into Codex is resumable immediately but only appears in the sessions list after Codex itself has opened it once. Copies bridged into Claude Code and OpenCode are listed straight away.

Launch safety

The package defaults to safe. This leaves approval and sandbox behavior to each provider's normal configuration:

claude --resume SESSION_ID
codex resume SESSION_ID
opencode --session SESSION_ID

Dangerous mode adds the providers' explicit bypass flags:

claude --dangerously-skip-permissions --resume SESSION_ID
codex --dangerously-bypass-approvals-and-sandbox resume SESSION_ID
opencode --auto --session SESSION_ID

These options disable important protections. Use them only where you have consciously accepted that risk.

Set a persistent mode from the command line:

sessions --set-launch-mode safe
sessions --set-launch-mode dangerous

Use --launch-mode for a one-time override. The active mode is always displayed in the interface header.

Configuration

Configuration is stored in:

  • Linux: ~/.config/ai-sessions/config.toml
  • Windows: %APPDATA%\ai-sessions\config.toml

The optional custom profile uses structured argument arrays, avoiding shell interpolation:

version = 3

[launch]
mode = "custom"
claude_command = ["claude"]
codex_command = ["codex"]

[launch.providers.opencode]
command = ["opencode"]
bridge_model = "provider/model" # optional; must appear in `opencode models`

[launch.custom]
claude_args = ["--permission-mode", "acceptEdits"]
codex_args = ["--sandbox", "workspace-write", "--ask-for-approval", "on-request"]

[terminal]
# Opens a terminal on a tmux session whose own terminal died.
# {session}, {window}, {pane} and {script} are substituted.
# Empty means auto-detect: $TERMINAL, then kitty, wezterm, ghostty,
# alacritty, gnome-terminal, konsole, xterm.
command = []

[bridge]
max_tokens = 150000
allow_lossy = false
tool_calls = true
latest_window = true

By default, a bridge refuses before writing if its selected context would drop or truncate content; increase max_tokens/max_chars to fit it. Set allow_lossy = true only as an explicit, dangerous authorization for those losses; exact dropped and truncated counts are still shown.

Rename/hide state is kept alongside the configuration as state.json. Per-session launch-harness preferences, conversation ids, native members, equivalence frontiers, and opaque native checkpoints are stored there too. A checkpoint on a long transcript keeps its per-record fingerprints in checkpoint-records\ beside state.json, one file per list named by its SHA-256, so the state file stays small; lists nothing has used for a week and no checkpoint names are swept at startup. Unset sessions default to the harness where they were started. Caches use ~/.cache/ai-sessions on Linux and %LOCALAPPDATA%\ai-sessions on Windows. Environment overrides are available through AI_SESSIONS_CONFIG_FILE, AI_SESSIONS_STATE_FILE, AI_SESSIONS_CACHE_DIR, CODEX_HOME, CLAUDE_CONFIG_DIR, and OPENCODE_DB. Prefer the configured OpenCode command's authoritative db path; OPENCODE_DB is the explicit fallback override when that command cannot report one.

Recovering a session whose terminal died

A tmux session outlives its terminal. When a window manager restart or a crash takes the terminal window but leaves the tmux server, the pane shells, and the harness process running, the session is still there — sessions just had no way back to it.

Pressing Enter on such a session now opens a terminal attached to it, on the exact window and pane. This happens only when tmux reports no client on the session. A session that already has a client but whose window cannot be raised — different display, Wayland, remote — is not given a second one, because two clients share a session and tmux sizes both to the smaller window; the message explains that instead.

The terminal is resolved from [terminal] command, then $TERMINAL, then the first of kitty, wezterm, ghostty, alacritty, gnome-terminal, konsole, xterm that is installed. With no display at all, nothing is spawned and the message carries the exact tmux attach-session command.

How open-session detection works

  • Claude Code publishes a live PID/session registry.
  • Codex on Linux holds per-thread writer locks.
  • Codex on Windows records thread IDs alongside process IDs in its local log database.
  • OpenCode is marked open only when a process command line names its exact --session/-s ID; a bare OpenCode process is never guessed to own a particular session.
  • Linux focus support follows the process into tmux and then uses wmctrl/xdotool when available.

Detection is best-effort and read-only. See What is written, and when for the complete list of operations that touch provider storage.

Privacy

No transcripts, caches, credentials, local names, or hidden-session state belong in this repository. The defensive .gitignore excludes common provider and local data paths.

Development

python -m unittest discover -s tests -v
python -m build

CI exercises Python 3.11–3.13 on Ubuntu and Windows.

Messages between running sessions

Run sessions messaging install, then reopen the sessions you want to receive messages (! sesres is shorthand for ! sessions --restart). Find receivers with sessions messaging status and send with sessions send <harness:session-id> --message "Migration finished". Agents can reply with sessions reply <message-id> --message "Received".

Codex steering reaches an active turn without canceling its tools; idle threads start a turn. Claude uses its native authenticated inbox and Windows DevSecrets. A successful send reports runtime acceptance or pipe submission, not completion. See the messaging guide for setup, replies, delivery states, home selection, and current Windows/desktop/private-server limits.

Saved pane workspaces (Windows Terminal)

Run this inside a pane of the tab you want to save:

sessions workspace save elevate

It captures that tab's current layout, automatically assigns tracked sessions, and saves without prompting. Unidentified panes cause an error before saving; use --interactive explicitly for manual assignment. --yes also never prompts. After a PC restart, sessions workspace restore elevate opens that workspace. For native named-window persistence in Terminal 1.26+, select its executable once with sessions workspace terminal PATH_TO_WindowsTerminal.exe, then use sessions workspace open elevate. Close normally once; later opens also work from Terminal's workspace menu. Portable mode is detected automatically; packaged installs need --state-file PATH_TO_TERMINAL_STATE_JSON when selecting Terminal.

Running sessions are skipped rather than stopped.

For geometry only, with no session matching or prompts:

sessions workspace save elevate-layout --layout-only
sessions workspace restore elevate-layout --empty --window -1

The new window contains ordinary shells, with no agents or pickers. Large new windows open maximized so their splits fit. save NAME --check checks the current capture without saving or requesting input.

For another project:

sessions workspace clone elevate another-project
sessions workspace restore another-project

The same layout opens with a session picker in each pane. Choose the project's sessions directly in place; successful launches save those assignments. See the workspace guide for setup, automation limits, empty shells, storage, and explicit saved-state import.

Start an ordinary native session

sessions new codex
sessions new claude
sessions new codex -- --model MODEL "Initial task"

These use the genuine native CLI in your terminal, with inherited keyboard, color and console behavior. Run ! sesres inside the session to restart the current conversation. Native flags follow --; the original prompt is sent only on initial launch. Settings and permission flags are retained on restart.

On Andrew's Windows PC, cdba and cdsp use this shared path and retain their existing native permission-bypass flags. Reload the shared PowerShell profile with sb in already-open shells after installing the updated aliases. New shells load them automatically. Raw codex and claude launchers remain available.

The updater for an existing profile with those aliases is:

pwsh -NoProfile -File tools/Set-ManagedSessionAliases.ps1 -ProfilePath "$HOME/.config/powershell/profile.ps1"

An already-running direct native session needs one normal exit and relaunch to acquire the waiting launcher. New Codex conversations are created with a known native identity before launch; native resume picker requests go through the shared selector when needed. Nonlocal --remote endpoints require a remote-aware launcher and are not given locally created conversation IDs. In-session Codex UI switches without verifiable client identity are refused for restart rather than resuming a different conversation. Native subcommands such as help/version are forwarded without creating an empty conversation.

Quiet project conversations

Project Desk pairs a human-facing native Claude/Codex conversation with a live terminal Review / Needs you / Next action view, while an observer watches explicitly selected operational sessions. Start with sessions desk --help.

Metadata

Release files for ai-sessions 3.20.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ai-sessions 3.20.4
File Size Uploaded Provenance Actions
ai_sessions-3.20.4.tar.gz 631.7 kB With provenance Details for ai_sessions-3.20.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ai-sessions 3.20.4
File Interpreter ABI Platform Actions
ai_sessions-3.20.4-py3-none-any.whl Python 3 none any Details for ai_sessions-3.20.4-py3-none-any.whl

Total release size: 983.4 kB

Release files / ai_sessions-3.20.4.tar.gz

Download URL ai_sessions-3.20.4.tar.gz
Size 631.7 kB
Tags Source
SHA-256 checksum
How to use checksums
4386d256ba40c80f59f189c0b7c80759a6aecf52612dfffd0a1f212e6b1521e1
BLAKE2b-256 checksum
How to use checksums
4a8ae4f1fac1894eeeddadc77d6dcd8a5b79d281682caff242ca02b919b98dc0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Release files / ai_sessions-3.20.4-py3-none-any.whl

Download URL ai_sessions-3.20.4-py3-none-any.whl
Size 351.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c81d762b2ca2d42f515897301df93cba53e9eedd5ce34f418522b38e743de59
BLAKE2b-256 checksum
How to use checksums
7fa15cd27dacc46f7c5d00112a031266b196a197fc86f4e234c32b9b357bed98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

Security for ai-sessions 3.20.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ai_sessions-3.20.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

3.20.4 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page