lua build-session opens a live build session from your terminal: Claude works on your agent in the cloud while you chat with it. These are the same sessions the Lua desktop app opens, so you can start a session in one and carry on in the other. You can chat, send files, try the session’s version of the agent, release it, and answer whatever the session asks of you, such as an approval or a secret.
Build sessions must be on for your organization. They are on for every organization from 25 October 2026. An organization that turns off its
buildSessions.enabled feature has opted out; there, every command fails with build_sessions_disabled and does nothing else.lua --help does not list build-session unless LUA_BUILD_SESSIONS_ENABLED=true is set in your own environment. The value must be exactly true. The commands work either way, and lua build-session --help always prints their help.Synopsis
--json, and every command that works on one session takes --session <sessionId>.
Description
A build session belongs to one agent and to the person who started it. One agent has at most one open session at a time. A session id looks likebs_<uuid>.
The current session
Afterstart, attach, chat, use or resume, the CLI remembers the session as the current one, so the other commands need no id. It keeps it in ~/.lua-cli/build-sessions.json, which every terminal of your user account on this computer shares. A command picks its session in this order:
- the id given as an argument or with
--session <sessionId>; LUA_BUILD_SESSION_IDin the environment;- the current session the CLI remembers.
LUA_BUILD_SESSION_ID in each terminal.
end and kill without an id let you pick one of your open sessions when you run them in a terminal, with the current one listed first.
Sessions and their states
An ended, failed or killed session can’t be resumed; start a new one. Work you did not save stays in the session’s checkpoints for 7 days. There is no delete: ended sessions are removed automatically after the retention period.
Chat
In a terminal,lua build-session with no command, lua build-session start, chat and resume open a chat once the session is ready. Type a message and press Enter. Replies stream in as they are written and render as Markdown. A message you type while a turn runs is queued, and the chat shows its place, for example queued #1.
When the chat opens on a session that already has history, it does not replay it. It prints a short summary of where you left off instead, then only what happens next.
Re-enter the chat later with
lua build-session chat.
Slash commands
/switch and /new need a terminal; elsewhere, use resume and start.
Approvals in the chat
When the session asks you for something, the chat offers to answer it there:- An action, such as a command that changes the agent:
Approve … now? [y/N]. It runs with your rights./deny <id>declines it. - A release card:
Approve release brc_… now? [y/N]. The card is in the Lua desktop app too. See who can approve a release. - A secret: you type the value with the input hidden. It goes to the agent’s environment variables, never to the session; the session only learns that it is set.
- Adding an agent to a fleet session: confirm or decline it in the Lua desktop app.
n, or anything that is not y, to leave it for later; a line that is not y or n is sent as a message. Whatever you don’t answer stays in lua build-session approvals and in the Lua desktop app.
Drop files on the terminal
Drag a file onto the terminal, or paste its path, and it goes with the message on the same line. A file dropped on its own waits for your next message. A path counts when it is absolute, starts with~/ or is a file:// URL, and the file exists; a word like notes.txt stays part of the message, and so does anything inside backticks. The chat asks before it attaches a file over 5 MB or outside your home folder.
Files Claude shares show up in the chat with their number, for example /save 2 to download. chat --auto-save <dir> saves each one as it arrives instead.
File limits
The CLI checks the type and size before uploading. The platform checks the contents too and refuses a file whose contents do not match its type (
attachment_rejected).
Pick an organization and agent
start, chat and bare lua build-session without --agent, in a terminal, ask which agent to build:
- The organization. This step is skipped when you belong to only one.
- The agent. The agent in this project’s
lua.skill.yamlcomes first, marked[this project]. Each agent shows your open or parked session, if it has one.- Picking an agent with your session offers to resume it or to start a session on another agent.
- An agent another person is building is refused, because an agent has one session at a time. Pick another agent.
- The last entry, Fleet session: pick a supervisor…, starts a fleet session on the supervisor agent you pick next, with its fleet members loaded too.
lua build-session with an open current session first asks whether to continue it, pick another of your sessions, or start a new one.
Outside a terminal, with --json, with --no-chat or --no-wait, or under --ci or with CI set to 1 or true, nothing is asked. start then uses --agent or the agent in lua.skill.yaml, and bare lua build-session prints its help.
Commands
start
Opens a build session on the agent and waits until it is ready, then opens the chat in a terminal. Without--agent, a terminal gets the picker; elsewhere the agent comes from lua.skill.yaml.
chat
Opens the chat on the current session, on--session, or on the agent’s open or parked session. A parked session is resumed first. When the agent has no session, a terminal starts one. Without any of these, a terminal gets the picker.
chat is interactive and refuses --json; use send and attach --json in scripts.
attach
Prints the session’s activity as it happens: Claude’s text, a line per tool step, file change, command, checkpoint, test and approval, and the credits spent.Ctrl-C stops following; the session keeps running.
send
Sends a message and prints its turn until the session is idle again.Ctrl-C stops following and exits 130; the turn keeps running. Stop it with lua build-session stop.
stop
Stops the running turn now. A queued message, if there is one, runs next.try
Sends a message to the session’s version of the agent, the way an end user would, and prints the reply. Writes go to separate test data, and outbound calls are recorded instead of made.release
Builds the release candidate: what the session changes, its tests and its risk. The approval card opens in the Lua desktop app, and the command prints the candidate’s state as it changes.
With
--wait, the command prints each agent’s version change once the release is live, and exits 1 when the candidate is denied, fails, is rolled back or is superseded.
Who can approve a release
Approving a release from the CLI, withrelease --approve, approve brc_… or y in the chat, needs a person signed in with lua auth. An API key can approve only when the organization has turned on its buildSessions.cliReleaseApprove setting. Otherwise approve the card in the Lua desktop app.
end, remove
Ends the session. Without an id, a terminal lets you pick one of your open sessions.remove (alias rm) does the same and says that ended sessions are removed automatically; there is no delete.
kill
Stops a session hard, without saving. Without an id, a terminal lets you pick one of your open sessions.list
Your build sessions across every organization and agent you can see, newest activity first. Each line shows the session id, its state, the organization and agent,[fleet] for a fleet session, when it was last active and the credits it spent today. * marks the current session.
use
Makes the session the current one. Nothing changes on the server.resume
Resumes a parked session, or re-attaches to an open one, and opens the chat. Without an id, a terminal lets you pick one of your sessions; elsewhere the command exits2 and lists the sessions you can resume.
approvals
Lists everything waiting on you across your open sessions: action requests (bsa_…), secret requests (bss_…) and release cards (brc_…). Each line shows the kind, the id, the session and agent, what it is, its risk, and how long ago it was asked.
Release cards are listed once the CLI on this computer has seen them, in
chat, attach, send or release.
approve, deny
approve <id> approves an action request (bsa_…), which then runs with your rights, or a release card (brc_…). deny <id> declines an action request or denies a release card; a denied release changes nothing, and the session keeps its work. The platform decides who may approve. deny takes --reason <text>, kept with a release decision.
Denying a release card needs a card the CLI on this computer has seen; otherwise deny it in the Lua desktop app, or open the chat on the session first.
secret
Answers a secret request (bss_…). In a terminal you type the value with the input hidden; it is never a command-line argument. The value goes to the agent’s environment variables, never to the session, and it is never printed.
Outside a terminal,
secret needs --from-stdin or --decline.
files, download
files lists the session’s files: the ones you sent and the ones Claude shared. download saves one by its id, or all of them with --all, into ./build-session-files/<sessionId>/.
status
Shows the session: its state, the agent version and source it started from, the credits spent today and in total, the latest checkpoint and what is staged for testing. With--agent <agentId> and no session, it lists that agent’s sessions instead.
Output
--json prints one JSON object per line, each with a kind. The stream of a session arrives as {"kind":"event", …}, {"kind":"state", …}, {"kind":"ack", …} and {"kind":"error", …} lines; a command that follows the stream ends with a {"kind":"result", "verb", "outcome", …} line. One-shot commands print a single line of their own kind, such as session, started, session-list, approvals, files, downloaded, release, try, ended or killed.
Out of credits
When your organization runs out of credits, the session stops withcredits_exhausted, the message Your organization is out of credits. Top up to keep building. and a link to top up your balance. The command exits 13. A daily credit cap on the session is a different refusal, budget_exhausted; it resets at midnight UTC.
Examples
Chat with the current session, or pick an agent:Common refusals
Exit codes
The full table is in Errors and exit codes.
Environment variables
See also
lua chat— talk to the agent in sandbox or productionlua auth— sign in, which a release approval from the CLI needslua version— the agent versions a release promotes- Errors and exit codes — every exit code, including
13

