OpenSession is a local-first workflow for recording, registering, sharing, and inspecting AI session traces.
Website: opensession.io
Docs: opensession.io/docs
The CLI/Web/API contract is now centered on three actions:
register: store canonical HAIL JSONL locally (no network side effects)share: produce a shareable output from a Source URIhandoff: build immutable artifacts and manage artifact aliases
Legacy command trees and routes were removed:
opensession publish ...removedopensession session handoff ...removed- Legacy shortcut routes (
/git,/gh/*,/resolve/*) are no longer served and return 404 by design /api/ingest/previewremoved in favor of/api/parse/preview
os://src/local/<sha256>os://src/gh/<owner>/<repo>/ref/<ref_enc>/path/<path...>os://src/gl/<project_b64>/ref/<ref_enc>/path/<path...>os://src/git/<remote_b64>/ref/<ref_enc>/path/<path...>os://artifact/<sha256>
Notes:
ref_encis RFC3986 percent-encoding.project_b64/remote_b64are base64url without padding.
cargo install opensessionopensession is the user-facing CLI. Session auto-capture additionally requires the daemon process to be running.
# 1) Install/update pre-push fanout hook + shim in this repo
opensession setup
# 2) Verify hook/shim + expected ledger ref + daemon status
opensession setup --checkStart daemon (required for automatic session capture):
# if opensession-daemon binary is available
opensession-daemon run
# from source checkout
cargo run -p opensession-daemon -- runWithout daemon, parse/register/share still work manually, but background auto-capture is not active.
# Parse agent-native log -> canonical HAIL JSONL
opensession parse --profile codex ./raw-session.jsonl > ./session.hail.jsonl
# Register to local object store (repo-scoped by default)
opensession register ./session.hail.jsonl
# -> os://src/local/<sha256>
# Read it back
opensession cat os://src/local/<sha256>
# Inspect summary metadata
opensession inspect os://src/local/<sha256># Convert local URI -> git shareable source URI
opensession share os://src/local/<sha256> --git --remote origin
# Optional network mutation
opensession share os://src/local/<sha256> --git --remote origin --push
# Install/update OpenSession pre-push hook (best-effort fanout)
opensession setup
opensession setup --check
# Optional: fail push when fanout is unavailable/fails
OPENSESSION_STRICT=1 git push
# Web URL generation from remote-resolvable URI
opensession config init --base-url https://opensession.io
opensession share os://src/git/<remote_b64>/ref/<ref_enc>/path/<path...> --webshare --web requires explicit .opensession/config.toml.
Git-native writes now target hidden ledger refs (refs/opensession/branches/<branch_b64url>); legacy fixed ref writes are removed.
opensession setup also installs a shim at ~/.local/share/opensession/bin/opensession for hook stability.
# Build immutable artifact
opensession handoff build --from os://src/local/<sha256> --pin latest
# -> os://artifact/<sha256>
# Read artifact payload in desired representation
opensession handoff artifacts get os://artifact/<sha256> --format canonical --encode jsonl
# Verify hash + payload validity
opensession handoff artifacts verify os://artifact/<sha256>
# Alias management
opensession handoff artifacts pin latest os://artifact/<sha256>
opensession handoff artifacts unpin latest
# Removal policy: only unpinned artifacts
opensession handoff artifacts rm os://artifact/<sha256>/src/gh/<owner>/<repo>/ref/<ref_enc>/path/<path...>/src/gl/<project_b64>/ref/<ref_enc>/path/<path...>/src/git/<remote_b64>/ref/<ref_enc>/path/<path...>
GET /api/healthGET /api/capabilitiesPOST /api/parse/previewGET /api/sessionsGET /api/sessions/{id}GET /api/sessions/{id}/rawDELETE /api/admin/sessions/{id}(requiresX-OpenSession-Admin-Key)
# Required validation gates
./.githooks/pre-commit
./.githooks/pre-push# Runtime web validation
npx wrangler dev --ip 127.0.0.1 --port 8788 --persist-to .wrangler/state
BASE_URL=http://127.0.0.1:8788 npx playwright test e2e/git-share.spec.ts --config playwright.config.ts