Sessions
A session belongs to the directory it ran in. Records live under ~/.bravebot/sessions, one
directory per working directory, so resuming in one project lists only that project's sessions.
Each session is named after a version 4 UUID and keeps up to three files:
| File | What it holds |
|---|---|
<id>.json | the record: the conversation, what the Sessions screen shows, and what a resume needs |
<id>.audit.jsonl | the trail, appended a turn at a time: one JSON object per line |
<id>.lock | empty: the lock a process holds while it writes the record |
Both are private to you. On Unix, session directories are created mode 0700 and records, trails
and the temporary files beside them are written mode 0600, with anything already there tightened on
write. Every write narrows the directory it lands in, including the one a fork
writes into. A record holds the whole conversation: your prompts, the model's replies, the file snippets
the planner was shown, and the standing permissions you granted.
/export writes the readable form of it out as markdown, so
reading a conversation back does not mean reading JSON out of the state directory.
Picking one back up
bravebot --resume # open the Sessions screen to choose one
bravebot --resume <id> # name one outright
bravebot -r <id> # the same
bravebot --continue # carry on with the most recent one, unnamed
bravebot -c # the same
The list is sorted on what each record says it was last written, not by id.
Typing narrows the list by title, branch and linked issue or pull request, and by what was said in
the session: the prompts you typed, the model's replies, the paths and commands its calls named,
and the notes you added. A session found that way shows the first
matching line under its title. Add since:7d
(h for hours, d for days, w for weeks) to keep only sessions written within that long. Tool
results, files you attached and imported sessions are not
searched. The records are read when you type the first character, so a long list pauses once.
From a script, bravebot sessions search does the same and prints a session's id and title on a
line each, newest first:
bravebot sessions search ledger rounding
bravebot sessions search since:2w workspace:../app flaky test
workspace: names the directory whose sessions are searched, and defaults to the current one. It
exits 1 and prints nothing when no session matches.
bravebot sessions list [--json] [--limit <n>] prints the sessions recorded for this directory, newest
first, one per line: the id, how long ago it was last written, the title, the branch, the front end
that wrote it and whether it can be continued. --limit defaults to 20, and a line on stderr says how
many were left out. --json prints one object per line with id, title, directory, updated,
branch, front and continuable, and nothing else. A limit of zero, one that is not a number, a
repeated flag or any other word is refused. Only sessions whose recorded directory is this one are
listed, so two directories that share a store do not show each other's sessions, which the
Sessions screen does not. A bare bravebot sessions lists
background sessions instead.
--continue takes the session the Sessions screen would offer first and picks it up exactly as naming its id
would. It passes over a
manifest run rather than
refusing it. Where this directory holds nothing continuable it says so and fails rather than starting
a fresh session.
From inside a session, /resume opens the same list, or
takes an id, and moves you onto that session without leaving the program.
Leaving a session prints the command that resumes it, after the terminal is handed back, so it
stays on the screen you are left looking at. A session that never wrote a record prints nothing.
The command carries the flags the session was started with, after the id:
--dangerously-skip-permissions or --dangerously-bypass-approvals-and-sandbox, whichever you typed,
--sandbox <mode>, --run-network, the --sandbox-allow-read, --sandbox-deny-read,
--sandbox-allow-write and --sandbox-deny-write paths, --settings, --auto, --safe,
--locked, --vet, --incognito, --tools, --no-shell, --log-level, --system-prompt and
--append-system-prompt, because a record keeps none of them and a resume without the flag runs
under your settings and asks again. A session started with none of them prints the id alone.
-i, its prompt, --agent, --issue and --pr are not repeated: the id names the session and
the record keeps the rest. --accept-edits is not repeated because a session cannot be started
with it. The paths of the four --sandbox-* flags are the ones typed on the command line, and not
the ones a settings file holds. The line carries the flags the process started with, so a mode you
left with the mode key, or a /sandbox change, is not in it. Values are printed in the spelling the
flag parses and without the white space around them, so --sandbox standard is printed
--sandbox workspace-write. Running the command resumes the session under the rules it started
under, including the ones that loosen it, so read the flags before you run it. A system prompt is
written to the terminal with the rest of the line, so it can reach the scrollback or a log. A value
that holds a control character is drawn as a picture of it, so pasting the line gives another value,
and for a --sandbox-deny-read or --sandbox-deny-write path that loses the restriction. Where a
session moved to another directory with /cd, a relative --sandbox-* path is printed as the
absolute entry it meant in the directory the session started in, with . and .. resolved, and a
relative --settings file is printed joined to the directory it was read from, so the line means
the same from the new directory. Where a name in the directory the session started in holds * or
?, a relative --sandbox-* path cannot be written out, because the full path reads that
character as a wildcard and no spelling names the same place from another directory. The line then
leaves that path off, and a note after it names each flag and value left off. The resumed session
runs without that path, so a deny path left off is not in force there. On Windows a path with a
backslash is quoted for a POSIX shell, which PowerShell and cmd do not read as one word. The other
places that tell you to resume a session, such as the Sessions screen reopening one from another
directory and the notes after /branch, /handoff, a manifest run and sessions import, name
the id and no flags.
A session is open in one place at a time. The process running a session holds its record, so
resuming it from a second terminal or window is refused, and the refusal names the session and says
to copy it with bravebot --fork <id>. --resume, --continue, the Sessions screen, /resume, a
one-shot run given a task, the desktop app and attach or reply on a stopped background session
all refuse in the same way. Two processes that wrote one record would each replace the other's turns,
and with them any file you had not trusted: the file would read as trusted afterwards. The hold ends
when the session does, or when its process does, however it ends. A record that another process wrote
after yours read it is not resumed either, and says to resume it again.
Trying a second approach
bravebot --fork <id>
bravebot -f <id>
Forking copies a session into a new one with an id of its own and opens that. The session you forked is left exactly as it was. The conversation, the spend history and the audit trail all come with the copy, since the gates that decided the shared prefix decided the fork's history too. The start time is reset and the title is marked.
From inside a session, /branch does the same and moves
you onto the copy, saying the id of the original so --resume reaches it.
A manifest run is refused, because there is no conversation inside one to carry on from. An incognito session writes no copy, so forking in one opens the conversation and records nothing.
A session that changed directory
/cd takes the record with it, written into the new directory
straight away rather than at the end of the next turn. Until it is saved there, there is nothing
there to find. The turns already written stay where they were written, and are still resumable there.
The line printed on the way out names the directory when the session ended somewhere other than
where the shell is standing, because --resume looks an id up under the directory it is run in.
Without the name, the same id in the old directory would quietly resume the session as it was before
the move.
The trail does not follow the session either. It is appended beside whichever record was current, so a move splits it. A resume replays the whole conversation and shows the gate decisions made in the directory you resumed from.
A manifest run is recorded, but cannot be continued
A plan-then-execute run is recorded as its own record and cannot be resumed. See Plan first, then execute.
What a resume restores
The conversation, the plan each turn was working to, what the session has spent, the branch it ran on, and the standing permissions its user granted:
- the trust map, including any rule a write recorded, which is what stops a resumed turn reading back a file an earlier turn of the same session poisoned;
- the list of commands you said to stop asking about;
- every question you asked with
/btw, and the answers the record could keep, which come back into the view Ctrl-L opens and into no conversation; - the turns a rewind can still reach, so
/undoafter a resume reaches the same turns it reached before; - the model the record names, which stays in force for the first save outside a turn as well, and the
pull request and issue you gave with
/prand/issue, and the issues and pull requests the session has met (up to 500).bravebot --forkcopies them, and/clearbegins a session with none.
Each turn also keeps its number, the prompt as it was shown, what came of it, and its task list, spend and timing, a turn that failed or was cancelled included. A recorded failure carries the reason the interface composed and never a message from the backend. A prompt handed back to the editor when you cancelled stays out of the transcript on resume, though it is still there to recall with Up.
Nothing else survives. A single-use endorsement is created by one approval, is bound to one value and is never written down, so a resumed turn cannot replay a write or a run an earlier turn was allowed. Answers to the planner's own questions live only in the running session, so a resumed session asks them again.
A resume does not ask the startup trust question, because the answer honoured is the one that session's own user gave. A record from before maps were kept has none, and is asked about. Resuming a session recorded by a different build says so, beside the note about a changed branch, and so does resuming one the other front end wrote: the terminal and the desktop app keep their sessions in the same place, and the transcript you are looking at was drawn by whichever of them recorded it.
The record holds the directory as a path and nothing that identifies the checkout standing there. If you remove a checkout, put a different one at the same path and resume an old session in it, the trust map and the commands you said to stop asking about come back for the new checkout, and it is not asked the startup trust question. Start a fresh session there instead, which asks both.
What the record accounts for
The record keeps the model that answered and what each turn spent, alongside the total. The name recorded is the one that answered, not the one you asked for, since an endpoint may serve something other than the name it was given.
Every turn's wall clock is written down split five ways: waiting on the model, running tools,
waiting for you to answer a prompt, waiting for another run to leave the file boundary, and whatever
is left over. The five are a partition rather than five separate measures, so an approval or a wait
for the file boundary drawn from inside a tool call is taken off the tool figure rather than counted
in both. /status reports the session total and each part that actually
happened, leaving out a part that did not rather than showing it as zero.
What a delegate spends is counted in the turn's tokens. Its seconds count only where they overlap the stretch the turn actually spent waiting on its delegates, and two delegates waiting at once are counted once, so a turn is never reported as having taken longer than it did.
A turn that failed or was stopped is recorded like any other, charging the progress it had made, completed delegate work included. A successful turn charges its outcome alone, and progress resets each turn, so a turn that completed no request cannot inherit the previous turn's figures.
A /compact asked for mid-turn is charged to the turn it interrupted, as its tokens are. Anything
asked for before the first turn, an aside or a command as the first thing a session does, is
charged to a leading entry ahead of that turn rather than to no turn at all. A record written before
any of this was kept reads as an empty breakdown, which is not the same as a session that took no
time: the durations that were kept are still there.
Asking what it has cost
/cost
reports the total and, under it, one figure per turn with that turn's share of the total beside it. What was spent before the first turn is reported too, without a turn number, since no turn did it. A record holding a total and no breakdown says the breakdown is missing, which is not the answer a session that has spent nothing gives.
The figures are tokens, not a bill. A prompt a service answered out of its own cache is billed at a fraction of a fresh one, and the breakdown keeps no cache split per turn, so a figure in money would be composed here rather than measured. What is written stays comparable across turns and across sessions, which is what the record is read for.
The session record does keep two totals for the whole session, not for each turn: the tokens the service answered out of its cache and the tokens it wrote into it. They are left out of the record while both are zero, so a service that reports no cache figure reads the same as one that missed. The info panel does not read them back, so a resumed session shows no cache figures until a turn has run in it.
Totalling what sessions spent
bravebot stats
adds the sessions, turns and tokens of every recorded session, with how many of the tokens the model
read and how many it wrote, where /cost reports the one in front of you. --days 7 keeps the
sessions last written in the last seven days, --models shows what each model spent, and
--project keeps the sessions that ran in this directory, or in the one --project <dir> names.
Every option is described under stats.
The same limits apply as for /cost: the figures are tokens, and a session is counted whole, under
the day it was last written and the model it ended on. The read and written figures cover the
sessions written by a version that kept them, and the tokens of the rest are in the unsplit column.
An incognito session leaves no record, so it is not in the total. A session you forked, or moved
with /cd, is counted once for each record it left, so its spend can appear more than once.
What is never written down
Nothing untrusted. Every message in the record has already passed the gate that decides what the planner may see, so what lands on disk is what the planner was allowed to hold. Quarantined content is not written at all, and the trail is labels and gate names with no content in it. A record is read back into a later turn's context, so anything written that the planner could not have held would enter that context on the next resume.
A rewind point is the one part of a record built from bytes no message carried: it holds what the files a turn wrote over held, read off the disk rather than out of the conversation. Those bytes go into the record only where the trust map that stood before the turn vouched for the path. What a file nobody vouched for held is written down as contents this session did not keep.
Vouching for a directory is not saying every file in it is worth copying elsewhere. A turn that
overwrites a file of credentials inside a project you trusted puts its previous contents into the
record, so they leave the project and land in the state directory. They go once the point ages out a
few turns later, and mode 0600 covers them while they are there, but a session that ends on such a
turn leaves them in its record until the record is deleted: by you, as
below, or once nothing has written it for
retentionDays days, which is 30 where you state none.
A pasted picture is written down, because it was never quarantined. It is part of your own message, and a session that turned on a screenshot would be no use resumed without it.
An answer to a /btw asked over an exchange that had met
something untrusted is not written down, for the same reason: it is the planner's own words over such
a context. The question is kept, the row on screen says the answer lasts as long as the window, and a
resume brings back the question alone.
Naming a session
A session's title is the first line of what you asked, cut rather than mangled if it is long. A
prompt with nothing in it still has a title. A /compact typed before any prompt writes no record
and does not fix the title; the first prompt that says something names the session.
/rename dependency audit
Renaming rewrites the record immediately, and a chosen name survives the next turn. An empty name is refused.
The terminal's title follows the name, as bravebot · dependency audit, so a row of tabs running
several sessions can be told apart. It is set once the session has a name and changes when the name
does, and your shell's own title comes back when you leave. While a turn is running the title starts
with ✦, and while an approval or a question is waiting for you it starts with [!], so the tab
that needs an answer can be found without opening each one. A /manifest run
shows [!] while one of its approvals is open. At the box there is no marker. A terminal that cannot save a title is
left with an empty one rather than this session's name. An incognito session leaves the title alone,
and so does setting terminalTitle to false.
The desktop app titles its window the same way, as Bravebot · dependency audit, after the session
on screen, with ✦ in front while a turn runs and [!] while a question or an approval waits. The
title changes when you switch to another session in the sidebar. terminalTitle does not turn it
off.
Noting something on a session
/note it edited the wrong config file
/note adds a note to the session while it runs, on the turn the session is on. It is written to the
record at once, with the turn number and the fact that you typed it, in a place of its own. It is not
part of the conversation: the model is never given it, so it changes nothing about the work. Typed
while a turn runs with nothing waiting, it is carried out at once. A resume, a /branch and a
continued session keep the notes, and a record from before notes existed has none. The resume list
and bravebot sessions search find a session by the words of its notes.
/note on its own lists the notes the session holds, one line each with its turn. A session that writes
no record, as an incognito one does, says a note reached none.
A note is for whoever reviews the session later. /session-review reads the notes of the sessions it
reviews and treats each as a lead from you: it checks the note against the session's audit trail and
the code, and reports it only when the cause is in bravebot. Nothing in a note is run or followed as
an instruction, and a filed issue carries none of its words. A session with a new note is reviewed
again for that note.
Telling sessions apart
The title says which session a terminal holds. The info panel says the rest: press Ctrl-X, or type
/panel, and a column 36 wide opens on the right of the screen. Drag the border between it and the transcript to give
it more room or less; it keeps at least 24 columns and leaves the transcript at least 64. Kitty,
Ghostty and foot change the pointer to a resize arrow over the border. What a click on its rows does
is in the mouse. It holds
- the session's name, with a GitHub pull request or issue address in it shown as
brave/bravebot#1975and still a link to the address in a terminal that supports links, its directory and its branch, and below them its id over two rows, the onebravebot --resume,--forkand/resumetake, so you can resume or fork a running session from another terminal without/status; it appears once the session has been saved, - the model you chose and the effort level in force. A model your configuration names is drawn by the
name the
/modelpicker gives it, with the service after a tier's name, asSonnet (Bedrock), rather than by the inference-profile ARN a Bedrock tier is requested by;/statusdraws it the same way and keeps the request name on the line beneath, - the sandbox mode in force, as one row under a Sandbox heading:
strict,read-only,workspace-writeoroff. It follows/sandboxas soon as the mode changes, and a click on it opens the list of modes that a bare/sandboxopens, - the goal, while one stands,
- a Pull requests section and an Issues section, each left out while it has nothing to list. Each
starts with the pull request or the issue you gave with
/pror/issue, and goes on with the ones the session has met: full GitHub addresses you typed, and the ones the model's owngh,runand fetch calls name. A row isowner/repo#12as a link to the item, cut from the left where it is long so the number at the end stays in view. A link of yours that is not a GitHub address is drawn as you wrote it and is not a link. Where the screen has no room, a section ends with+3 morefor the rows it left out./prsand/issueslist the same items in the transcript, - how full the context is (read again after each round of a turn, so the first turn of a session shows
a figure before it ends), the tokens the session has spent (the figure
/costopens with, which counts what a running delegate has completed as it completes, nested delegates included), the cache hit rate, and what the turn read from the cache and wrote into it, as two figures. A figure that is zero is not drawn, so a service that reports no cache shows neither and a turn that only wrote to the cache shows the write alone. The cache figures update after each round of a turn in flight, including the first turn, and a round that reports nothing spent leaves the previous figures in place, - the language servers the session has started, by program name, and the MCP servers, by alias,
- the files the session has written, as a count with the lines added and removed, once one has been written. Clicking the heading or the count opens the files view below,
- the plan, which stays after the turn ends. A task still pending or in progress is drawn with a
filled
■while a turn is running, and dim with a hollow□while none is, as after the turn that wrote the list has ended or in a resumed session. Where it runs past the bottom it shows the task in progress and the pending tasks first, in the order of the plan, then the finished tasks nearest the first one still to do, and a row after them counts what it left out in words of their own, as+3 to do, +40 done, +2 cancelled. A kind with none left out is not named. A task list with no rows leaves the plan as the last list that had rows./clear, a rewind and a new turn clear it./todos, or Alt-A, prints the whole plan in the transcript, every task with its status and its text in full, a task still to do drawn filled or hollow as it is here. The plan ends with a row that names the key, unless the room is under three rows, the plan fills the room to its last row, or the row would take the place of a task still to do. The?list always names it.
Type /sidebar to choose which of these sections the panel draws. It opens a checklist with a row
for each, [x] while the section is drawn and [ ] while it is not. Up and Down, or j and k,
move the cursor, Space or Enter turns the row under it on or off, and a click on a row does the same.
The panel changes as you go, and Escape closes the checklist and keeps what you chose. A section
you turn off is left out with its heading, and the rows it held go to the sections that remain. If
you turn every section off, the panel is still drawn with its last row. The choice is kept in
~/.bravebot/sidebar and is the same for every session. A section that file does not name is on. The
checklist is 42 columns wide and sits in the middle of the screen, so at exactly 100 columns it
covers part of the panel while it is open. With Context off, the context reading and the cache hit
rate stay on the hint line under the box, as they do where the panel is not drawn.
Its last row names the key that hides it. While it is drawn, the context and cache figures leave the
hint line under the box, unless the terminal is too short for the panel to show them; the mode, a
running loop and the job count stay there. It needs a terminal at least 100 columns wide: a press
to open it on a narrower one leaves a note, and narrowing the terminal while the panel is open hides
it until the terminal is wide again. A press to close it works at any width. Whether it was left open is kept in
~/.bravebot/panel for the next session, and the width you dragged it to in ~/.bravebot/panel-width. The panel draws only what you typed, what the model's own commands and addresses named, the plan, the
session's own counters, the servers you approved and where the session runs, and never a reply or anything a tool returned.
The files the session wrote
Type /diff, or click the count in the Files section of the panel, and the panel lists every file the session's write calls changed, in the order each was
first written, with the lines added and removed at the right edge. Under the list are all the edits to
the highlighted file, oldest first, each under a header with its place, its turn and its counts, with
line numbers in a gutter and every change drawn, where the transcript draws the first twelve of each
write. The view is half the terminal's columns, between 60 and 100, and needs a terminal at least 100
columns wide.
| Key | Does |
|---|---|
↑ ↓, k j | highlight the previous or next file |
Home End, g G | highlight the first or last file |
PgUp PgDn | scroll the edits |
← →, h l | scroll to the previous or next edit |
q, Esc, Ctrl-C | leave the view; the panel is as it was before, and a turn running goes on |
A bar under the file's name shows which edit is at the top of the edits, as edit 2 of 3, with a
control either side that puts the header of the previous or the next edit at the top. A control with
no edit to go to is dim and does nothing. The edits say how many of their rows are above and below the
ones drawn. The last row of the panel names these keys, and the hint line under the box keeps the
context reading and the cache rate. Where the terminal is too narrow to draw the panel, the hint
line names the keys as well.
With the mouse, clicking a file in the list highlights it and shows its edits from the top, clicking
a control of the bar steps between the edits, and clicking the x at the right end of the heading row
leaves the view as q does. The wheel scrolls the pane the pointer is over: the list, without moving
the highlight, or the edits, by the number of rows tui.wheelRows names, and the transcript where the
pointer is over it. A key that moves the highlight brings it back into view. A drag, a double click or
a triple click still selects text.
Every other key does nothing there, and the line in the box comes back as you left it. Edits that
finish while the view is open are added without moving the highlight or the scroll. The view lists
what the session's own write_file and edit_file calls and manifest write steps changed. A file a
program changed, a file you edited, and a write a delegate made are not listed. The session record
keeps no write's changes, so a resumed session lists only the edits made since it was resumed, and the
heading says so. /clear removes the list, and /undo and /rewind remove the edits of the turns they
undo.
/issue https://github.com/brave/bravebot/issues/1267
/pr https://github.com/brave/bravebot/pull/1
Each takes one http or https link with a host and refuses anything else, a link with a space, a
line break, an escape or a character outside ASCII in it included. Alone, each says what is set, and /issue clear or /pr clear removes
one. Both are written to the session record at once, a resume brings them back, and /clear starts
a session with neither. --issue and --pr give a
session the same two links when it opens.
The planner can also record them with set_link, but only for an
address you typed to it in this session, so a link in a file, a web page or a command's output is
never recorded. The link is held to the same check, replaces the one of its kind, and is written to
the session record and drawn in the panel as one you gave with /issue or /pr.
Other issues and pull requests the session meets are not its link. The planner's gh pr view 12 --repo owner/repo,
an address it fetches and Closes https://github.com/owner/repo/issues/12 in a commit message it writes, and what you type, are
added to the panel's Pull requests and Issues sections and to
/prs and /issues, and set no link. What a program
printed is never read, so an issue created with gh issue create is listed once a later line or call
names its number.
A session with no link of a kind can also get one from its own commands. After the planner runs
gh pr create, gh issue create or pr-fix.py open and the command exits with status 0, the first
later call that names a pull request or an issue (the first of the kind created) becomes the session's
link of that kind. It fills an empty slot only and never replaces a link you gave with /pr or
/issue or one the planner recorded for an address you typed. It reads the commands the planner
wrote and the exit status, never what a program printed, so the item named may be another one than
the item just created. Check the link in the info panel, and set it with /pr or /issue if it is
not the one you want.
Sessions in the background
bravebot --bg "<prompt>" starts a session whose process keeps running after the terminal closes,
and /bg hands a running session to one. Only a line you typed starts
one: the planner, a delegate, a hook, a loop tick or piped input cannot. --bg asks about everything,
as a new session does. /bg keeps the permission mode the session was in. Bypass is refused, and a
rule in a settings file that allows something does not answer a question for you there. A
background session states its mode on its opening lines and again when attach joins it. The
refusal of bypass says that a session nobody watches does not run in a mode that answers every
question, and names a one-shot run (-p) as the way to ask for that. --dangerously-bypass-approvals-and-sandbox
is refused the same way. Every word after the prompt is part of the prompt, so a one-shot option given there
(--model, --effort, --advisor, --file, --session-ref, --add-dir, --trust-workspace, --trace,
--json, --json-stream, --output-schema, --mode, --max-rounds, --max-tokens or --goal) is refused
by name, the first that appears, and none of it reaches the session. A prompt whose sentence merely contains
one of those words keeps running as the prompt it is. With no model service configured, --bg is refused in the terminal you
typed it in, with the configuration status and the five routes (Bedrock, an OpenAI-compatible
gateway, a ChatGPT sign-in, an xAI sign-in, Brave's premium service), and no background process is started.
| Command | What it does |
|---|---|
bravebot sessions | one line per background session of every project: id, name, state, directory, time since it was last written and your last prompt. In a terminal it opens a list grouped by state, in the words and the order the Sessions screen uses (Ready where a line says idle), where Enter attaches |
bravebot sessions --json | the same fields as JSON |
bravebot attach <id> | draw the session as a foreground one, with a held question put to you. One terminal attaches at a time |
bravebot reply <id> "<text>" | send the text as the session's next prompt. It is refused while the session is working or waiting for an answer, and it never answers a held question |
bravebot sessions stop <id> | stop the turn and the process. The record is kept |
A session is working, needs input, idle, interrupted or stopped. A question the session would
ask is held until you attach and answer it, however long that takes. A terminal that attaches while the
question is held is shown all of it, however long it is. That includes the question about
starting an MCP server nobody has approved, which is held as
needs input (server) and drawn as a foreground session draws it. The question about sending a
message to another session is held the same way. Closing the terminal, losing the
connection or typing /detach leaves the session running, with a turn in progress and a held question
unchanged. /detach is not sent to the planner. A foreground terminal session whose terminal has
closed ends with exit status 129, the status a shell reports for a program ended by a hangup, even
where the closing terminal sent no signal.
A session with nothing running and no terminal attached for an hour is stopped, and the next attach
or reply starts it again from its record, asking. A background session's
process, whether --bg started it or reply, attach or the supervisor started it again, ends
before its first turn when this machine's managed settings refuse
the model it settled on, and the message names the file that refused it. A process that ends
between turns is started again, up to three times in an hour, idle and in the directory it worked in. It
takes the environment of the terminal that ran the first --bg, so a variable exported in a later
terminal does not reach it. One that ends during a turn is marked
interrupted, the turn is not run again, and the planner is told so on the next prompt. In a git
repository the session works in a checkout of its own, so two sessions do not edit one tree. A
session running in the background cannot be resumed from another terminal: --resume and
--continue say to attach. The Sessions screen that --resume and --from-pr open treats such a record the
same way: Enter on its row says to attach. Attaching and replying are accepted only from a program that can read the
session's state directory, because each start writes a fresh random secret there that the session's
socket requires. A confined stage cannot read that directory.
Deleting a session
bravebot sessions delete <id> removes one session of this directory, taking the id from
bravebot sessions list. bravebot sessions purge removes all of them; it asks first, naming the
directory and how many, unless you pass -y, and --dry-run prints what it would remove and
removes nothing. Each deletes the record, its trail, its search index and its lock, and nothing else: your
prompt history is one file for every project and stays, and so do the sessions of other
directories. The Sessions screen deletes the session under the cursor on Backspace
after asking, and only y answers. A session running in the background is left until you stop it with
bravebot sessions stop. A session open in another terminal is not seen, and its next save writes
its record back, so close it first. Both work under --incognito.
Nothing needs to be asked for to remove an old one: when a session starts, every record nothing has
written for retentionDays days is removed, with its
trail and its search index, and the session you are starting is left whatever its age. A record that
is gone cannot be resumed, forked or searched, so run /export first to keep the words.
In the desktop app, with chats grouped by project, the actions menu beside a project heading's +
offers Delete all chats in <project>…. It asks first, saying how many conversations go and how
many a background session keeps, then removes them; it cannot be undone. A conversation open in the
window is closed and deleted with the rest. While one of the project's chats is still answering, nothing
is closed and the delete is refused.
Importing sessions from Claude Code
bravebot sessions import claude-code # list this directory's Claude Code sessions
bravebot sessions import claude-code 3f2a9c1e # copy one, by the start of its id
bravebot sessions import claude-code --all --project ~/work/app
With nothing named it lists the sessions Claude Code kept for the directory, newest first, and
copies none. Each one named, or all of them with --all, becomes a record here called
claude-code-<its id>. A session that records no directory is skipped, as is one that belongs to
another directory.
What is copied is what you typed and what the model answered in words. Tool calls and results, the
model's reasoning, pictures and Claude Code's own notes are left behind. The words are in the record
to be read: bravebot --resume draws them, and none of them is sent to the model, so a resumed copy
does not know what the old session said. It asks the trust question as a new session does and
carries no permission from the old one. Copying the same session again changes nothing, and
Claude Code's files are not read again afterwards. Because the words are never part of a request, the
desktop app does not fork a session that holds them; /branch in the terminal still copies it.
The record comes from the files Claude Code keeps under $CLAUDE_CONFIG_DIR, or ~/.claude.
bravebot sessions import opencode is refused: opencode keeps its sessions in a database file this
build cannot read.
The desktop app does the same from the actions menu beside a project heading: Import from Claude Code… lists the project's Claude Code sessions, marks the ones copied before as Imported, and copies the ones you tick in as chats. A copy stays here if the session is later deleted in Claude Code.
Starting over
/clear
/clear begins a new session in the same directory and keeps the current one resumable. Because it
is a new session it asks the trust question again, unless a yes was
kept there, restores no standing
permissions, and closes any directory /add-dir had opened.
Starting a plan-then-execute run
/manifest starts one plan-then-execute run and hands
the session back afterwards. Plan first, then execute
has the rest.
Taking turns back
/undo puts the session back where it stood before the most recent
turn, and saying it again goes back another turn, as far as the last five.
Taking turns back covers reading a rewind before running one, putting back one hunk,
what will not go back, what gives up every point, and what a resume keeps.
Prompt history
Up walks backwards from the most recent prompt and stops at the oldest; Down walks forwards again. Leaving the newest entry puts back the half-written line you were on. Submitting leaves the mode, and a prompt arriving while you browse does not shift the view.
History persists across runs under ~/.bravebot/history and is capped. Consecutive duplicates
collapse into one, and a prompt you cancelled is removed again. Only that one line is removed from the
file, so prompts other sessions saved in the meantime stay.
Ctrl-R searches it. See Interactive mode. Each prompt is stored with when it was sent and which workspace it was sent from, both of which that search reads. A history written before either was kept still reads, as prompts with neither, and is written back out the way it came in.
Long conversations
A conversation that grows past its token budget is compacted: an older stretch of it is replaced by a summary, in the request only. The record and the transcript keep the whole thing: the replaced messages go to an archive that both still read.
/compact
asks for that work on demand, at any size, without consulting the budget. /compact keep the lexer benchmarks says what the summary must keep.
When the budget calls for a compaction, the results of tool calls older than the last two exchanges (or the last six rounds, whichever is later) are dropped from the request first, each replaced by a fixed line naming the tool and the size dropped. The line says the result is no longer in the request and that calling the tool again returns it, so the model reads a file again, for only the lines it needs, and does not repeat a call that changes something. A summary is asked for only if the conversation is still over the budget. This is done only when it frees about 4,000 tokens, and it leaves short results and the planner's latest task list alone. The record and the transcript keep the whole result.
The budget is the window the endpoint advertises for whichever model is in force, where it advertises one, so a one-shot run and a session both get the window of the model they are asking for. The built-in default only stands in, for a model resolved per request and for an entry that advertises nothing, including when you switch to such a model from one that advertised a window: the default replaces the earlier figure rather than leaving it standing. See Configuration for setting it by hand.
A session looks the window up while it draws its first screen, and takes it when the answer arrives. A
message sent before then waits for it, for up to 10 seconds. The lookup asks only the service that
answers the model in force, so a start does not wait on gateways it is not using. A request for a model
list, including the one /model makes of every service, is asked of all of them at once and gives up on
a service that does not answer within a few seconds, so the list waits for the slowest service and not
for each in turn.
A cut has to free more than it keeps, so a conversation with nothing worth giving up is left long rather than summarised once per round. That is measured twice, in exchanges and in bytes: a cut that would summarise two short prompts and keep tens of thousands of tokens of file reads is not made, and the cut by round is tried instead.
A skill the planner loaded before the cut is not left to the summary. Its text is sent again after
the summary, word for word: the newest load of each skill, the first 5,000 tokens of any one skill
(estimated at four bytes a token) and 25,000 tokens for all of them, newest first. A skill that
is cut says so and names load_skill for the rest. These count as kept when deciding whether a cut
frees enough. A skill whose result was sent as prose, which is the fallback for a round whose calls
carried no ids, is summarised like any other message.
The planner's task list is kept the same way. When a compaction takes the latest accepted
todo_write list out of the conversation, the summary ends with that list word for word, so the
steps and their order survive. A list still in the kept part is not repeated, a refused todo_write is
not the latest list, and the copy is carried through later compactions until the planner writes a
newer one.
A delegate's task is kept the same way. A delegate's conversation is its task and the rounds it has worked, so a compaction can take the task out of the request. The summary then ends with the task word for word, with nothing trimmed or cut however long it is, and the copy is carried through later compactions and is in the request once. A task still in the kept part is not repeated. Counting it as kept can make a compaction wait until more has built up. The other messages a delegate starts with, such as context files, are summarised like any other.
Compaction never touches three things: the quarantine, which holds the only copy of what a surviving reference names; the reference counter, since a slot name handed out twice would collide; and the context's integrity, since nothing here has un-read what the conversation read. The cut never lands inside a round, so a call is never separated from its results.
A session that leaves nothing behind
bravebot --incognito runs a session that leaves no prompt history, session record, title or
audit trail. Incognito sessions covers what it still reads and what it does not
cover.
When it cannot be written down
Everything here degrades to doing nothing: a missing home directory, a full disk, a corrupt record, a stored time in the future. A session that cannot be written down still runs, one that cannot be read is left out of the list, and a corrupt history reads as no history rather than as an error.
Two working directories can share a session store. The directory name is derived by mapping every
character outside a small set to -, which is lossy, so /a/b, /a-b and /a b all reduce to the
same name. A name longer than 200 bytes is cut and ends in a digest of the path, so two long
directories do not share a store. Because a resume restores standing permissions, permissions
granted in one of those
directories would be offered in another. This is
a known bug, not a design decision.