Agent Sessions
A session is one continuous conversation with a coding agent: every message, every file edit, every tool call, plus the branch and commit it produced. The CLI captures sessions in the background — you don’tbb start anything — and lets you resume them later, on any machine, by anyone on your team with access to the repo.
This is what makes bb agent-sessions resume feel like time travel.
How capture works
The momentbb is installed, it watches the on-disk session log of every supported coding agent:
Whenever an agent writes to its log,
bb indexes the new turns, attaches the current git state (repo, branch, HEAD commit, dirty paths), and writes a normalized session record to ~/.buildbetter/sessions/. If you’re signed in (bb login), the record syncs to your free BuildBetter workspace within a few seconds.
Where sessions are stored
.session.json is a self-contained record:
bb only stores the file paths and diffs the agent touched.
Resuming a session
The most common call:- Loads the prior conversation into the agent’s context window (compacted if it’s long)
- Replays the file edits as a virtual diff so the agent knows what it changed
- Surfaces the open questions the prior session left behind — not just a transcript, but a state you can keep working from
Resume by ID
If you already know the session you want — say it’s linked from a PR comment or a teammate sent it to you:Resume on a branch you didn’t start
You don’t need to be the original author. The picker shows everyone’s sessions for the current branch, and resuming pulls the conversation into your agent on your machine:Searching across sessions
Resume is for the current branch. When you need to find a session from somewhere else — a PR you reviewed last month, a feature whose name you forgot — search:--json if you want to pipe it into something:
PR linking
When you push a branch and open a PR,bb auto-attaches the session(s) that produced it. Reviewers can pull the chat to understand why the code looks the way it does — better than the PR description, and impossible to lose to a closed tab.
Workflows
Workflow: branch handoff
Spencer started a feature, has to step away. Maya picks it up.Workflow: post-merge context recovery
Six months later, a customer ticket lands on a system someone else built.Workflow: ticket → spec → PR loop
The full close-the-loop play with skills + sessions:Workflow: scripting in a pre-commit hook
Make sure every commit has an attached session, so the chat is never lost:Privacy & access
To delete:
Working offline
If you skipbb login, capture still works — sessions land in ~/.buildbetter/sessions/ and you can resume your own sessions on the same machine. You just lose cross-machine sync and teammate-resumable sessions. Sign in any time and the local backlog back-fills the cloud index.
Next steps
CLI reference
Every
bb command in one placeSkills
The slash commands that work alongside session resume