Before you begin
You need the following:- A macOS or Linux machine with Git and
curlonPATH. The installer refuses native Windows. - The deployment’s HTTPS URL, its Sediment version, and your capture token from the operator. For a local trial, use the Quickstart instead.
- A git repository
- Claude Code, Codex, Cursor, or pi. Start each agent once so that its configuration directory exists; the installer skips an agent without one.
Install the CLI
Install the version that the deployment runs:PATH instruction, run it. Then check that sediment --version
prints the same version.
Connect the CLI
Sign in with your capture token:~/.sediment/config.json with mode 0600. To sign in without a
prompt, pipe the token on standard input:
localhost, 127.0.0.0/8, and [::1].
Install capture
Run the installer for each repository that you want to capture:~/.sediment/env.sh and a fish equivalent, and loads them from your shell
profiles. Rerun it after you install another agent, or for another repository.
Each run rewrites env.sh from the flags that you pass, so always pass the same
--user-id. Otherwise the rerun drops it. The installer changes only
Sediment’s own entries in agent configuration.
Start each agent from a shell that loaded env.sh. Fully quit a running
desktop agent first, because it keeps its old environment. Cursor is the
exception: its hooks read env.sh directly.
The hooks call the CLI by its absolute path. If you move or reinstall the CLI,
rerun sediment install.
If another system manages the agents’ environment, pass --no-env, and set
SEDIMENT_OTLP_ENDPOINT and SEDIMENT_INGEST_TOKEN there yourself. With
--no-env, Cursor’s hooks also read Cursor’s process environment instead of
env.sh. The CLI reference lists every
flag.
Opt in to transcript capture
Transcript capture sends the text that the agent applied and the file’s content at Session end, which produces Edit observations. Claude Code also records external line counts, Rejected edits, and Retry linkages. Review Privacy boundaries and ceilings before you opt in. Rerun the installer with your usual flags plus--transcripts:
--no-env, set SEDIMENT_OTLP_ENDPOINT and SEDIMENT_INGEST_TOKEN in the
agent’s environment, and SEDIMENT_PI_TRANSCRIPTS=1 for pi.
Route inference calls through a gateway
If your deployment captures Inference calls, your operator routes agents through its gateway and distributes the gateway URL and client credential, as described in Distribute gateway routing.sediment install doesn’t configure gateway routing, and you don’t need a
gateway credential.
Verify capture
-
Check the machine and repository configuration:
doctorprintsok,FAIL, orinfofor each check and exits1on a failure. It checks configuration, not delivery. -
Have an agent edit a file, commit the change, and read the commit’s Session
note:
-
To check delivery, also sign in with an operator token. A capture token
can’t read data:
Then check the Session with the steps in your agent’s guide.
git ls-remote origin 'refs/notes/*' lists
refs/notes/sediment when the remote has the note.
What the installer changes
Agent hooks
Each supported edit marks the Session in the repository’s Git directory.
Git hooks
The installer adds three marked blocks to the repository’s hooks:post-commitwrites the marked Session identifiers torefs/notes/sediment.prepare-commit-msgcarries notes through a local squash merge.pre-pushreconciles and pushes the notes ref with the branch.
core.hooksPath
setups, and never replaces them. It leaves a non-shell hook untouched and
prints the command to add by hand. It also sets
notes.rewriteRef=refs/notes/sediment, so Git carries notes through
commit --amend and rebase.
The hooks never fail a commit or push. They log failures, without content, to
~/.sediment/attribution.log, so a successful commit doesn’t prove capture.
Repair or recover capture
Repair a notes ref
Ifdoctor --fetch reports a notes ref that’s behind or diverged, reconcile it:
Recover a pending stamp
If~/.sediment/attribution.log reports stamp_busy, a read or write failure,
or interrupted cleanup, compare the recorded commit with the current one:
HEAD is still the recorded commit, run sediment stamp, and read the note
again. If HEAD moved, don’t stamp the pending markers onto the newer commit.
Concurrent marker capture
explains the recovery boundary.
Before you upgrade the CLI, pause commits in every worktree of the clone and
recover any pending stamps. Then upgrade every installed copy together, and
restart the agents. An older CLI can erase a newer one’s markers.
Install hooks in an existing clone
A clone that the installer never saw has no git hooks. Run the install command with your usual flags for it, or use the fleet owner allowlist.Recover transcript pairs
If a Claude Code or pi Session ended without running its extractor, run the extractor on the saved transcript. Set--agent to claude-code or pi:
Preserve prepared payloads through outages
Without a buffer, an event that a client can’t deliver during a server outage can be lost. To keep payloads on disk and replay them, setSEDIMENT_DELIVERY_DIR to an absolute path on persistent storage, in both the
sender’s and the replay worker’s environment. Let the sender create the
directory, with mode 0700. It refuses a symlink, a directory that another
user owns, or a mode other than 0700, and falls back to a direct send. The
buffer
can hold unredacted prompts, code, or credentials, so use it only with
participants’ approval, and on an encrypted volume if you need encryption at
rest.
The buffer covers pi decisions, transcript extraction, and the LiteLLM gateway
callback. It doesn’t cover Cursor hooks, native Codex telemetry, or forge
webhooks.
-
Run the replay worker under your process supervisor, as the same user and
with the same environment as the sender. Skip this step for the LiteLLM
callback, which runs its own worker:
-
Check the buffer:
sediment doctoralso checks the directory and the worker.
best_effort. Repair the directory, even if that send succeeds.
The worker retries transport errors, HTTP 408, HTTP 429, and server errors,
with backoff up to 60 seconds. Other client errors block an entry. To retry
blocked entries after you fix the token or upgrade the server, stop the worker,
and run:
status shows none
blocked. Then restart the worker.
When the buffer is full, it declines further payloads and keeps the pending
ones.
Expired content is removed only when a worker or replay command runs. Replay
sends each payload only to its original destination, so changing the endpoint
blocks older entries. Don’t reuse one buffer for another deployment.
Uninstall capture
To remove capture from one repository, run:--agents:
~/.pi/agent/settings.json. If you set capture
variables yourself, remove them from your shell profiles, and restart the
agents.
If the command reports a skipped Codex profile, remove only Sediment’s
telemetry block from that file by hand. Until you do, the profile keeps its
token and keeps sending telemetry. If you use several Codex homes, run
uninstall --agents for each one.