Code Mode

Get it for macOS

Run the Claude Code threads you choose in Claude Code's experimental Code Mode, one thread at a time, with no bb restart. A </> button in the New thread composer's toolbar shows whether the next thread in the selected project starts in Code Mode: it starts from the project's default, a click sets your own choice for that project, and where Code Mode can't apply it is disabled and its tooltip says why. The plugin's settings choose which projects start new Claude Code threads in Code Mode, on which machines, and what threads started by agents and plugins do; agents can start a Code Mode thread with bb code-mode spawn, and get a skill that explains it. The choice is fixed from a thread's first message, so resumes and forks keep it, and a Code Mode thread shows a Code Mode pill above its composer, a Code badge in the thread list and a line in its thread menu. Requires bb 0.50 or later on macOS or Linux and a model that supports Code Mode, such as Opus 5.5, Sonnet 5.5, Haiku 5.5 or Fable 5.2; it uses bb's experimental plugin APIs and Claude Code's experimental Code Mode, and either can change. The toolbar button, the pill and the spawn command are adapted from JonniK's Claude Code Mode plugin (MIT).


Code Mode lets you run the Claude Code threads you choose in Claude Code's experimental Code Mode, where Claude writes a short script that reads files, runs commands and calls tools in one go. It works one thread at a time, with no environment variable to set and no bb restart.

How you use it

  • The </> button in the New thread composer's toolbar is filled when the next thread you start in that project will run in Code Mode. It starts from the project's default; a click flips it for that project and remembers your choice, without changing the default. Its tooltip says where its state comes from, and where Code Mode can't run it shows off, can't be clicked, and says why.
  • Projects that start in Code Mode, on the plugin's settings page, make every new Claude Code thread in a project start that way, on the machines you turn on. Projects are listed once per name, so the same repository on two machines is one switch, and Select all and Select none set a whole list at once.
  • Threads that agents and plugins start follow the project's default, never use Code Mode, or do what the thread that started them does, as you choose. Forks keep the choice of the thread they came from. Agents can also start a Code Mode thread on purpose with bb code-mode spawn, and get a skill that explains it.
  • A Code Mode thread shows a Code Mode pill above its composer, a Code badge on its row and a Code Mode: on line in its thread menu.

What it keeps safe

  • The choice is fixed per thread. A Claude Code session started in Code Mode can only resume in Code Mode, so the plugin decides on a thread's first message and never changes it. Threads that existed before you installed the plugin are never touched.
  • Machines are opt-in. Code Mode runs only on the machines you turn on. Leave off a machine whose Claude Code account can't use Code Mode, such as one under a HIPAA plan.
  • Models are checked. Code Mode works with Opus 5.5, Sonnet 5.5, Haiku 5.5, Fable 5.2 and later models. A message that would move a Code Mode thread to another model is refused, with the reason.

How it works

Claude Code takes Code Mode for the sessions bb runs only from its settings, which bb does not expose. The plugin writes a small wrapper into its own folder on each machine you turn on and gives it to bb as the Claude Code program for Code Mode threads only. The wrapper adds Code Mode to the settings bb passes and runs the real Claude Code. It needs no Python, and it logs one line per launch without arguments or environment values.

Costs and limits

  • Code Mode is experimental in Claude Code, and the plugin uses experimental bb plugin APIs. Either can change.
  • If the plugin is turned off or fails, its Code Mode threads can't resume until it is back. Then stop the thread and send a new message.
  • macOS and Linux machines only. Needs bb 0.50 or later.
  • Don't install it beside another plugin that runs Claude Code in Code Mode: only one can hand bb its Claude Code program.

The toolbar button, the thread pill and the spawn command are adapted from Claude Code Mode by JonniK (MIT).

More from Gustavo Ambrozio

ChatGPT Realtime ConnectionRun Voice Mode's voice chats on your ChatGPT subscription instead of a separately billed OpenAI API key. It hands Voice Mode the ChatGPT sign-in that the Codex CLI already keeps on the machine running the bb server, reads it again for every chat, and never renews or rewrites it. Only the plugins you allow, Voice Mode to begin with, receive the token; the bb app, the command line and agents in threads never do. This is an undocumented use of the subscription that OpenAI could stop accepting at any time, nobody has checked whether OpenAI's terms allow it, and voice chats count against your ChatGPT plan. Requires bb 0.46 or later, Voice Mode 0.1.9 or later, and the Codex CLI signed in with Sign in with ChatGPT on a plan that includes Codex.41Diff ReviewComment on a thread's changes line by line, then send the comments to its agent, which fixes the code and answers each one. A Review tab beside the thread shows the diff of its uncommitted, staged or unstaged changes, its branch, one commit or a range, and each comment follows its code as the code moves. The same tab reviews a GitHub pull request: answer its threads, mark files viewed in step with GitHub, and submit your comments as one review, posted as the GitHub CLI's signed-in account. An AI review leaves comments of its own, @reviewer answers a question inside a comment thread, and Fix in a new thread hands the comments to another agent; these runs start as threads under the one being reviewed, in the permission mode set in the settings (bb's Approve for me by default, or Accept edits), and in full permission mode with a provider that lacks that mode, such as opencode. Follows the review loop of the open-source diffity, credited in the plugin's third-party notices. Needs bb 0.48 or later with bb's Git plugin on, and the signed-in GitHub CLI (gh) for pull request review only; it is built on experimental bb plugin APIs that may change between bb releases.NewDreamKeep every Claude Code project's memory consolidated overnight, as Claude Code's own auto-dream would if it ran in bb. Each dream is a hidden thread that can read anything but write only that project's memory files, and a project's first dream is a dry run you review as a diff, then apply or discard. The memory is backed up before every change, and the Dream page shows each project's memory, why it is or is not due, the dry runs waiting for you and the history of dreams. The schedule is off until you turn it on. Each dream is one model run on your Claude Code account; requires bb 0.49 or later, macOS or Linux, and Claude Code signed in on the machine dreams run on.NewDuo RailPut your own bb buttons in the empty strip below the camera on the iPhone Duo, on the folded cover screen and the unfolded display. Back, New thread and More are there from the start; in the plugin's settings you choose each display's buttons, their order and symbols, and what each does: open a thread, a project or a web address, run an action from bb's thread menu or a bb command, or open a menu of your own. The layout is kept on your bb server, so every device follows it, and a mirrored device puts the buttons on the left. On a desktop, an ordinary iPhone or an iPad it draws nothing. Requires bb 0.49 or later and bb's iOS app on an iPhone Duo; a button that runs a bb command needs bb's command-line tool installed.New

More in Agents & Providers 97

Add, choose, configure, route, or coordinate who runs a thread.

View all