Local transactional coordination for collaborating AI peers
pip install peerhub==0.24.18 Copy PIP instructions
A durable communication layer for collaborating AI peers. The Core owns only Peer, Stream, Record and Offset. Runtime delivery, observations, diagnostics, work continuity and collaboration capabilities are extensions.
pipx install peerhub uv tool install peerhub pip install peerhub A winget package is not provided.
python -m pip install -e ".[dev]" peerhub --help peerhub --version See STATUS for current source and release status. The public command is peerhub; the temporary milestone-specific entrypoint has been retired. python -m peerhub and python -m peerhub.cli use the same public CLI.
The Core stores Peers, Streams, immutable Records, and per-peer Offsets. These commands use a new core-demo Stream in the selected store and call no provider:
peerhub --db .peerhub/core.db peer register --peer reader --name "Demo reader" peerhub stream create --stream core-demo --members reader peerhub record append --stream core-demo --author-peer reader --kind message --body '"Hello"' --idempotency-key core-demo-001 --created-at 2026-10-10T00:00:00Z peerhub record read --stream core-demo --after 0 --limit 10 peerhub offset get --peer reader --stream core-demo peerhub offset advance --peer reader --stream core-demo --position 1 --revision 1 peerhub offset get --peer reader --stream core-demo On an existing Stream, advance to the position you actually read and pass the revision returned by offset get; the revision is a compare-and-swap guard. Keep the same body, timestamp, and idempotency key when retrying an append.
Run peerhub guide (or bare peerhub with no arguments) for a concise, offline reference covering profile tables (by tier), two-asks session reuse, delivery safety, discovery commands, and drift recovery. Run peerhub explain for detailed recovery guidance on any ask outcome code:
peerhub guide peerhub explain ask_blocked_uncertain CLI output defaults to compact human text, including when redirected. Use --json for scripts; --format is a hidden compatibility alias. Errors carry an outcome code and next: hint.
Account-bound peers isolate cc/cx vendor roots behind immutable peer identities; peerhub account list inspects bindings.
Batch runs: peerhub batch run tasks.json --batch-id review-001 --max-parallel 2 --dry-run validates a flat batch before execution.
# Persist the prompt, execute one provider, and persist its response. peerhub ask cx "Summarize this repository" --stream review --request-id review-001 # Explicit collection may contact provider CLIs. peerhub observation refresh --peers cx cc ag peerhub observation refresh --peers cc --system-dir D:\tools\portable # explicit provider installation directory # Read committed observations without probing or writing. peerhub diag peerhub diag quota --json peerhub diag health peerhub diag --live --interval-seconds 2 peerhub diag --view rich # List every monitor group and see what each ID means; --json emits the same catalog. peerhub monitor groups peerhub monitor groups --json # Show a read-only snapshot once, without provider refresh or writes. peerhub monitor --snapshot peerhub monitor --snapshot --group sessions --group execution # Watch the nine default groups: overview, activity, peers, execution, sessions, # usage, context, capacity, and coverage. Collection may call provider CLIs # (including agy /usage and /credits) and consume provider quota. peerhub monitor --interval-seconds 60 peerhub monitor --view plain --cycles 1 # For an AI session: line 1 (the verdict), the suggestion and the pools only; no text of other sessions. peerhub monitor --snapshot --group capacity # Keep the schema 1.1 quota/dashboard output for existing scripts. peerhub monitor --json --schema-version 1.1 --cycles 1 # Customize grouped watch and snapshot defaults (workspace by default). peerhub monitor defaults set --group overview activity peers execution sessions usage context capacity coverage peerhub monitor defaults show peerhub monitor defaults reset # saved before 0.24.16? reset to get the new `activity` group # Review with a second provider using a declared profile. peerhub ask cc "Explain the Core Peer, Stream, Record and Offset flow" --stream learning --request-id learning-001 --profile cc.standard --json The two ask examples require the corresponding vendor CLI to be installed and authenticated, and spend provider quota. See the adapter guide.
Builtin provider names are cx/codex, cc/claude and ag/agy, and the API peers ca and oa (see API peers). Custom Peer identities can be registered with peer register --peer worker --adapter cx.
ask supports explicit --profile, --model, --effort, --writable, --timeout-seconds, optional --silence-timeout-seconds, --max-output-bytes, --author-peer and --json. Profile policy resolves workspace → global → packaged defaults; it does not assert measured model availability. Each ask stream is scoped to a single peer: targeting a different peer on an existing ask stream is rejected with stream_peer_mismatch (ask_stream_peer_mismatch). Retrying the same --request-id reuses a completed response. A different prompt, binding or session selector conflicts, and an uncertain execution requires explicit reconciliation before another execution. By default, each ask reuses the latest compatible retained session of this peer/stream; otherwise it starts a fresh session with bounded Stream catch-up. Mutually exclusive --fresh and --session HANDLE select a new generation or one exact retained session. Exact selection rejects incompatibility or context overflow without allocating a substitute. Fresh still receives Stream history; use a dedicated stream for an independent task. CLI peers (cc, cx, ag) retain native vendor continuity. Older native mappings with unproven context are invalidated on upgrade; existing request replay and uncertain-execution blocking remain intact. --json always includes session (accepted handle, generation, mode, reason and telemetry, or null before allocation) and error (null on success). Text output ends with one session: line after allocation, including on failure or replay. Existing delivery details remain available. In the ask result, context occupancy is unknown: billing usage is not an occupancy measurement (the estimate for cc asks is described below).
--writable is off by default. It maps to cc --permission-mode acceptEdits, cx -s workspace-write (default -s read-only), and ag --mode accept-edits. Because the agy CLI does not enforce a read-only sandbox when --mode accept-edits is omitted, native ag execution fails closed pre-spawn unless --writable is explicitly passed (#140). cx resume passes -c sandbox_mode="workspace-write" (default read-only) because resume does not accept -s; writable mode is therefore part of the session binding, and changing it starts a fresh generation.
Quota is collected separately from diagnostics. diag --fresh has been replaced by observation refresh. Unmeasured values remain UNKNOWN or another explicit evidence state, and expired measurements become STALE. --workspace is an ask option; for monitor and observation refresh use the global --db before the subcommand, e.g. peerhub --db /.peerhub/core.db monitor. The default human monitor view is compact (with PACE); to inspect expanded per-peer quota/profile/session chains, bars with the even-burn mark, EXHAUST-IN, sessions rows or the estimated context, pass --expand (e.g. peerhub monitor --snapshot --expand --group peers; diag sections are peers, streams, resource_pools, observations, activity, log).
diag --live repeatedly reads committed snapshots only and keeps its --cycles 0 default (until interrupted, including non-TTY stdout). --cycles N bounds the number of frames; --json emits one JSON object per line in live mode. Watching never refreshes quota or changes stored data.
monitor groups lists all eleven stable group IDs, their meaning, and whether each is selected by the effective defaults. The default monitor includes running and recent asks (activity), quota capacity (capacity), retained session state and configured binding (sessions), per-peer dependency chains (peers), and Bridge delivery certainty (execution). Delivery certainty describes whether a request was not started, may have started, started, or reached a terminal delivery state; terminal does not mean the model answered the task successfully. PeerHub does not currently classify semantic task success/error. Context occupancy of asks: for cc it is estimated at the end of each ask, from the tokens of the last main-chain assistant message and the context window that the result reports for that model; it is an estimate with its time (state: "ESTIMATED", observed_at; latest_telemetry.context in peerhub session show --json), and it stays unknown when either value is missing or does not fit. --expand shows it as 2% est, 3m ago (see below). For cx it is not implemented (its rollout file has it). For ag it is not measured. runtime and store remain available with --group or --snapshot --group.
The default human monitor is a compact frame of at most 24 lines, 100 columns and 8,192 bytes (colour codes included), in this order: line 1, line 2, POOLS, the suggest: line, RUNNING, LEADS and RECENT. The quota comes first since 0.24.18 (0.24.17 printed RUNNING, LEADS, RECENT, the suggestion, then POOLS); what is cut first on a small terminal is unchanged. Line 1 is the verdict: OK | 3 running | 2 leads | min quota 1% ag 3P-7D low when every alert source was read, OK? (asks not read), OK? (quota stale) or OK? (quota unknown) when one was not (with peerhub monitor defaults reset when saved defaults lack the activity group; min quota ... low (aged) marks a stale pool; quota unknown means that no 7-day pool the provider reports has a number, all being unknown or in error; sources combine, for example OK? (asks not read; quota unknown)), or ATTN 3 | gone: cc.effort rank-374-r1/cc 41s | empty: ag.standard denied-postinstall 3m | +1 (or ATTN 3? when an alert source was not read; --expand lists which), which names at most two alerts in importance order (a store or read failure, a running ask whose peerhub ask process is gone, an overdue ask, an ask that ended empty, in error or unsure in the last 30 minutes, a login or expired token, a pool that is out, the agy token-use stop, then a token expiring within 48 hours and model facts that need a recheck). Line 2 is the header (time of the snapshot, DB: , quota age, live refresh state). POOLS n (STATE, LEFT, RESET, PACE, family) is ordered out, low, binding, fast, then the rest; a 5-hour pool shows under its 7-day pool only when it has less left or is low or out. Then the suggest: line. RUNNING n (with the count per peer) lists at most five running asks: a flag (!gone, !overdue, ? for unknown liveness), elapsed time, profile, the label of the lead that launched it, the first line of the request and the name. RECENT n lists the two most important ended asks: state, age, profile, lead, the last line of the reply (or the note) and the name. When the terminal is small, lines go in one fixed order (recent rows first, line 1 last): although POOLS is printed first, its rows still go after the recent, lead and running rows. Each header keeps its total. On a live terminal, min quota on line 1 and the POOLS rows always show the same moment: every redraw (also the REFRESHING and STOPPED frames) takes both from the same rows, so when a pool passes its freshness limit or its reset during the countdown, both change together. --expand takes min quota on its line 1 from the pools as they are at each redraw too. A store that never had a quota refresh is not an error: the frame shows POOLS 0 with no quota evidence; next: peerhub observation refresh, line 1 says OK? (quota, accounts, facts not read), and the monitor exits 0 (also with --json). peerhub monitor --group capacity prints lines 1-2, the suggestion and POOLS, without the text of other sessions; AI sessions should use it. Request and reply lines come from the local store, cleaned of secrets known to the environment; PEERHUB_MONITOR_TEXT=off hides them. The label of a lead comes from PEERHUB_LEAD, else the name of the working folder. LEADS is described below. low means more than 0% and at most 10% remaining (0% is out); fast means ahead of pace with a threat projection supported by at least two samples and more than 10% remaining. aged numbers are last-known evidence, not current capacity; refresh before relying on them. Passed reset windows show no capacity number. The suggest: line picks an eligible profile per tier; | adds the best eligible alternative from a different peer in that tier (see balancing guidance). The header always shows the date and DB: ; the full DB path appears only when it differs from the nearest upward store or on error. --expand prints everything: line 1, ALERTS (every alert with its age), the activity section (RUNNING and RECENT with every field, the 20 newest ended asks plus superseded ones, and LEADS), then the detailed grouped sections as before (pools with bars, 5-hour rows and EXHAUST-IN forecasts, PEERS, ACCOUNTS, execution, sessions, usage, context), the legend (PACE is used% minus elapsed% in percentage points, + ahead of even burn; printed when the output is not a terminal, for example peerhub monitor --snapshot --expand | more) and the coverage footer; the header time is the snapshot time. peerhub explain covers its short codes.
The compact frame has two views with the same lines and rows. The plain view (--view plain, and the default when the output is not a VT terminal, for example a pipe or an AI session) is the text of 0.24.17 in the new order: ASCII frame lines, no colour. The rich view (--view rich, the default on a VT terminal) draws the same frame in a new look:
An example of the rich view, shown here without colour (the uncoloured frame, as NO_COLOR prints it):
OK · 2 running · 1 lead · min quota 18% cx X-7D ok 23:46Z PeerHub Monitor 2026-11-14 23:46Z · DB:env · quota age 10s ── POOLS 5 ─ STATE ────────────────────── LEFT RESET PACE FAMILY ─────────────────────────────── ag G-7D ● ok ██████████████░░░░░░ 71% 1d00h ▼-6 flash └─ G-5H ● ok ████████░░░░░░░░░░░░ 40% 1d00h - flash cc C-7D ● ok █████████████░░░░░░░ 63% 1d00h ▼-20 claude └─ C-5H ● ok ██████░░░░░░░░░░░░░░ 30% 1d00h - claude cx X-7D ● ok ████░░░░░░░░░░░░░░░░ 18% 1d00h ▲+9 codex suggest: eco=ag.standard normal=cc.effort|cx.effort quality=- top=- ── RUNNING 2 · ag 1 cx 1 ────────────────────────────────────────────────────────────────────────── ► 16m cx.effort docs-site Review the importer change and its tests review-api ► 1m ag.standard docs-site Vote on the release plan vote-1 ── LEADS 1 ──────────────────────────────────────────────────────────────────────────────────────── docs-site busy 12s ctx ■■□□□ 46% 2 run fable-5-2 Importer docs ── RECENT 2 ─────────────────────────────────────────────────────────────────────────────────────── ● ok 3m cc.effort docs-site All 42 links resolve. check-links ● unsure ? cx.effort docs-site (no reply) shipped-check The plain view of the same frame starts OK | 2 running | 1 lead | min quota 18% cx X-7D ok, has POOLS 5 STATE LEFT RESET PACE FAMILY as its head and cc C-7D ok 63% 1d00h v-20 claude as a row.
The estimated context of cc asks shows only in --expand, never in the compact frame and never as live data. It reads % est, ago, for example 2% est, 3m ago: est means an estimate of the context at the end of that session's last ask, as a share of the model's maximum input, and the age is counted from that ask's end to the time of the frame. It appears as the field ctx 2% est, 3m ago on the row of the newest ended ask of each stream and peer, only when that ask produced the estimate: it comes from the session of the same stream and peer with the highest generation, and must have been read at or after the ask started (only when the sessions group is selected). An ask that failed before it started, or that ended without a reading, shows none, and neither does an earlier ended ask, a running ask or a superseded row. The estimate also appears as the last field of a SESSIONS row (dropped whole when the line is too narrow), as a CONTEXT row (cc 2% est, 3m ago ... | 20,113 of 1,000,000 tokens, never with the word MEASURED) and on the PEERS line (-> context: 2% est, 3m ago); in these three places it reads 2% est, age ? when its time is unknown. The legend explains CTX est. --expand also lists source capacity: unknown (no 7-day pool has a number) for OK? (quota unknown), and source capacity: no quota evidence for a store that never had a quota refresh.
LEADS shows the lead sessions of Claude Code, read from Claude Code's own local files. No model is called and nothing is stored. The section sits between RUNNING and RECENT. A row has, from the left: the label (cut to 16 characters); the state; the age of the last activity; ctx; the running asks; the model; the session title. busy is the state Claude Code writes. ?busy means PeerHub could not confirm that the process is alive. ? alone means the state is unknown. - means the lead has a caller row but no session was found. ctx 11% is the share of the model's input window that the last answer used. ctx 106k shows the tokens when the window of the model is not known, and ctx ? when the tokens are not known. A ! after ctx means 80% or more. It is a mark in the row, not an alert, because Claude Code compacts by itself. A narrow terminal drops the title, then the model, then the running asks; ctx stays. The title column is left out when no shown lead has a title. A lead with caller rows keeps the caller's label; a lead without caller rows is labelled by its session name, else its folder name, else ?. At most three rows show, then +N leads (--expand). The section is left out when no lead has a session or a running ask and the read was complete.
The header has five forms: LEADS 2; LEADS 2 | partial (1 unreadable, 2 not read) when a file could not be read or a limit cut the list; LEADS 2 | read failed when a folder could not be listed; and LEADS ? | partial (...) or LEADS ? | read failed when the read was not complete and no row can be shown. In a row, an unknown state or context shows ?, an unknown age or model shows -, and a missing title is left out. A lead with a session but no transcript shows - for age and model. There is no new alert, and line 1 and its lead count are as before. --expand prints every field of every lead: tool and short id, state and since when, age, alive or alive ?, process id, entry point, Claude Code version, start time, model, tokens against the maximum input, running asks, asks of the last 24 hours, last ask, session name, working folder, title, the first line of the last prompt and the last line of the last answer. A lead that has no session says no session found (ended, or its Claude folder is not in PEERHUB_LEAD_DIRS). A caller that is not Claude Code says no session (not a Claude Code lead). --json carries the lead's identity and ask totals in groups.activity.data.leads[], the session facts in its session (an object, or null) and the read result in groups.activity.data.leads_read (state is read, partial or error, with unreadable and not_read). The schema stays 2.0. A caller row without a session id (an ask started outside Claude Code) never merges with a session.
PeerHub reads the Claude Code folder of the user (CLAUDE_CONFIG_DIR, else ~/.claude) and the folders named in PEERHUB_LEAD_DIRS, separated by the path separator of the system. Nothing else is opened. No path comes from the store or from the content of a file, and a link or junction below a registered folder is not followed. Examples:
# Windows (PowerShell): two more Claude folders $env:PEERHUB_LEAD_DIRS = "D:\work\claude-a;D:\work\claude-b" # POSIX shell export PEERHUB_LEAD_DIRS="$HOME/work/claude-a:$HOME/work/claude-b" Limits: 8 folders, the 64 newest session files per folder, 16 KB per session file, 2,000 project folders per folder and the last 256 KB of a transcript. A larger set is cut and the header says partial. PEERHUB_MONITOR_TEXT=off also hides the session name, the title and the two conversation lines. Strings from the files are cleaned, and the secrets of the environment are removed before they are shown.
What was measured and what was not. Measured on Windows 11 with Claude Code 2.1.323 and 2.1.325: the session files, the transcripts, the model catalog and the creation time of the process. alive is confirmed on Windows only: the creation time that the session file records must equal the exact creation time of the process, and the file must carry the name of this machine. On Linux and macOS no identity can be compared yet, so the flag is ?. A session whose file names another machine, or whose process cannot be inspected or compared, shows ? for up to 24 hours; a file whose process no longer exists is left out. A session that cannot be checked is shown only when its transcript was written in the last 24 hours. The start time in a session file belongs to the process, not to the session. After /clear a row may show the old context until the file changes (the age column shows how old it is). It was not measured whether /clear rewrites the file. If it gives a new session id, one terminal shows two rows for a while: the old lead with no session found and the new one. An invalid old session file whose process id now belongs to another process shows partial until that id is free. Not measured: the entry point of IDE and desktop sessions, the files on Linux and macOS, and a plan whose window is smaller than the maximum input of the model. Claude Code's files are private formats; after a format change the cells show ?. ctx is measured against the model's maximum input, which a plan may cut. A session id is read once per folder, so its unreadable transcript counts once in unreadable. When several files have the same session id, a row whose process could not be confirmed is replaced by a later file of that id whose process is confirmed; a confirmed row is never replaced. Codex and agy lead sessions: not measured; discovery of Codex and agy lead sessions is not implemented.
--expand also shows the ACCOUNTS rows (fields in JSON capacity.accounts; a logged-out peer, an expired login token or one expiring within 48 hours also reaches line 1): per peer the plan (display data only), login state and the login token expiry, which is not billing. Example: cc login ok | plan pro | login token expiry 2026-11-26 | auth claude.ai | age 30s [MEASURED]. ? means it could not be determined and n/a that the provider does not expose it (a missing expiry never means logged out; API-key, Bedrock and Vertex logins show n/a; ag shows endpoint access only). A failed probe keeps the last good reading shown aged with a probe error note; account evidence ages after 6 hours. Only normalized fields are stored (never an email, organization, account id, token or any identity-derived hash). They are collected, in parallel under the refresh deadline and skipped while still fresh, by observation refresh and monitor collection cycles from claude auth status, codex app-server account/read and agy /credits (no model turn); --snapshot stays read-only.
low/fast take precedence over aged; staleness still shows in the line-2 quota age and, with --expand, in AGE and the PEERS (aged) tag. See peerhub explain monitor-states for state meanings and precedence.
The bare monitor command shows the compact human dashboard (with PACE), redrawing in place on a VT TTY and printing one completed frame per cycle when redirected; use --expand for bars with the even-burn mark, EXHAUST-IN and detailed sessions/group sections. --view rich gives the rich look described above (colour only on a terminal); --expand has its bars in both views; --view plain selects ASCII-safe output: the frame's own lines and marks are ASCII, while request, reply, lead and alert text keeps every character the output encoding can show (Korean, Kana and CJK stay readable; ambiguous-width characters become ?; the cut mark is ~). Add repeatable --group options to watch one or more groups, or --group all to include all eleven. monitor groups lists group IDs and meanings; monitor defaults show|set|reset inspects and changes the default selection. monitor --snapshot renders one read-only dashboard without refreshing providers. In a terminal, --snapshot --expand fits the screen; piping shows all rows, for example peerhub monitor --snapshot --group all --expand | more. For automation, --json emits schema 2.0 NDJSON frames for watch and one JSON object for snapshot. The frozen 0.16.1 machine contract remains available as --json --schema-version 1.1; the hidden deprecated --legacy alias was removed in 0.20.0 after its 0.19.x sunset. Use the explicit --json --schema-version 1.1 options for the frozen machine contract.
The diag dashboard shows a threat summary, a stable pool table with usage, PACE in percentage points, reset countdown, conditional forecast and freshness, then credits, latest asks, probe health and one legend/controls line. PACE is measured usage minus elapsed window percentage; positive means faster than even. Forecasts require 5 percentage points used and 10% elapsed (20% for windows of at least one day); projected reset use of at least 105% is a threat. Below the support gates the screen says “not enough data”. Inferred anchors remain conditional and predictive accuracy is not established.
Monitor runs collection cycles every N seconds (--interval-seconds), collecting initially and then every Kth cycle (--collect-every). With --cycles omitted, stdout on a TTY watches until interrupted; non-TTY stdout runs one cycle. Explicit --cycles 0 watches until interrupted everywhere; positive values bound collection cycles. The legacy dashboard and live diagnostics update countdowns at most 1 Hz; PACE and forecast ETA remain anchored to the measurement. Non-TTY human watch prints one completed frame per cycle without escapes (skipping the initial pre-refresh frame), while unavailable VT on a TTY appends without escapes; schema 2.0 JSON watch emits one initial frame plus one complete frame per cycle (default non-TTY JSON = two lines). NO_COLOR suppresses colour while retaining supported cursor controls.
ca (the Claude API) and oa (the OpenAI Responses API) answer one text question per ask. Use them for votes, text reviews and documentation checks when the text fits in the prompt, so that the subscription pools of cc, cx and ag are kept for work with tools and files. They are paid from API credits, not from a subscription pool: they have no POOLS row, suggest: never names them, and diag readiness, observation refresh and the accounts leave them out. PeerHub does not show the credit balance (no source for it is known).
peerhub ask ca --query-file review.md --profile ca.effort # its own stream: peer:ca: peerhub ask oa --query-file review.md --stream vote-oa-001 --profile oa.standard Profiles: ca.standard (claude-haiku-5-5), ca.effort (claude-sonnet-5-5), ca.deepthink (claude-opus-5-5), oa.standard (gpt-6-luna), oa.effort (gpt-6.1-sol), oa.deepthink (gpt-6-astra); peerhub explain ca.standard shows a card. --model must match ^claude-[a-z0-9.-]{1,64}$ for ca and ^gpt-[a-z0-9.-]{1,64}$ for oa. A custom peer uses --adapter ca or --adapter oa.
What was measured: ca.standard answered a real call on 2026-11-15, and a real prompt whose first line was @ came back as the literal path, without the file's content. oa was checked against a local test server and without a key; a real reply through oa has not been recorded yet.
The store is .peerhub/core.db. Discovery picks the nearest one (current directory, then parents); --db PATH takes precedence over PEERHUB_DB, then discovery (nearest wins). If discovery misses inside a Git worktree, PeerHub asks Git for the common directory and searches the main checkout and its parents. This fallback requires Git >=2.36. A local store still wins. peerhub diag health reports store_selection (the path and how it was chosen: explicit, env, discovered, default). Developer scratch (live-gate JUnit etc.) goes under .peerhub/work/; the top of .peerhub/ holds the database and its restore.epoch metadata.
Use global --db PATH before the command, or PEERHUB_DB, to select a store explicitly. An explicit missing path is never redirected to another store. ask --workspace DIR searches only that directory, then Git's main checkout root on a miss (never its parents), unless a database was explicitly selected. A main root already searched is skipped. Without an explicit selection, a discovery miss exits 5 with [store_missing] and a next: hint before creating files or contacting providers. To bootstrap a new store, including with peer register in a fresh directory, pass --db .peerhub/core.db or set PEERHUB_DB. Read-only commands do not create a missing store even when explicitly selected.
Stop clients before restoring a store and reopen them afterward. Snapshot and bundle restores fence old CoreStore instances from reads and writes using workspace.generation; changes to the bundle rollback marker restore.epoch also fence old instances. A stale instance raises StoreReplacedError.
Monitor and diagnostics refuse a missing selected database with exit 5 before any probes. Create it explicitly with peerhub --db peer register --peer --name . Observation refresh also refuses a missing automatically selected store, including in a non-repository directory; an explicit --db or PEERHUB_DB retains its existing collection bootstrap behaviour.
To continue an active multi-turn conversation with the same vendor session:
# Turn 1: Initial prompt on a dedicated stream peerhub ask cx "Explain the store schema" --stream convo-01 --request-id turn-001 # Turn 2: Continue using the native session peerhub ask cx "Now show an append example" --stream convo-01 --request-id turn-002 The Bridge retains up to 20 non-tombstoned sessions per peer/Stream and expires sessions after more than 30 days of inactivity. Tombstones remain audit rows; generations never rewind. Compatible history can be reused after a binding changes back. Request-id replay returns its original session snapshot even if the handle later expires. Historical asks lacking complete selector identity metadata are inspectable as Records but cannot be replayed through the new interface; do not retry uncertain work. Use peerhub session list and peerhub session show for bounded, read-only session inspection. See the registry contract.
To create another generation on the same Stream, then return to the first session, copy its full handle from the first result:
peerhub ask cx "Start another conversation with Stream context" --stream convo-01 --request-id turn-003 --fresh peerhub ask cx "Continue the first conversation" --stream convo-01 --request-id turn-004 --session Exact reuse includes intervening eligible Records, including the other session's responses. Python uses ask(..., fresh=True) or ask(..., session="sess_0123456789abcdef"). Handles belong to one store, Stream, Peer and workspace lineage; full binding and continuity must match.
When a turn encounters a timeout, silence abort, or disconnect, the stream may enter blocked_uncertain. Retrying the same --request-id cannot replay an uncertain execution because it may have partially executed remotely. To recover safely, start subsequent turns on a new stream:
# Inspect the current health and failure state peerhub diag health --stream convo-01 # Recover: include a short summary of the committed context in the new prompt peerhub ask cx "Context: We reviewed the Core schema; Peer, Stream, Record and Offset are the four primitives. Next, show an append example." --stream convo-02 --request-id rec-001 A fresh stream cannot see the old stream's records. Replace the example context with a short summary of your committed work and the next safe action. Inspect the old records with peerhub record read --stream convo-01 --after 0 --limit 10 if needed; an uncertain remote action may already have occurred, so do not assume it failed or replay its request ID.
diag inspects local database state and committed snapshots without contacting provider networks or consuming quota:
# Read-only store and stream diagnostics peerhub diag peerhub diag health peerhub diag quota --json # Lease-active asks (a lease is not proof a process is alive) peerhub diag running # Per-pool spend/hold/rest/blocked with target %/h until reset (stored observations only) peerhub diag --plan Upgrade To upgrade PeerHub safely:
pip install -U peerhub # or pipx upgrade peerhub # or uv tool upgrade peerhub Restart monitor: peerhub monitor Uninstall pipx uninstall peerhub # or uv tool uninstall peerhub # or pip uninstall peerhub Note: Uninstalling the package removes executable entrypoints but retains the local database and artifacts in .peerhub/. To delete store data, remove the .peerhub/ directory manually.
peerhub/ core/ Peer, Stream, Record, Offset; SQLite storage extensions/ Bridge, Observation, Diag, Artifact, Work, Search, Routing, … cli/ public parser and command handlers config_data/ packaged provider model defaults tests/ communication/ Core, delivery, observations, migration and package gates continuity/ extension host, artifacts, work, skills, backup and eval collaboration/ federation, memory, search, routing, orchestration and approval tools/ maintainer scripts a2a_sdk_echo_server.py a2a_sdk_interop.py ci_platform.py command_inventory.py lint_changelog.py live_gate.py model_ping.py quota_report.py release_evidence.py release_notes.py traceability.py Milestones describe development progress, not runtime ownership. Frozen specifications, historical evidence and existing durable wire/storage identifiers retain their original names. See the cleanup decisions and AG review.
Profiles (model, effort, pools, and a short evidence-backed card: use for / avoid for / traits; peerhub profile show ID) and observed CLI versions live in peerhub/config_data/model-defaults.toml (the single source); docs/model-profiles/model-profiles.json is the refresh recipe (sources, tier rules, update targets). Run the refresh-model-profiles skill (or query installed CLIs per manifest instructions) to verify models, update observed_at/observed_versions, and bump the defaults revision. Observations are evidence, not policy: profile model and effort definitions require explicit review and approval.
See the documentation map for all documentation.
These are environment warnings; historical observations do not establish a current failure on every installation.
python -m pytest -q pyright python tools/command_inventory.py --check python tools/traceability.py --upto 9 # Real provider canaries spend quota: local only, never in CI (refuses when CI is set). python -m tools.live_gate --yes Real providers are opt-in: set PEERHUB_LIVE=1 and select live, slow, e2e or canary under tests/communication/live; live fixtures refuse CI. -m live selects exactly the six M1 live-tier tests; slow/e2e release cases use their own markers. The gate partitions those stages. Optional canary tests are outside the release catalog and measure usage, native resume recall, writable sentinel creation and cancellation using standard profiles. Use python -m tools.live_gate --yes --only canary --peer cx for lower-cost measurements; these results are not release evidence. See the local live gate guidance for call budgets and skip behavior. Soak is separately opt-in with PEERHUB_SOAK=1. Local checks do not promote a milestone or authorize a release; candidate-matched CI, live and package evidence still apply.
Historical evidence is retained separately: the 2026-10-04 archived snapshot has VERIFIED-LOCAL records, and the recorded CI head has VERIFIED-CI records. Those records preserve their original paths and apply only to the recorded snapshot/head, not this changed worktree.
Both files in this release have provenance metadata.
ai-agents cli coordination multi-agent orchestration
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
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 verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 16, 2026.
Both files in this release have been uploaded with provenance metadata.
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.




