Skip to content

Background session capture

Most agent work doesn't start with a Polygraph session. Someone runs claude in a repo, gets a fix, opens a pull request, and closes the terminal. The reasoning behind that pull request is gone before anyone reviews it.

Background session capture records those sessions anyway. When the pull request lands, Polygraph attaches the transcript to it, so the change arrives with the work that produced it.

Background session capture is opt-in. Until an organization admin turns it on, only transcripts from explicitly started/resumed Polygraph sessions will be uploaded.

Go to Account settings > Agent logs and turn on Background session capture, then select Save changes. The setting applies to the whole organization.

Each developer also needs the Polygraph plugin installed and a signed-in CLI with an account selected. Only sessions from repositories that are connected to the Polygraph account are ever uploaded.

A capture on its own is a transcript with no pull request attached. Polygraph matches it to the work it produced using three keys plus a time window:

KeyRule
RepositoryThe capture and the pull request are in the same repository.
BranchThe branch checked out during the session matches the pull request's head branch.
AuthorThe developer who ran the session opened the pull request.
TimeThe session overlaps the pull request's life, with 14 days of slack on each side.

The time window runs from when the pull request was opened until it merged or closed, or until now while it's still open. The slack on each side means a session that started well before the branch existed, or a pull request opened later, still matches.

A capture goes unmatched when the branch never became a pull request, when someone else opened the pull request, or when the work happened on a detached HEAD. Unmatched captures don't appear anywhere in the UI, and nobody can read their transcript.

A matched capture turns a pull request you can only read as a diff into a session you can question.

Open the session from the pull request and the transcript is there: the prompts, the tool calls, the approaches that got tried and dropped. From there it behaves like any other session, so you can ask the agent what the diff doesn't say:

What alternatives were considered, and why were they rejected?

For the questions worth asking and how to run an independent second opinion, see code reviews. For a worked example, see review code with full context.

Recording a session and letting your teammates read it are two different settings.

Background session capture decides whether a transcript is recorded. Session log sharing settings decide who can read it, and they apply to captured sessions exactly as they apply to sessions you start yourself. Turning capture on doesn't widen who sees anything.

Secret redaction also runs on captured sessions. Each line is scanned locally and secret-shaped values are replaced before anything leaves the machine. For what redaction covers and where its limits are, see security.