/seshi:setupfrom seshi
Guides users through installing, configuring, and deploying seshi (session capture for coding agents) on a machine or for a team, with step-by-step instructions and secret-handling best practices.
Ships in seshi. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
These are instructions for a coding agent (Claude Code, Codex, Cursor, …) setting seshi up for the person it works with: trying it out on one laptop, using it for real alone, setting it up for a team, or joining a team someone else set up. Follow them in order. The person decides; you ask, explain in a sentence, run the commands and read their results.
seshi-invite-*.txt files that hold them) are secrets. Anything you print,
read or put on a command line lands in this session's transcript, which seshi itself may
later upload. So:
cat, echo, grep or otherwise read a file that holds a secret, and never put a
secret in a command's arguments (--key <value>, --token <value>). seshi reads them from
standard input: --key -, --token -.( umask 077; set -C; … ) (set -C refuses to overwrite a file already
there, so a retry cannot wipe a secret saved before). Write to a .new name and move it
into place only when the command succeeded, so a failed run leaves no empty file behind
(section 3d shows it for admin init). test -s <file> says whether a file holds
something without reading it.jq -r '.org_key.token // error("no org key in this file")' secrets/admin-init.json | seshi login --server <url> --key -
(the error sends nothing down the pipe when the field is missing, where plain jq -r
would send the word null; without jq:
python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["org_key"]["token"])' secrets/admin-init.json).( umask 077; set -C; openssl rand -hex 32 > secrets/seshi-session-key ), or append them
to an env file without showing them, only when the name is not there yet (grep -q
prints nothing):
grep -q '^SESHI_AUTH__SESSION_KEYS__K1=' .env || printf 'SESHI_AUTH__SESSION_KEYS__K1=%s\n' "$(openssl rand -hex 32)" >> .env.
Replacing a session key signs every member out; that is the person's call.seshi capture install changes each agent's
own settings. Run it with --dry-run --json first, show the person which files change, and
go ahead only when they say so. The same for seshi local capture (preview without --yes).--json and exit codes, not prose. Every command but serve and hook takes
--json: one JSON document on stdout, or {"error": {"code", "message"}} on stderr. Exit
codes: 0 ok, 2 usage, 3 config or bucket unusable, 4 not found, 5 not signed in or
not allowed, 6 refused because of current state, 7 unreachable, 8 worked but something
needs a look. On anything but 0 or 8, show the person the error message and stop to decide.Some commands keep running (seshi local, seshi login while it waits, seshi serve). Run
those in the background with their output going to a log file (in Claude Code, a background
Bash command; elsewhere nohup … > log 2>&1 &), read the log for what you need, and stop them
when done.
seshi --version # installed?
seshi whoami --json # signed in to a server, or set up serverless? exit 5: neither
seshi capture status --json # which agents are wired in, and anything that needs action
If seshi is not found, offer to install it and run the installer only when the person agrees:
curl -fsSL https://github.com/dosu-ai/seshi/releases/latest/download/install.sh | sh # macOS, Linux
# Windows PowerShell: irm https://github.com/dosu-ai/seshi/releases/latest/download/install.ps1 | iex
# or: npm i -g @dosu/seshi
The script puts seshi in ~/.local/bin and may add it to the shell's PATH for new shells;
in this shell, call it as ~/.local/bin/seshi until then.
If whoami already names a server or a bucket, seshi is set up: say what it says, run
seshi doctor --json (section 5), and ask whether they want to change anything before you
start over.
Ask these together, offering the choices:
--join, or a link ending in /join#seshi_…), and say to answer yes or no
without pasting it: it is a secret. Otherwise ask for the server URL or the bucket URL.
Then 3e.file://, one machine only), AWS S3
(s3://), Cloudflare R2 (r2://), Azure Blob Storage (az://), Google Cloud Storage
(gs://), or another S3-compatible store such as MinIO (s3:// with an endpoint). Backblaze
B2, DigitalOcean Spaces and GCS's S3 API lack conditional writes and cannot hold a seshi
bucket.deploy/compose/), Kubernetes (the Helm chart
oci://ghcr.io/dosu-ai/charts/seshi), another container platform (the image
ghcr.io/dosu-ai/seshi), or this machine, to try it.Then list the agents seshi capture install --dry-run --json finds (agents[].agent) and ask
which to capture; all of them is the default.
seshi local --no-open --json # keeps running: start it in the background, log to a file
The first JSON document in its log has url (the local page, with a one-time viewer token,
served on 127.0.0.1 only) and sample (the synthetic session, how many records were redacted
and by which rules). Give the person the url. Then, against the same sandbox:
seshi local sessions ls
seshi local search "pool timeout"
seshi local capture --json # a preview: which agent files and which store real capture would use
Nothing outside ~/.local/share/seshi/local changes. When they want to capture their real
sessions, show the preview's destination and agents, and with their go-ahead run
seshi local capture --yes --json: it creates a local store (~/.local/share/seshi/store) and
wires in every agent it found. It takes no agent names, so when the person picked only some
agents, or when you are Claude Code running this from the seshi plugin (whose hooks
local capture would add a second time), set the store up with init as in 3b
instead. Go to 5. seshi local reset --yes removes the
sandbox (stop seshi local first).
A local folder, with every agent seshi finds:
seshi local capture --json # preview
seshi local capture --yes --json # with their go-ahead: a store at ~/.local/share/seshi/store, and every agent found
With --json it sends no past sessions. To make their history searchable too, ask whether they
want the last 30 days or all of it, and add --backfill 30d or --backfill all (every past
session however old, no date range, no cap); either way the sessions are stored private to them.
Sending past transcripts is their call, so ask first.
local capture takes no agent names. When the person picked only some agents, or when you are
Claude Code running this from the seshi plugin (which already has Claude Code's hooks, so
local capture would add them a second time), make the folder store with init and install
only the agents that need it in 4:
seshi init --serverless --url "file://$HOME/.local/share/seshi/store" --owner <name> --json
Or a bucket of their own:
seshi init --serverless --url s3://<bucket>/<prefix> --region <region> --owner <name> --json
# r2://<bucket>/<prefix> --account-id <id> az://<container>/<prefix> --account-name <name>
# gs://<bucket>/<prefix> s3://… --endpoint <url> for MinIO and the like
The owner is the folder their sessions go in: ask for it (their email or username; seshi
lowercases it), since without a terminal init may refuse to guess it. Run without a terminal,
init stores no key and seshi uses the environment's credentials from
then on: an AWS profile or AWS_* variables, R2_*, AZURE_STORAGE_*, or for gs://
Application Default Credentials (gcloud auth application-default login, which the person
runs). That is the best choice when the person already has credentials set up. To store a key
in the keychain instead, ask the person to run the same seshi init command in their own
terminal: it asks for the key without showing it. init runs the storage test and refuses a
store without conditional writes (exit 3): show the message.
Then 4.
The admin, once, with a key that can write the whole bucket (credentials as in 3b):
seshi init --serverless --url s3://<bucket>/<prefix> --region <region> --owner <name> --admin --json
seshi admin config pull seshi-config # the bucket's shared settings, into ./seshi-config/
Offer to go through seshi-config/seshi.toml with them (redaction packs, model review, search;
config.md). Model review keys go in as { env = "NAME" }, never as values.
seshi admin config push seshi-config --dry-run, then without --dry-run when they agree.
Each member needs a bucket key of their own, limited to their folder where the store allows it (serverless.md has IAM policies; R2, Azure and GCS cannot limit a key to a folder). Writing those policies, or the commands that make them, is work you can offer; creating keys in their cloud account is theirs to approve.
Write the person a short message to send members, with the exact commands:
seshi init --serverless --url s3://<bucket>/<prefix> --region <region> --owner <their-name>
seshi capture install
seshi doctor
Then 4 for the admin's own laptop.
Work in a folder for the deployment (the Docker kit's folder, or a new one). Keep secrets in a
secrets/ folder there: ( umask 077; mkdir -p secrets ), and add secrets/ to
.gitignore if it is in a repository.
The config. With the Docker kit, copy deploy/compose/.env.example to .env
(chmod 600 .env) and set SESHI_* names there; otherwise write seshi.toml (start from
seshi.example.toml). Every secret is a reference, { env = "NAME" } or
{ file = "/path" }, never a value in the file. For the bucket, prefer the platform's own
identity (an ECS task role, EKS Pod Identity, GKE Workload Identity, AKS workload identity),
which needs no key at all.
[store]
url = "s3://<bucket>/<prefix>"
region = "<region>"
Sign-in through an IdP. The person registers seshi's CLI in their IdP as a public (native)
client with the device authorization grant enabled, no client secret, and gives you the
issuer URL and client id; those two are not secrets. Ask which claim names a person (email
matches org-key usernames; oid on Entra; sub by default) and who are admins (an IdP group,
or a list of emails for IdPs whose tokens carry no groups, such as Google):
[auth]
admins = ["<admin email>"] # or oidc.admin_group
[auth.oidc]
issuer = "https://<idp>"
client_id = "<client id>"
owner_claim = "email"
[auth.session_keys]
k1 = { file = "/absolute/path/to/secrets/seshi-session-key" }
Make the session key without seeing it, as in the ground rules:
( umask 077; set -C; openssl rand -hex 32 > secrets/seshi-session-key ). seshi reads a
{ file = … } secret when it loads the config, so the path must be where the file is for
every command that reads this config: its absolute path on this machine, or, in a container,
the path it is mounted at (then config check and admin init run in the container too). The
image runs as uid 1000, which must be able to read the file. With the Docker kit, add
SESHI_AUTH__SESSION_KEYS__K1 to .env instead, with the guarded printf in the ground
rules. Without an IdP,
leave [auth.oidc] out: members sign in with the org key.
Check it, then fix what it says and check again:
seshi config check --config seshi.toml --json # Docker kit: docker compose run --rm seshi config check --json
The first admin token and the org key. admin init prints them once. Never let it print to
your terminal, never overwrite a file it saved before, and keep its output only when it worked:
test -s secrets/admin-init.json && echo "already saved" || ( umask 077; set -C
if seshi admin init --config seshi.toml --json > secrets/admin-init.json.new
then mv secrets/admin-init.json.new secrets/admin-init.json
else rm -f secrets/admin-init.json.new; exit 1; fi )
admin init --config opens the bucket from this machine, so it needs bucket credentials here.
Where only the deployment can reach the bucket (a task role, workload identity), and with the
Docker kit, run it inside the running server instead, in the same wrapper:
docker compose exec -T seshi seshi admin init --json (Docker kit, once the server is up) or
kubectl exec -i <server pod> -- seshi admin init --json (Kubernetes). The same goes for
doctor --config below.
Tell the person where the file is and that it holds the admin token and the org key: they
should move both to their password manager and delete the file. already saved means an
earlier run saved it: use it. Exit 6 means admin init was run before, and the file was not
kept; --force makes another admin token, --rotate-org-key replaces the org key (every
member then signs in again). Both are the person's call; save their output under a new name
(secrets/admin-init-2.json), the same way, and read only the field it has.
Run it. Docker kit: docker compose up -d --wait, with compose.tls.yaml for HTTPS
(KIT_SITE_ADDRESS set to the server's DNS name). Kubernetes: the Helm chart's README. Elsewhere:
the image, or seshi serve --config seshi.toml. It needs TLS in front of it before laptops
use it. Then:
seshi healthcheck --url https://<server>/healthz --json # {ok, url, version}
seshi doctor --config seshi.toml --json # the server's own checks, where its config is
The admin's own laptop. Sign in as in 3e, through the IdP (the "without an invite" paragraph: the admin has no invite). Without an IdP, sign in with the admin token from the file, piped:
jq -r '.admin.token // error("no admin token in this file")' secrets/admin-init.json | seshi login --server https://<server> --token - --json
Inviting members. For each member, seshi invite <username> prints a single-use link (7 days
by default, --expires up to 30d) and the one command that installs seshi, signs them in, hooks up
their agents and offers to make their past sessions searchable. With an IdP, seshi invite --email <their address> (or no argument, for anyone the IdP signs in). Either way the link is
as good as a password until it is used (with an IdP, for anyone it lets in), so keep it out of
your context like the org key: ask the person to run seshi invite in their own terminal, or
write it to a file only they can read, never over one saved before:
f=~/seshi-invite-<username>.txt
test -s "$f" && echo "already saved" || ( umask 077; set -C
if seshi invite <username> > "$f.new"
then mv "$f.new" "$f" || { echo "the invite is in $f.new"; exit 1; }
else rm -f "$f.new"; exit 1; fi )
Tell them where the file is. They send each member their own command, directly. seshi tokens ls --kind invite --all shows which were used. Invites replace handing out the org key; once everyone has joined,
the admin can turn it off with auth.org_key.enabled = false (config.md).
Then 4.
With an invite link (the usual way to join a server): the command the admin sent installs
seshi, signs in, runs seshi capture install (which changes each agent's settings, so say so
first; where seshi is installed already, seshi join --no-capture '<link>' leaves that to
4 and its preview) and asks before sending any past sessions. Treat the
link as a secret: ask the person to paste the whole command into their own terminal (not into
this chat) and tell you when it finishes. If seshi is already installed, seshi join '<link>'
does the same. It asks its own questions (the sign-in, then whether to send the last 30 days),
so it needs their terminal; --no-backfill skips the question, and --backfill all sends every
past session (no date range) without asking, when they want all of their history. Afterwards check with
seshi whoami --json and seshi capture status --json. If the status shows their agents wired
in, from 4 only offer the status line and MCP, then
5; if not (join says so when capture failed), do 4
in full. A link that was already used or has
expired is refused: ask the admin for a new one.
A server with an IdP, without an invite:
seshi login --server https://<server> # keeps running until they finish: start it in the background, log to a file
The log says To sign in, open <URL> and enter the code <CODE>. Show the person the URL and the
code, ask them to finish in their browser, and wait for the command to exit. Exit 0 is done;
--browser opens the sign-in page on this machine instead, where the IdP has no device flow.
The person can also run the command in their own terminal and tell you when they are done.
A server with the org key, without an invite: the admin sent the key; ask the person to save it to a file
(for example ~/seshi-org-key, readable only by them) or to run seshi login --server <url> in their
own terminal, which asks for it without showing it. From a file:
seshi login --server https://<server> --key - --user <their email> --json < ~/seshi-org-key
Then offer to delete the file: seshi keeps the key in the keychain.
A serverless bucket: seshi init --serverless --url <url> … --owner <name> as in 3b,
with the key the admin gave them in their environment, or run by the person in their terminal.
Check with seshi whoami --json, then 4.
seshi capture install --dry-run --json # or name the agents: claude-code codex cursor pi opencode
Show the person, per agent, the files it creates or modifies (agents[].files[].path and
summary), and the agents it skipped. Install only with their go-ahead:
seshi capture install <agents…> --json
Always name the agents: with no names, install wires in every agent it finds, not none.
Add --service if they want the uploader kept running between sessions (a launchd agent,
systemd user unit or scheduled task). If you are Claude Code and the seshi plugin is installed
(this skill came from it), the plugin already gives Claude Code its hooks and
/session-capture: leave claude-code out of the list (and when nothing is left, skip
install), and offer to add the status line to
~/.claude/settings.json ("statusLine": {"type": "command", "command": "seshi statusline"}).
Restart pi and OpenCode after an install; Cursor suggests its status bar extension.
Sessions started from now on are captured; this one, started before the hooks, is not. Offer to
let agents read the team's sessions through MCP (agents.md):
claude mcp add seshi -- seshi mcp in Claude Code, or {"command": "seshi", "args": ["mcp"]}
in another client's MCP config.
seshi capture status --json
seshi doctor --json # exit 8: a check failed; each check has a status and what to do
Right after install, doctor may find no sessions yet: that is expected. Ask the person to
start a new agent session, take one turn, and run seshi doctor --session --json (or
seshi doctor --json again) to see it captured end to end. In serverless mode doctor first
checks the bucket: its marker, the storage test, read access and the shared settings.
End with a few lines: where sessions go, who can read them, the commands they will use
(seshi sessions ls, seshi search <words>, seshi explore), that /session-capture off (or
$session-capture off in Codex) stops capturing the session they are in and retracts it, and
anything still to do (members to onboard, a file of secrets to move and delete, TLS to put in
front of the server).
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub dosu-ai/seshi --plugin seshi2 skills in this plugin
Other plugins' skills for the same job