Brick (Regolo) CLI

The brick CLI runs a local model router in front of Claude Code or Codex and sends each request to a fitting model.

  • 130 ★ on the repository
  • Last commit
CLI

Broad access

Why this level

  • Every prompt and piece of code in the session passes through the router, and provider keys sit in the profile `.env`.
  • The `brick start` command changes the Claude Code or Codex launch settings, and `brick stop` reverts them.
  • A cheap model on a hard turn can give a worse result than one picked by hand.
All reasons and checks

regolo-ai/brick-sr1

Install

Manual install

git clone https://github.com/regolo-ai/brick-SR1.git && cd brick-SR1/apps/cli && npm install && npm run build && npm link

The first Quickstart commands from the README build the CLI from source. They are followed by `brick profile edit claude` and `brick start claude`.

Access and checks

How we review

Broad accessThe tool can change data, run commands or handle secrets.

  • Every prompt and piece of code in the session passes through the router, and provider keys sit in the profile `.env`.
  • The `brick start` command changes the Claude Code or Codex launch settings, and `brick stop` reverts them.
  • A cheap model on a hard turn can give a worse result than one picked by hand.

This is third-party code. Review the repository files before installing.

What it does

Brick assesses the complexity and type of every request and picks a model from a configured pool. For Claude Code that means haiku, sonnet or opus: easy turns go to a cheap model, hard ones climb higher. Providers and their keys are set in the profile. The `brick start claude` command brings up the router in Docker and wires it into Claude Code. The `/model` picker gains a brick-claude entry, while the built-in opus, sonnet and haiku stay and bypass the router. The effort slider switches the economy mode, from `eco`, always haiku, to `max`, always opus. Codex has the same profile, marked as beta. Separately, the router runs as an OpenAI-compatible gateway: requests set `model: "brick"`, and the `x-selected-model` response header shows the chosen model.

Who it is for. People who pay for Claude Code or Codex by the meter and want to cut the cost of easy requests.

Good fit when

  • The bill for a coding agent grows because of small tasks that haiku would handle.
  • Several models need to sit behind one OpenAI-compatible address.
  • Claude Code should raise the model on hard turns and save on easy ones by itself.
  • The model pool is chosen in advance and kept in a profile so a team works the same way.

Not a fit when

  • Every request must go to one fixed model with no substitution.
  • Code and prompts cannot pass through an extra intermediary on your machine.
  • Docker is missing: the router runs in a container.

Example request

Start the router for Claude Code and show which models it chose during the session.

Limitations

Node 20 or 22 and newer and Docker are required. The Codex profile is still beta. One profile runs at a time: stop or clear the active one before starting another. Switching models in mid-conversation invalidates the prompt cache, and the profile editor has `sticky` and `smartsqueeze` modes for that. Provider keys live in the profile `.env` under `~/.brick/profiles`. Installation per the README is a build from a cloned repository, and `brick update` handles updates.

How to disable. Run `brick stop claude` to restore the normal Claude Code launch and `brick clear claude` to remove the container and runtime state. The profile and keys stay in place.

FAQ

How do I enable Brick in Claude Code?

Run `brick profile edit claude`, then `brick start claude` and open a new Claude Code session. The `/model` picker will show a brick-claude entry.

What happens if I pick opus or sonnet directly?

The request goes to the chosen model as is, bypassing the router. Only the brick-claude entry routes.

How do I restore the previous Claude Code launch?

Run `brick stop claude`. The command stops the router and restores normal settings for future launches.

How do I see where a request went?

Open `brick status claude`: the live dashboard shows routing by model. On the OpenAI-compatible gateway the `x-selected-model` header names the model.

Which economy modes exist?

Five: `eco`, `lite`, `mid`, `pro` and `max`. `mid` is the default, `eco` always picks haiku and `max` always opus. The mode is changed with the effort slider in `/model`.

Discussion

No questions or reviews yet.

CLI tools
Editors’ pick

A local gateway for Claude Code, Codex, OpenCode and other agents: pick model providers, route requests, set fallbacks and read logs

CLIBroad access38KRepository stars

Local CLI proxy for Claude Code that translates provider API formats and selects models using configurable routing rules

CLIExtended access979Repository stars

Hooks read each prompt before the model and ask a free or local model for a draft first, saving Claude subscription quota.

PluginBroad access122Repository stars

CCS

CCS - Claude Codex Switch

A CLI that switches Claude Code between accounts, providers and local models without editing configs

CLIBroad access2.9KRepository stars

A Go CLI that switches Claude Code profiles with one command, swapping settings, CLAUDE.md and MCP servers together with a backup.

CLIExtended access144Repository stars

llmman runs Claude Code, Codex and OpenCode on a local or hosted model with one command and stores models as OCI images

CLIExtended access582Repository stars

README in short

Brick is written in Go and Rust with a Python part, under the Apache 2.0 licence. The authors publish datasets, Hugging Face models and a paper on routing by capability and complexity, and the gateway image is available on Docker Hub.

README badge

Report a problem

Foxx AIBrick (Regolo)
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.