Adding context
There are four ways to put something in front of the agent yourself: name a file, paste, drop a file on the window, or pipe it in.
Naming a file: @path
Type @ and a picker opens over the workspace. Directories come first, a prefix narrows the list, a
slash descends into a directory, and Tab completes without disturbing the rest of the sentence.
Version-control and build directories are not offered. A name that holds a tab, a zero-width
character or another character that draws as nothing or as a space is drawn in quotes with that
character written as \u{..}, so two such names cannot look like the same row. Picking one still
writes the name itself.
A fragment of a name finds it in any directory below, so @mainrs offers crates/cli/src/main.rs
without a walk through crates and cli. The letters have to appear in the name in that order and
case does not matter. Names that match come before paths that match, and the closer match comes
first. What the directory you are typing in offers stays at the top of the list, followed by at most
ten names found this way. The search covers the workspace only, skips the directories above, does
not follow links, and reads at most 10,000 names, starting from the root.
> why does @crates/cli/src/main.rs read stdin before checking the prompt?
A named file's contents enter the turn as trusted input, and the rule recorded is for that file alone. So:
@vendor/lib.jsis trusted even inside avendordirectory you marked untrusted, and the rest of that directory stays exactly as it was;- the rule outlives the read, so the file can be edited afterwards;
- naming a file works even in a directory you declined at startup.
.. and absolute paths are refused rather than resolved, so a named file is always inside the
working directory or a directory opened with /add-dir.
A directory cannot be named. Only files can. Neither can prose: an address inside a sentence is not a
reference, and a bare @ names nothing.
Sending a prompt that ends in a half-typed reference completes it rather than sending the fragment.
A name containing whitespace is written with a backslash before each whitespace character, as in
@My\ Documents/notes.md, and a backslash in a name is written as two. Completing it from the picker
writes that form for you. The picker leaves out a file or folder whose name holds a line break, and a file whose
name ends in whitespace, because the line is trimmed when it is sent. Name such a file with --file.
Addressing a definition from the @ list
Typing @ also lists the delegate definitions this session resolved, the ones
/agent accepts, each with its description, above the files. Picking one writes a [@Name] marker
into the box and addresses that message to the definition, as /agent <name> <task> does, with the
marker taken out of the task. A message addresses at most one definition: picking a second replaces
the first, and deleting the marker takes the pick off. Shift-Enter starts a new line and keeps the
pick. While a turn runs, the message waits as the /agent line it becomes. The marker is not a file
name, so a line holding it names no file. The desktop app lists its bots in the same place.
Naming an earlier session: @session:<id>
After the files, the @ picker lists earlier sessions of this directory by title and age. Typing a
word narrows them by title, and @session: narrows them by id. Choosing one writes
@session:<id>, and sending the line adds the newest part of that session to your message: your
prompts and the replies it gave, newest turn first, cut at 8,000 characters. The transcript says how
many characters were added, and the audit trail records the id and the count without the words.
carry on from @session:3f2a9c1e-7b44-4d0e-9a51-0c6d2b8e4f10, but use the new parser
What a session read with its tools is not in its record, so the excerpt says its tool results and
file contents are not included. A manifest run, an imported session, and a session whose planner had
been shown private content are not quoted, and the transcript says which. On the command line,
--session-ref <id> does the same and is repeatable; an id that cannot be quoted stops the run
before anything is sent. The desktop app does not offer sessions in its message box.
The desktop app's message box works the same way: @ opens the list over the project, Tab and the
arrows choose, and Enter completes a half-typed name or sends a finished one.
In both, a name you type that is not a text file inside the project stops the send and says which
name it was, so nothing goes that you did not mean to send. The line stays in the box, a paste
included, and removing the @ sends the word as text. In the terminal, the words behind a folded
paste marker are sent as text and name no file, so a handle in pasted text, such as cc @alice, does
not stop the send. This holds for a line sent, a line queued behind a turn, and the argument of
/plan, /agent, /help, /review, /loop and /after.
Content you have not read is content you are vouching for. Be as careful naming a file as answering yes to a directory: the planner will act on what it says.
--file on the command line
bravebot "explain this" --file notes.md --file src/main.rs
--file does exactly what @path does, is repeatable, and is trusted for the same reason: you
named it.
Pasting
Ctrl-V pastes. More than a couple of lines folds to a marker:
[Pasted text #2 +40 lines]
The words around it are left alone, and the words themselves are put back where the line leaves the
box, so the request, the transcript and your prompt history all hold the paste rather than the
marker. Deleting the marker drops the words. A short paste lands whole, a paste into a command line
is never folded, and a paste ending in a newline does not send. An @name or @session:<id> inside
a folded paste is sent as text, whichever command the line starts and on every run of a loop: it
names no file, adds no session and vouches for nothing, and only a name you typed in the line does.
The marker goes no further than the box. It is a handle on text that only the session holding it can put back. A prompt that comes back for editing after a stop does come back behind its marker, since that is where a stack trace is worth folding away.
Characters nothing draws are removed. Text copied from a page can carry an instruction written in characters a terminal shows as nothing, and a paste goes into your message as your own words. So Brave Bot takes those out of a paste, including one into a command line, and says how many:
removed 6 invisible characters from that paste
Compare the count with what you copied. Letters, emoji and the spellings that need a zero-width
joiner, such as Persian and Hindi, are left as they were, and a paste that held none of them says
nothing. Only a paste is cleaned: text you type, a path in a dropped file's name and a prompt given
with -p are not. A drop onto a line armed with ! where a name holds such a character writes nothing.
Reading a folded paste
To read a folded paste whole before you send it, click its marker, or put the caret on it and press
Alt-V (the peek action, which a keybindings entry can
move). The info panel opens on the pasted text under a heading such as Pasted text #2 with its line
count. Long lines wrap, and a control character is drawn as a visible one, so the text cannot move the
cursor. Up, Down, PageUp, PageDown, g, G and the wheel over the panel scroll it. q, Escape, Ctrl-C
and the x at the top right close it and put the panel back as it was.
The line, the caret and the paste are not changed, and nothing is sent to a model or written to the session record. It works while a turn runs. A terminal too narrow for the info panel says so and opens nothing. Alt-V with the caret on no marker does nothing.
Pictures
Ctrl-V also pastes a picture: a screenshot, or an image copied from a browser. Command-V does not:
the byte stream over a pty has no encoding for that modifier, so the terminal writes the clipboard's
text into the pty instead and the picture silently arrives as nothing. Ctrl-V comes through as a
byte, so Brave Bot goes around the terminal and reads the clipboard itself. On macOS that goes
through osascript; on Linux it needs wl-paste or xclip.
- A picture wins over text when the clipboard holds both, since copying an image in a browser leaves the page's URL behind as text, and text has another key.
- A picture is read as a PNG first, then as a JPEG, and on macOS last as a TIFF, which is how a GIF or a HEIC copied from an app arrives. A PNG and a JPEG are sent as they are, and a TIFF is sent as a PNG. A TIFF that declares a canvas of more than 134 million pixels is not read.
- A file copied in Finder, Explorer or a Linux file manager is treated as a drop. Ctrl-V reads
the files the clipboard names and handles them as if you had dragged them onto the window (see
Dropping a file): an image or a PDF is carried as bytes, a text file becomes
context, and any other type has its path written into the line. The files win over a picture or
text beside them on the clipboard. A file whose name is not text or holds a line break refuses the
whole copy, and none of the files are pasted. On Linux the file manager has to leave a
text/uri-listor, as GNOME's do, anx-special/gnome-copied-files, whichwl-pasteorxclipreads. - The picture is inlined into the request, never linked, so no other machine fetches it.
- The marker is written where the caret is, and the picture goes wherever that text goes. Deleting the marker unsends it.
- A prompt recalled from your history carries no picture and names none. No durable text stands for a screenshot. What this turn sends is untouched: the picture still travels with the prompt that named it, and the transcript still shows the line as it was on your screen.
- A thumbnail of the picture is drawn under the box where the terminal draws pictures (Kitty, iTerm2 or Sixel), so you can see it is the screenshot you meant. It follows the marker: rubbing the marker out, sending the line or clearing it removes the thumbnail, and a line that comes back into the box after a stopped turn or an unqueue gets its thumbnails drawn again. What is sent is the picture itself, whether or not a thumbnail could be drawn. A picture that will not decode, or a terminal that draws none, leaves the box as it was.
- A picture is refused in shell mode rather than written into the command.
- Anything over 10 MB is scaled down to at most 2048 pixels on its longest side and sent as a PNG. It is refused, and says so with its size, only when it will not decode or is still over 10 MB once scaled. It is refused rather than quietly swapped for the text sitting beside it in the clipboard.
- Ctrl-V reads the clipboard while a turn is running too, so a picture can be staged into the next prompt without waiting for the turn to finish.
- An empty clipboard reads as nothing rather than as empty text, and a missing
wl-pasteorxclipreads the same way rather than as a successful copy of nothing. - A pasted picture is kept with the session record and comes back on resume, because it is part of your own message.
Dropping a file
Drag a file onto the terminal window and it attaches, with its own marker: [Image #1], numbered so
a second drop is distinguishable from the first.
A drop grants two things, for that one file:
- trust: its contents can be read and it can be edited for the rest of the session, even inside a directory marked untrusted;
- reach: a dropped file, and only a dropped file, may name a path outside the working directory. Nothing else in the directory it came from becomes trusted or reachable.
What happens depends on the type:
| Dropped | Result |
|---|---|
| an image or a PDF | carried as bytes, so the model looks at it, with a line before them naming the file as Dropped file: <path>. A PNG or JPEG over 8 MiB, or with a side over 2048 pixels, is scaled down to at most 2048 pixels and carried as a PNG, and the audit trail records the file and both sizes. One that will not decode, or is still over 8 MiB once scaled, is refused, and so is a PNG or JPEG over 64 MiB. A GIF, WebP or PDF over 8 MiB is refused |
| a text file | its contents enter the turn as trusted input |
| anything else | its path is written into the line, as dropping a file always did |
Extensions are recognised whatever their case. Dropping a directory attaches nothing. A dropped PNG or JPEG also gets a thumbnail under the box, as a pasted picture does. A file copied in a file manager and pasted with Ctrl-V is handled the same way.
The path line goes ahead of the bytes in a turn's prompt, in a question beside the work, and in a plan's
task. A file that cannot be shown to the model is replaced by the sentence <path> could not be shown to you. A pasted picture carries no path, so on a line that pastes and drops, the numbers in the markers
can differ from the order the pictures are sent in.
Onto a line armed with !, a drop writes each file's path and attaches nothing, as dropping a
file into a shell does. The shell is handed the line as it stands, so there is no marker and no
trust or reach is granted. A path made only of ASCII letters, digits and _@+:,./- is written as it
is. Any other path is written in single quotes, with each ' and \ written outside the quotes as
\' and \\, so the name reaches the command as one word. This is the quoting sh, bash, zsh
and fish read. Nushell and PowerShell quote differently, csh and tcsh still expand !, and
the quotes are written for the place a word starts: drop the file there, not inside a quote you
opened. When a dropped file's name holds a control character or a character the terminal draws as
nothing, no path from that drop is written, and a note says so.
A prompt recalled from your history names the file rather than the marker. Nothing staged beside a line outlives the session that staged it. The name is enough: the planner reads it and goes to the file through the same gate it reads any other file through.
Terminals deliver a drop as text, so it has to be told from typing: a line is a drop only when every
word of it is a path that exists. A plain, quoted, backslash-escaped or file:// path counts,
several at once count, and a percent sign in a name survives. One word of prose, a path naming
nothing, an unterminated quote or more than one line makes it a paste instead.
A screenshot somebody sent you is content you have not read and are vouching for. It goes into the turn as trusted input on the strength of the gesture alone.
Dropping a file on the desktop app
Drag files onto a conversation in the desktop app and they attach the same way, with the same types, markers and grants. Each file gets a marker in the message box where the cursor is and a chip above it, with a thumbnail for a picture. Delete the marker, or remove the chip, to take the file off. A file whose type nothing takes has its path written into the box. A folder is left out, and the app says so. Plan is off while a file is attached.
A message you send while a turn is running waits in the queue and keeps its files: it goes as its own turn when the running one ends, and carries them then.
Pasting a picture into the desktop app
Paste a picture into the message box of the desktop app, with Command-V on macOS or Ctrl-V elsewhere, and it attaches
the way a paste does in the terminal. It gets an [Image #2] marker where the cursor is, numbered
with any files dropped into the same message, and a chip above the box with a thumbnail. Delete the
marker, or remove the chip, to take it off. A picture wins over the text copied beside it, and a
paste of text alone lands as text. A picture over 10 MB is refused, and the app says how large it
was. A dropped PNG or JPEG is scaled down instead, as in Dropping a file.
Plan is off while a picture is attached, and a message you send while a turn is
running keeps its pictures, as it keeps dropped files.
Pasting long text into the desktop app
A text paste of more than a couple of lines folds in the desktop app as it does in the terminal: the
box gets a marker such as [Pasted text #3 +40 lines] where the cursor is, numbered with the
pictures and files in the same message, and a Pasted text #3 chip above the box that shows the line count. A shorter paste
lands as text. Delete the marker, or remove the chip, to take the paste off.
The words go in place of the marker wherever the message leaves the box: when you send it, queue it
behind a running turn, send it into the running turn, or use it in /btw or /schedule. The model
and the transcript get the words, never the marker. A draft you leave and come back to keeps its
folded pastes, so the marker still stands for the words after the app restarts. Handing a draft
off to a new chat does not unfold it yet, and a draft holding a folded paste cannot be enhanced.
To read a folded paste whole, click its chip, or put the cursor on the marker and press Alt-V
(Option-V on macOS). A window titled Pasted text #3 shows every line with its line count, and
Wrap wraps long lines. Done, Escape or the close button closes it. Opening it changes nothing in
the box and sends nothing, and it works while a turn is running. With the cursor anywhere else,
Alt-V is left to type what it always types, so Option-V still types √ on macOS.
Pictures and files on a slash command
A slash command that sends words to a model takes a pasted picture or a
dropped image or PDF along with them: /btw and
/manifest send the file with the question or the task.
A text file dropped onto either becomes its name in the words, because those requests have no room
for its contents. /loop sends the picture or file
on its first run, and every later run sends the marker as the file's name. A command that the
interface carries out itself sends nothing to a model, so a marker on its line becomes the file's
name, or words saying a picture was pasted and cannot be shown, and you are told it did not go.
The same holds for a command typed while a turn runs, whether it waits or is carried out as typed. Running a slash command counts as sending the line: what it named comes off the box with it, so nothing stays attached to a line that is no longer there.
Piping
gh pr diff | bravebot -p "which of these changes needs a test?"
Piped input is untrusted and private, always. It is quarantined and the planner is given a
reference, never the bytes. A pipe has no path, so there is nothing for the trust map to have an
opinion about, and gh pr diff and cat build-error.txt arrive by exactly the same route.
Input over 10 MiB is refused rather than truncated, and says to write it to a file and name that instead. See Non-interactive use.
What each route is worth
| Route | Label | Reach |
|---|---|---|
@path, --file | trusted | inside the workspace |
| a dropped file | trusted | anywhere on disk, for that file |
| a pasted picture or text | trusted, as your own message, after invisible characters are removed from the text | none |
! shell mode output | trusted, private | your shell's own access |
a pipe into -p | untrusted, private | none |
| a file read in a trusted directory | trusted | the workspace |
| a file read anywhere else | untrusted, private | quarantined |