tollbar
GitHub

tollbar guideguía de tollbar

tollbar: the full guidetollbar: la guía completa

Every command and option, with real output from real runs. For the short version, read the README.Cada comando y cada opción, con salidas reales de corridas reales. La versión corta está en el README.

ContentsContenido

What tollbar isQué es tollbar#

tollbar reviews code before it ships, especially code an AI agent wrote.tollbar revisa el código antes de que salga a producción, sobre todo el código que escribió un agente de IA.

  • It runs on your machine, or in GitHub Actions. No account, no server, MIT license.Corre en tu máquina, o en GitHub Actions. Sin cuenta, sin servidor, con licencia MIT.
  • Fixed rules run first: instant, free, no AI needed.Primero corren reglas fijas: instantáneas, gratis, sin IA.
  • Then your own AI (Claude Code, an API key, or a local model) reviews the logic, and a second, skeptical pass tries to knock down each AI finding.Después tu propia IA (Claude Code, una API key o un modelo local) revisa la lógica, y una segunda pasada, escéptica, intenta tirar abajo cada hallazgo de la IA.
  • Every problem comes in plain words, plus a prompt you can paste into your coding agent.Cada problema viene explicado en palabras simples, con un prompt para pegarle a tu agente.
  • It can stop a push, a deploy, or Claude Code saying "done" when something serious shows up.Puede frenar un push, un deploy, o que Claude Code diga "listo" cuando aparece algo grave.

How a review worksCómo funciona una revisión#

  1. It picks the changes. By default, what you haven't committed yet. If everything is committed, the last commit. You can also review everything since the last deploy, a branch against main, one commit, or the whole project.Elige los cambios. Por defecto, lo que todavía no commiteaste. Si está todo commiteado, el último commit. También podés revisar todo lo que cambió desde el último deploy, una rama contra main, un commit puntual o el proyecto entero.
  2. Rules. About 40 fixed checks look at the lines that were added or changed: leaked keys, .env files, SQL injection and XSS in PHP and WordPress, npm packages that don't exist, code the AI cut short, tests that check nothing, and more (see the rule catalog). This takes under a second.Reglas. Unos 40 chequeos fijos miran las líneas agregadas o cambiadas: claves filtradas, archivos .env, inyección SQL y XSS en PHP y WordPress, paquetes de npm que no existen, código que la IA dejó cortado, tests que no comprueban nada, y más (mirá el catálogo de reglas). Tarda menos de un segundo.
  3. Your AI (optional). It gets the diff, the changed files, the places where changed functions are used, your project rules and your past false alarms. It looks for real problems: security, bugs, data loss, broken deploys. Anything that looks like a secret is masked before it's sent.Tu IA (opcional). Recibe el diff, los archivos que cambiaron, los lugares donde se usan las funciones tocadas, las reglas de tu proyecto y tus falsas alarmas anteriores. Busca problemas reales: seguridad, bugs, pérdida de datos, deploys rotos. Todo lo que parezca un secreto se tapa antes de mandarlo.
  4. The skeptic pass. A second AI call tries to refute each AI finding against the real code. Findings that don't survive are dropped. (ai.verify: false turns this off.)La pasada escéptica. Una segunda llamada a la IA intenta refutar cada hallazgo contra el código real. Lo que no sobrevive se descarta. (ai.verify: false la apaga.)
  5. Sanity checks. An AI finding that points at a line the change doesn't touch, or quotes code that isn't there, is dropped too. If a rule already reports the same spot, the AI's copy goes.Controles. Un hallazgo de la IA que apunta a una línea que el cambio no toca, o que cita código que no está, también se descarta. Si una regla ya marca el mismo lugar, se queda la de la regla.
  6. Your learnings. Anything you marked as a false alarm is hidden.Tus aprendizajes. Lo que marcaste como falsa alarma no se muestra.
  7. The report. Serious problems first, a verdict, a prompt for your agent, and an exit code.El reporte. Lo grave primero, un veredicto, un prompt para tu agente y un código de salida.

SeveritiesSeveridades#

LevelNivelShown asSe ve comoWhat it meansQué significa
criticalCRITICALAn exploitable security hole, data loss, or the site going down.Un agujero de seguridad explotable, pérdida de datos, o el sitio caído.
majorMAJORA likely bug that affects users, or something that breaks the deploy.Un bug probable que afecta a los usuarios, o algo que rompe el deploy.
minorMINORA real problem with low impact.Un problema real pero de poco impacto.
infoINFOThe lowest level. Hidden by default (min_severity: minor); the current rules and AI prompt don't produce it.El nivel más bajo. Oculto por defecto (min_severity: minor); hoy ni las reglas ni el prompt de la IA lo usan.

In this guide, "serious" means major or critical.En esta guía, "grave" quiere decir major o critical.

The verdict (the "light")El veredicto (la "luz")#

The line right under the header is the verdict:La línea que está justo abajo del encabezado es el veredicto:

LightLuzLabelEtiquetaWhenCuándo
greenverdeOKNo findings.No hay hallazgos.
yellowamarillaREVIEWOnly minor issues.Solo detalles menores.
redrojaREVIEWAt least one serious problem.Al menos un problema grave.
redrojaBLOCKEDAt least one serious problem, and you asked to block on it with --gate (exit code 2).Al menos un problema grave, y pediste frenar con --gate (código de salida 2).
yellowamarillaNO AINo findings, but the AI that should have reviewed didn't: it failed, or the monthly cap was reached. Only the rules ran.No hay hallazgos, pero la IA que tenía que revisar no lo hizo: falló, o se llegó al tope mensual. Solo corrieron las reglas.

In a terminal the label is a colored badge. When the output goes to a file or a pipe, or NO_COLOR is set, it reads [OK], [REVIEW] or [BLOCKED]. The markdown format uses 🟢 🟡 🔴. (With --gate minor, a review with only minor issues also exits 2, but its label stays REVIEW.)En una terminal la etiqueta es un recuadro de color. Cuando la salida va a un archivo o a un pipe, o está definida NO_COLOR, se lee [OK], [REVIEW] o [BLOCKED]. El formato markdown usa 🟢 🟡 🔴. (Con --gate minor, una revisión con solo detalles menores también sale con 2, pero la etiqueta sigue diciendo REVIEW.)

An OK always says what was reviewed. With rules only (no AI set up, or --no-ai) it reads No problems found. Rules only: the logic wasn't reviewed. If part of a large change got no AI review, it says Part of the change wasn't reviewed by the AI (see below). and the notes list the files.Un OK siempre dice qué se revisó. Solo con reglas (sin IA configurada, o con --no-ai) se lee No problems found. Rules only: the logic wasn't reviewed. Si una parte de un cambio grande quedó sin revisión de IA, dice Part of the change wasn't reviewed by the AI (see below). y las notas listan los archivos.

Exit codesCódigos de salida#

CodeCódigoMeaningQué significa
0Done. Nothing at or above your gate, or no gate set.Terminó. No hay nada a la altura de tu gate, o no pusiste gate.
1Something went wrong: not a git repo, a bad option, git failed. For tollbar status: something in the setup is broken. The pre-push hook also returns 1 when it stops a push, because git only cares about zero or not zero.Algo falló: no es un repo git, una opción mal escrita, git dio error. En tollbar status: algo de la instalación no anda. El hook pre-push también devuelve 1 cuando frena un push, porque a git solo le importa si es cero o no.
2review and github: blocked by the gate. setup: there was no terminal to ask questions and no --yes, so it did nothing.review y github: frenado por el gate. setup: no había terminal para preguntar y faltaba --yes, así que no hizo nada.
3drift --strict: files on the server were edited by hand.drift --strict: hay archivos editados a mano en el servidor.
4review --require-ai (or require_ai: true): the AI was supposed to review and didn't review everything (it failed, the monthly cap was reached, or part of the change was too large). Choosing --no-ai never causes it.review --require-ai (o require_ai: true): la IA tenía que revisar y no revisó todo (falló, se llegó al tope mensual o una parte del cambio era demasiado grande). Elegir --no-ai nunca lo provoca.
130setup was cancelled; nothing changed.Se canceló setup; no cambió nada.

Without a gate, tollbar review exits 0 even when it finds something critical. That's on purpose: it only blocks when you ask, with --gate or gate: in a settings file.Sin gate, tollbar review sale con 0 aunque encuentre algo crítico. Es a propósito: solo frena cuando se lo pedís, con --gate o con gate: en un archivo de configuración.

Install and first runInstalar y primer uso#

What you needQué necesitás#

  • Node.js 20 or newer, and git.Node.js 20 o más nuevo, y git.
  • For the AI part, one of these (optional):Para la parte de IA, alguna de estas (opcional):

    • Claude Code installed and logged in (the claude command). tollbar picks it up with no configuration.Claude Code instalado y logueado (el comando claude). tollbar lo detecta sin configurar nada.
    • An API key for Anthropic, OpenAI, OpenRouter, Gemini, or any OpenAI-compatible service.Una API key de Anthropic, OpenAI, OpenRouter, Gemini o cualquier servicio compatible con OpenAI.
    • Ollama running on your machine.Ollama corriendo en tu máquina.
    • Any AI command-line tool that reads a prompt on stdin (codex exec, gemini -p...).Cualquier programa de IA por línea de comandos que lea el prompt por stdin (codex exec, gemini -p...).

Without any of them, tollbar runs rules only.Sin ninguna, tollbar revisa solo con reglas.

InstallInstalar#

npm install -g @ernestojost/tollbar
tollbar --version

The npm package is @ernestojost/tollbar. The command is tollbar.El paquete de npm es @ernestojost/tollbar. El comando es tollbar.

To try it once without installing:Para probarlo una vez sin instalar:

npx @ernestojost/tollbar review

The hooks need the global install, because they call tollbar from your PATH.Los hooks necesitan la instalación global, porque llaman a tollbar desde el PATH.

tollbar setup: three questionstollbar setup: tres preguntas#

Run it inside a repo. It asks at most three questions, shows what it will do, and waits for your OK before changing anything. Press Enter to accept what's in [brackets].Corrélo adentro de un repo. Hace como mucho tres preguntas, te muestra lo que va a hacer y espera tu OK antes de tocar nada. Enter acepta lo que está entre [corchetes].

This is a real run. What the person typed comes after each >; an empty answer means Enter.Esta es una corrida real. Lo que escribió la persona va después de cada >; si no hay nada, fue Enter.

$ tollbar setup
tollbar: 3 questions at most and it is ready. Enter accepts what is in [brackets].
Run this again any time to change something.

1) Where will you use tollbar?
   1. On my machine, with my own projects
   2. On my work machine (nothing is added to the repo; code only goes to the company's AI)
   3. Only on GitHub (Actions)
   [1] > 1

2) Which AI?
   Found: Claude Code 2.1.292 · no API key set · Ollama off
   1. Claude Code, with whatever account you are logged into   (recommended)
   2. An API key (Anthropic, OpenAI, OpenRouter, Gemini, other)
   3. A local model (Ollama)
   4. No AI: rules only
   5. Another AI program, as a command (codex exec, gemini -p...)
   [1] >
   Test it now? One short call that spends a few tokens from your account. [y/N] > n

3) When should it review? (several, separated by commas)
   1. Before every git push from this repo         [with AI]
   2. When Claude Code finishes a task             [rules only]
   3. Before deploying (I give you the line for your script)
   4. Only when I ask
   To change how one reviews: 1:rules or 2:ai
   [1,2] >

Here's what I'll do:
  write    ~/.tollbar/config.yml  (profile: personal)
           AI: claude-cli (sonnet) · checks npm for invented packages · false alarms in .tollbar/learnings.md
  install  .git\hooks\pre-push    (this clone, never committed) · with AI
  install  .claude\settings.json  (goes with the repo if you commit it; --local keeps it out of git) · Claude Code, rules only

Go ahead? [Y/n] > y

Wrote ~/.tollbar/config.yml
Installed .git\hooks\pre-push
Installed .claude\settings.json

Done. Try it: tollbar review   ·   See the setup: tollbar status   ·   Change it: tollbar setup

What each question decides:Qué decide cada pregunta:

  1. Where. personal for your own machine. work keeps everything out of the repo and never looks up package names on the public npm registry (see At work). GitHub only adds the GitHub Actions workflow instead of local hooks. The profiles table has the details.Dónde. personal para tu máquina. work (trabajo) deja todo fuera del repo y nunca consulta nombres de paquetes en el registro público de npm (mirá En el trabajo). Only on GitHub agrega el workflow de GitHub Actions en lugar de hooks locales. La tabla de perfiles tiene el detalle.
  2. Which AI. It shows what it found on the machine and suggests the best option. "Test it now?" makes one short real call.Con qué IA. Te muestra lo que encontró en la máquina y te sugiere la mejor opción. "Test it now?" hace una llamada real y corta.
  3. When. Any combination, separated by commas:Cuándo. Cualquier combinación, separada por comas:

    • 1 before every git push from this repo (pre-push hook);1 antes de cada git push de este repo (hook pre-push);
    • 2 when Claude Code finishes a task (Stop hook);2 cuando Claude Code termina una tarea (hook Stop);
    • 3 prints the lines for your deploy script (installs nothing);3 te imprime las líneas para tu script de deploy (no instala nada);
    • 4 only when you run tollbar review.4 solo cuando corrés tollbar review.

    Add :rules or :ai to change how one of them reviews, e.g. 1:rules,2. With AI, a push takes 15 to 40 seconds longer; rules only takes about a second.Agregale :rules o :ai para cambiar cómo revisa uno, por ejemplo 1:rules,2. Con IA, cada push tarda entre 15 y 40 segundos más; solo con reglas, alrededor de un segundo.

Run tollbar setup again whenever you want to change something: your current answers become the defaults. If nothing would change, it says so and touches nothing. Outside a git repo it only writes your personal settings; the hooks are saved as a preference, and you install them by running tollbar setup inside each repo.Volvé a correr tollbar setup cada vez que quieras cambiar algo: tus respuestas actuales pasan a ser las de por defecto. Si no hay nada que cambiar, te lo dice y no toca nada. Fuera de un repo git solo escribe tu configuración personal; los hooks quedan guardados como preferencia, y los instalás corriendo tollbar setup adentro de cada repo.

This is the personal settings file it wrote. You can edit it by hand:Este es el archivo de configuración personal que escribió. Lo podés editar a mano:

# tollbar: your personal settings, for every repo on this machine.
# Written by "tollbar setup" (run it again to change something); you can also edit it by hand.

profile: personal # personal | work | ci (chosen with tollbar setup)
ai:
  provider: claude-cli # your Claude Code, with whatever account it is logged into
  model: sonnet
check_registry: true # look up imported packages on npm to catch invented names
learnings: repo # false alarms are recorded in the repo's .tollbar/learnings.md
# What tollbar setup suggests in each repo: ai | rules | off (hooks are installed repo by repo)
hooks:
  pre_push: ai
  claude_stop: rules

# More options:
# gate: major            # tollbar review exits 2 if something major or worse shows up
# budget_usd_month: 5    # monthly cap in US$; once reached, reviews run with rules only

Without questions (scripts and coding agents)Sin preguntas (scripts y agentes)#

Pass the answers as options and add --yes. Use --print first to see the plan without writing anything.Pasale las respuestas como opciones y agregá --yes. Antes, usá --print para ver el plan sin escribir nada.

tollbar setup --print --profile work --hooks pre-push:ai,claude-stop:rules
tollbar setup --yes   --profile work --hooks pre-push:ai,claude-stop:rules

Every option, from tollbar setup --help:Todas las opciones, según tollbar setup --help:

tollbar setup: gets tollbar working on this machine and in this repo. With no options it asks; with --yes it asks nothing.

  1) Where            --profile personal | work | ci
                       work: nothing is added to the repo and npm is not queried
  2) Which AI         --ai claude-cli | anthropic | openai | openrouter | gemini | ollama | openai-compatible | cli | none
                       [--model <model>] [--api-key-env <VARIABLE_NAME>] [--base-url <url>] [--command "<command>"]
  3) When             --hooks pre-push:ai,claude-stop:rules   (also: deploy, workflow, none)
                       --local: the Claude Code hook in .claude/settings.local.json (always with work)

  --yes, -y            asks nothing: what you don't pass stays as it is now, or as the profile suggests
  --print              shows what it would do, without writing anything
  --check              tests the AI with one short call (spends a few tokens)
  --allow-hooks-path   installs the pre-push hook even if the repo uses core.hooksPath
  --ask                asks even if the input doesn't look like a terminal (Git Bash with mintty)

Example:
  tollbar setup --yes --profile work --ai claude-cli --hooks pre-push:ai,claude-stop:rules

API keys never go in the settings file: they stay in environment variables.

With no terminal and no --yes or --print (for example, when an agent runs it), setup prints that same help and exits with code 2 without changing anything.Sin terminal y sin --yes ni --print (por ejemplo, cuando lo corre un agente), setup imprime esa misma ayuda y sale con código 2 sin cambiar nada.

tollbar status: what applies heretollbar status: qué vale acá#

tollbar status shows, in plain words, which settings, AI and hooks apply in the repo you're in. It never calls the AI unless you add --check.tollbar status te muestra, en palabras simples, qué configuración, qué IA y qué hooks valen en el repo donde estás. Nunca llama a la IA, salvo que agregues --check.

$ tollbar status
tollbar 0.3.2 · profile: personal
Config      ~/.tollbar/config.yml
            repo's .tollbar.yml: none
AI          claude-cli (sonnet) · Claude Code 2.1.292 found   [--check to test it]
Privacy     code only goes to: Claude Code, with whatever account it's logged into (or your company's gateway)
            public npm: imported package names are looked up · false alarms: .tollbar/learnings.md (in the repo)
Gate        none: tollbar review never fails by itself (use --gate) · hooks stop major or worse
This repo   ~\projects\shop
            pre-push          on, with AI      (.git\hooks\pre-push, never committed)
            Claude Code Stop  on, rules only   (.claude\settings.json, goes with the repo if you commit it)
            deploy marked     d11a7c9 (1 commits since)
Spend       US$0.00 this month on this machine · no cap
Last run    today 14:23 · REVIEW · 0 s · by hand · no AI
To change something: tollbar setup
  • Config: your personal file, and whether the repo has its own .tollbar.yml (and whether it's trusted).Config: tu archivo personal, y si el repo tiene su propio .tollbar.yml (y si es de confianza).
  • AI: which one, and whether it was found. Nothing is called.AI: cuál, y si la encontró. No llama a nada.
  • Privacy: where your code goes, whether package names are looked up on npm, and where false alarms are recorded.Privacy: adónde va tu código, si se consultan nombres de paquetes en npm, y dónde se anotan las falsas alarmas.
  • Gate: whether a plain tollbar review can fail on its own. Hooks always stop at major or worse.Gate: si un tollbar review pelado puede fallar solo. Los hooks siempre frenan en major o peor.
  • This repo: the hooks and where each one lives, and the deploy mark.This repo: los hooks y dónde vive cada uno, y la marca de deploy.
  • Spend and Last run: this month's AI spend on this machine, and the last review in this clone.Spend y Last run: lo gastado en IA este mes en esta máquina, y la última revisión en este clon.

Options:Opciones:

  • tollbar status --check tests the AI with one short call (a few tokens).tollbar status --check prueba la IA con una llamada corta (unos pocos tokens).
  • tollbar status --json prints the same information as JSON.tollbar status --json imprime lo mismo en JSON.

The exit code is 1 when something is broken (for example, the configured AI can't be found, or hooks are installed but tollbar isn't on the PATH), and the output says what.El código de salida es 1 cuando algo no anda (por ejemplo, la IA configurada no aparece, o hay hooks instalados pero tollbar no está en el PATH), y la salida te dice qué.

Your first reviewTu primera revisión#

tollbar review

That's it. It reviews what you haven't committed yet, or the last commit. If you have no settings at all yet, the last line in a terminal suggests tollbar setup.Eso es todo. Revisa lo que todavía no commiteaste, o el último commit. Si todavía no tenés ninguna configuración, en una terminal la última línea te sugiere tollbar setup.

Everyday useEl día a día#

Reading a reportCómo leer un reporte#

Here an AI agent changed five files in a small shop project. This is the rules-only review (--no-ai), so it took under a second:Acá un agente de IA cambió cinco archivos de un proyecto chico de una tienda. Es la revisión solo con reglas (--no-ai), así que tardó menos de un segundo:

$ tollbar review --no-ai
Reviewing 5 files (uncommitted changes)…
tollbar · uncommitted changes · 5 files, +30 −12

[REVIEW] 7 serious problems.

1. [CRITICAL] SQL query with user input (SQL injection)
   Security · api/orders.php:4 · rule php-sql-injection
   > $result = mysqli_query($conn, "SELECT * FROM orders WHERE id = " . $_GET['id']);
   What the visitor sends goes straight to the database. With that they can read, change or delete everything.
   Fix: Use prepared statements (prepare + bind) and never put $_GET/$_POST into SQL.

2. [CRITICAL] User input is printed on the page without escaping (XSS)
   Security · api/orders.php:7 · rule php-xss
   > echo "<h1>Orders for " . $_GET['name'] . "</h1>";
   Someone can craft a link that runs code in another visitor's browser and steal their session.
   Fix: Escape it before printing: esc_html() / esc_attr() in WordPress, htmlspecialchars() in plain PHP.

3. [CRITICAL] Secret in the code (Stripe secret key)
   Security · src/payments.js:3 · rule secret
   > const STRIPE_SECRET = "[REDACTED]";
   Anyone who sees the repository (or a copy, or the git history) can use it. Even if you delete it later, it stays in the history.
   Fix: Take it out of the code, read it from an environment variable or a .env file that isn't committed, and generate a new key because this one is already exposed.

4. [CRITICAL] The package "currency-format-utils-pro" doesn't exist on npm
   Typical AI mistake · src/payments.js:1 · rule phantom-import
   > import { formatPrice } from 'currency-format-utils-pro';
   The code imports a package that doesn't exist. It usually happens when the AI invents a name. It's dangerous: someone can publish a package with that name and ship malicious code (it's called slopsquatting).
   Fix: Find the right package (or, if it's your own file, use a relative path like "./currency-format-utils-pro"). Don't install "currency-format-utils-pro" without checking what it is.

5. [MAJOR] HTML is built with variables (possible XSS)
   Security · public/search.js:9 · rule js-inner-html
   > results.innerHTML = '<p>Results for ' + query + ': ' + items.length + '</p>';
   If any of those variables carries text from a user or an API, it can run code in your visitors' browsers.
   Fix: Use textContent for text, or create elements with document.createElement; if you need HTML, sanitize it (DOMPurify).

6. [MAJOR] Looks like code the AI cut short
   Typical AI mistake · src/cart.js:13 · rule ai-truncated
   > // ... rest of the code stays the same
   This comment ("... rest of the code") is typical of an AI summarizing instead of writing the whole file. Whatever was there was probably deleted.
   Fix: Compare with the previous version of the file and restore what's missing, or ask the agent to write the complete file.

7. [MAJOR] Tests that check nothing
   Typical AI mistake · tests/payments.test.js:5 · rule test-no-assert
   > it('charges the card', async () => {
   The tests in this file have no checks at all (expect / assert). They always pass, even when the code is broken: a false sense of safety.
   Fix: Add real checks of the result, or ask the agent to redo them so they test the behavior.

Prompt for your agent (copy and paste):
────────────────────────────────────────
Review and fix these problems found by an automated review. Check each one before changing anything; if one isn't real, explain why and leave it alone:
1. api/orders.php:4 — SQL query with user input (SQL injection). Use prepared statements (prepare + bind) and never put $_GET/$_POST into SQL.
2. api/orders.php:7 — User input is printed on the page without escaping (XSS). Escape it before printing: esc_html() / esc_attr() in WordPress, htmlspecialchars() in plain PHP.
...
7. tests/payments.test.js:5 — Tests that check nothing. Add real checks of the result, or ask the agent to redo them so they test the behavior.
────────────────────────────────────────
A false alarm? tollbar ignore <number> --reason "why"  (it won't be flagged again)

no AI (rules only) · 0.4 s

Top to bottom:De arriba hacia abajo:

  • Header: what was reviewed, how many files, lines added (+) and removed (−).Encabezado: qué se revisó, cuántos archivos, líneas agregadas (+) y sacadas (−).
  • Verdict: the light and a one-line summary.Veredicto: la luz y un resumen de una línea.
  • Each finding: number, severity, title. Then the category, file:line, and who found it (rule <id> or AI). The > line quotes the code (secrets show as [REDACTED]). Then what happens and why it matters, and the fix.Cada hallazgo: número, severidad y título. Después la categoría, archivo:línea y quién lo encontró (rule <id> o AI). La línea con > cita el código (los secretos se ven como [REDACTED]). Después qué pasa y por qué importa, y el arreglo.
  • Prompt for your agent: one block to paste into Claude Code, Cursor or Codex. It asks the agent to check each problem before changing anything, and to explain instead of "fixing" a false alarm.Prompt para tu agente: un bloque para pegar en Claude Code, Cursor o Codex. Le pide al agente que verifique cada problema antes de tocar nada, y que explique en lugar de "arreglar" una falsa alarma.
  • Footer: which AI ran (or "no AI"), how many calls, tokens, cost, this month's spend, and time. Warnings and notes go below it.Pie: qué IA corrió (o "no AI"), cuántas llamadas, tokens, costo, lo gastado en el mes y el tiempo. Abajo van los avisos y las notas.

The finding numbers are what tollbar ignore <number> refers to.Los números de los hallazgos son los que usa tollbar ignore <número>.

A review with AIUna revisión con IA#

The rules can't understand logic. Here a different change adds a report page and a discount function. Rules alone flag only a leftover var_dump. With the AI (Claude Code, model sonnet):Las reglas no entienden lógica. Acá otro cambio agrega una página de reporte y una función de descuento. Solo con reglas, aparece únicamente un var_dump olvidado. Con la IA (Claude Code, modelo sonnet):

$ tollbar review
Reviewing 2 files (uncommitted changes)…
AI reviewing with claude-cli (sonnet)…
Verifying 3 AI findings…
tollbar · uncommitted changes · 2 files, +16 −0

[REVIEW] 3 serious problems.

1. [CRITICAL] SQL injection via customer parameter
   Security · report.php:6 · AI
   > $sql = "SELECT * FROM invoices WHERE customer = '$customer' ORDER BY created_at DESC";
   The GET parameter is put directly into the SQL query. Anyone can alter the query and read or modify the whole database.
   Fix: Use a prepared statement with a bound parameter.
   Suggested code:
   + $stmt = db()->prepare('SELECT * FROM invoices WHERE customer = ? ORDER BY created_at DESC'); $stmt->bind_param('s', $customer); $stmt->execute();

2. [CRITICAL] Discount calculation treats percent as a fraction
   Bug · lib/totals.php:11 · AI
   > return (int) round($total_cents - $total_cents * $percent);
   The comment says 15 means 15%, but the code multiplies total by 15 and subtracts it. The result is hugely negative (total - total*15) instead of 85% of the total.
   Fix: Divide the percent by 100.
   Suggested code:
   +     return (int) round($total_cents - $total_cents * $percent / 100);

3. [MAJOR] var_dump output corrupts the JSON response
   Bug · report.php:8 · AI
   > var_dump($rows);
   var_dump prints before the JSON header and body, so the response is not valid JSON and leaks raw invoice data. The header() call may also fail because output already started.
   Fix: Remove the var_dump line.

4. [MINOR] A test var_dump / print_r was left
   Deploy · report.php:8 · rule debug-print
   > var_dump($rows);
   It prints internal data on the page, in front of visitors.
   Fix: Delete it, or use error_log() if you need to record it.

Prompt for your agent (copy and paste):
...

AI: claude-cli (sonnet) · 2 calls · 6k input tokens · cost ~US$0.031 · this month US$0.03 of 5 · 9.9 s

What to notice:Fijate en esto:

  • The SQL injection: the user input goes into a variable first and then into the query, so the php-sql-injection rule (which looks for $_GET inside the query call) doesn't see it. The AI does.La inyección SQL: el dato del usuario pasa primero por una variable y después va a la consulta, así que la regla php-sql-injection (que busca $_GET adentro de la llamada) no la ve. La IA sí.
  • The discount bug: the code contradicts its own comment. No pattern can catch that.El bug del descuento: el código contradice su propio comentario. Eso no lo agarra ningún patrón.
  • Suggested code: when the AI is sure of the exact replacement line, it shows it. On GitHub this becomes a one-click suggestion.Código sugerido: cuando la IA está segura de la línea exacta que va, la muestra. En GitHub se convierte en una sugerencia de un clic.
  • Rule and AI on the same line (3 and 4) are both kept because they describe different problems.Regla e IA en la misma línea (3 y 4) se muestran las dos, porque describen problemas distintos.
  • The footer: 2 calls is the review plus the skeptic pass. The cost and the monthly total are explained in What it costs.El pie: 2 calls son la revisión más la pasada escéptica. El costo y el total del mes se explican en Cuánto cuesta.

What the skeptic pass saidQué dijo la pasada escéptica#

To see the prompts and answers, run with TOLLBAR_DEBUG=debug.txt. This is the second call's answer in that run; it kept all three:Para ver los prompts y las respuestas, corré con TOLLBAR_DEBUG=debug.txt. Esta es la respuesta de la segunda llamada en esa corrida; se quedó con los tres hallazgos:

{
  "verdicts": [
    {
      "id": "h0",
      "keep": true,
      "reason": "The GET parameter $customer is interpolated directly into the SQL string on line 6, which is a real exploitable SQL injection."
    },
    {
      "id": "h1",
      "keep": true,
      "reason": "var_dump($rows) runs before the JSON header and echo, so it corrupts the JSON output, leaks data, and can break header() if output has started."
    },
    {
      "id": "h2",
      "keep": true,
      "reason": "With a whole-number percent like 15, total - total*15 gives a large negative value, which contradicts the comment that says 15 means 15% off."
    }
  ]
}

When the skeptic rejects a finding, it isn't shown, and the footer counts it as N dropped. --format json lists each dropped finding with the reason.Cuando la pasada escéptica descarta un hallazgo, no se muestra, y el pie lo cuenta como N dropped. --format json lista cada descartado con el motivo.

What to reviewQué revisar#

CommandComandoReviewsRevisaHeader labelEtiqueta en el encabezado
tollbar reviewUncommitted changes (including new files); if there are none, the last commitLos cambios sin commitear (archivos nuevos incluidos); si no hay, el último commituncommitted changes / last commit (sha)
tollbar review --uncommittedOnly uncommitted changesSolo lo que no commiteasteuncommitted changes
tollbar review --commit <sha>One commitUn commit puntualcommit <sha>
tollbar review --base mainWhat this branch adds compared to main (from where it branched off)Lo que agrega esta rama comparada con main (desde donde se separó)changes against main
tollbar review --since-deployEverything since the last tollbar mark-deploy, plus uncommitted work if anyTodo desde el último tollbar mark-deploy, más lo que no commiteaste, si haychanges since the last deploy (sha)
tollbar review --allEvery tracked file, as if the whole project were newTodos los archivos del repo, como si el proyecto fuera nuevowhole project (sha)

The same project, reviewed in different ways:El mismo proyecto, revisado de distintas formas:

$ tollbar mark-deploy
Deploy marked at d11a7c9. Next time: tollbar review --since-deploy
...
$ tollbar review --no-ai
tollbar · last commit (255290e) · 1 files, +1 −1

[OK] No problems found. Rules only: the logic wasn't reviewed.
$ tollbar review --commit b2c14e3 --no-ai
tollbar · commit b2c14e3 · 5 files, +30 −12

[REVIEW] 7 serious problems.
$ tollbar review --since-deploy --no-ai
tollbar · changes since the last deploy (d11a7c9) · 5 files, +30 −12

[REVIEW] 6 serious problems.
$ tollbar review --since-deploy --no-ai   (with uncommitted work)
tollbar · changes since the last deploy (d11a7c9) + uncommitted · 5 files, +31 −12

[REVIEW] 6 serious problems.
$ tollbar review --base main --no-ai
tollbar · changes against main · 1 files, +4 −0

[OK] No problems found. Rules only: the logic wasn't reviewed.
$ tollbar review --all --no-ai
tollbar · whole project (acd5433) · 9 files, +81 −0

[REVIEW] 6 serious problems.

Good to know:Bueno saber:

  • New files count. Uncommitted reviews include files git doesn't track yet (text files up to 512 KB).Los archivos nuevos cuentan. Las revisiones de lo no commiteado incluyen archivos que git todavía no sigue (de texto, hasta 512 KB).
  • --since-deploy without a mark reviews the latest change and tells you to run tollbar mark-deploy after deploying.--since-deploy sin marca revisa el último cambio y te recuerda correr tollbar mark-deploy después de deployar.
  • --all is for the first day with an inherited project. Rules that only make sense for a change (like "wp-config.php changed") are skipped.--all es para el primer día con un proyecto heredado. Las reglas que solo tienen sentido en un cambio (como "cambió wp-config.php") no corren.
  • Skipped files: lockfiles, minified files, source maps, snapshots, node_modules, vendor, dist, build, .next, .astro, coverage, binary and deleted files. Add your own with ignore:.Archivos que se saltean: lockfiles, minificados, source maps, snapshots, node_modules, vendor, dist, build, .next, .astro, coverage, binarios y borrados. Sumá los tuyos con ignore:.

Blocking: --gateFrenar: --gate#

--gate <level> makes tollbar exit with code 2 when something of that level or worse shows up. That's what scripts use to stop.--gate <nivel> hace que tollbar salga con código 2 cuando aparece algo de ese nivel o peor. Es lo que usan los scripts para frenar.

$ tollbar review --no-ai --gate major
tollbar · uncommitted changes · 5 files, +30 −12

[BLOCKED] 7 serious problems: don't ship this.
...
$ echo $?
2

Levels: critical, major, minor, info, or none. You can also set gate: in a settings file. Careful: the .tollbar.yml that tollbar init writes has gate: major, so in that repo a plain tollbar review exits 2 when something serious shows up. The hooks always block at major or worse, whatever gate: says.Niveles: critical, major, minor, info, o none. También podés poner gate: en un archivo de configuración. Ojo: el .tollbar.yml que crea tollbar init trae gate: major, así que en ese repo un tollbar review pelado sale con 2 cuando hay algo grave. Los hooks siempre frenan en major o peor, diga lo que diga gate:.

Fewer or more findingsMenos o más hallazgos#

  • --min-severity <level> hides anything below that level (default minor).--min-severity <nivel> oculta lo que esté debajo de ese nivel (por defecto minor).
  • --max-findings <n> caps how many are shown (default 7). Serious findings are always shown, so the cap only trims minor ones. Hidden ones are counted: (+3 minor issues not shown; use --max-findings to see them).--max-findings <n> pone un tope a lo que se muestra (por defecto 7). Lo grave se muestra siempre, así que el tope solo recorta detalles menores. Lo oculto se cuenta: (+3 minor issues not shown; use --max-findings to see them).
$ tollbar review --no-ai --min-severity critical --max-findings 2
tollbar · uncommitted changes · 5 files, +30 −12

[REVIEW] 4 serious problems.
...

Other optionsOtras opciones#

OptionOpciónWhat it doesQué hace
--no-aiRules only. Instant and free.Solo reglas. Instantáneo y gratis.
--offlineDon't look up package names on npm. Imports missing from package.json are still flagged, as undeclared-import instead of phantom-import (see below).No consulta nombres de paquetes en npm. Los imports que faltan en package.json se siguen marcando, como undeclared-import en lugar de phantom-import (mirá abajo).
--require-aiExit with code 4 if the AI didn't review the whole change (it failed, hit the monthly cap, or the change was too large). For gates that must never pass on rules alone.Sale con código 4 si la IA no revisó todo el cambio (falló, llegó al tope mensual o el cambio era demasiado grande). Para gates que nunca tienen que pasar solo con reglas.
--model <model>--model <modelo>Use another model just this time, e.g. --model haiku or --model opus with Claude Code.Usa otro modelo solo esta vez, por ejemplo --model haiku o --model opus con Claude Code.
--format text|markdown|jsonOutput format. Markdown is the same thing GitHub shows; JSON is for scripts.Formato de salida. Markdown es lo mismo que muestra GitHub; JSON es para scripts.
--quietNo progress lines (Reviewing 5 files…).Sin líneas de progreso (Reviewing 5 files…).
--notifySend the result to Telegram (see below).Manda el resultado por Telegram (más abajo).

With --offline the invented package from the example above looks like this:Con --offline, el paquete inventado del ejemplo de arriba se ve así:

6. [MAJOR] "currency-format-utils-pro" is used but isn't in package.json
   Bug · src/payments.js:1 · rule undeclared-import
   > import { formatPrice } from 'currency-format-utils-pro';
   The package isn't in the dependencies. It may work on your machine because it's installed indirectly, but on the server or another machine the build breaks.
   Fix: Add it with npm install currency-format-utils-pro (or check whether the name is misspelled).

--format markdown (trimmed):--format markdown (recortado):

### 🔴 REVIEW: 7 serious problems.
<sub>uncommitted changes · 5 files, +30 −12</sub>

**1. [CRITICAL] SQL query with user input (SQL injection)**  
`api/orders.php:4` · Security · rule `php-sql-injection`

```
$result = mysqli_query($conn, "SELECT * FROM orders WHERE id = " . $_GET['id']);
```

What the visitor sends goes straight to the database. With that they can read, change or delete everything.

**Fix:** Use prepared statements (prepare + bind) and never put $_GET/$_POST into SQL.
...
<details><summary>Prompt for your agent</summary>
...

--format json (trimmed) has the verdict, every finding, the hidden and dropped ones, AI errors, notes, cost and the agent prompt:--format json (recortado) trae el veredicto, cada hallazgo, los ocultos y los descartados, los errores de la IA, las notas, el costo y el prompt para el agente:

{
  "range": {
    "base": "d11a7c905f7981d48d485df58930a53c8532e185",
    "head": "WORKTREE",
    "label": "uncommitted changes",
    "includeUntracked": true
  },
  "light": "red",
  "blocked": false,
  "gate": "none",
  "files": 5,
  "added": 30,
  "removed": 12,
  "findings": [
    {
      "id": "c46c6e4b210c",
      "source": "rule",
      "confidence": 1,
      "rule": "php-sql-injection",
      "file": "api/orders.php",
      "line": 4,
      "severity": "critical",
      "category": "security",
      "title": "SQL query with user input (SQL injection)",
      ...

The prompt for your agentEl prompt para tu agente#

Each review ends with a prompt you can paste as is into Claude Code, Cursor or Codex. It lists every finding with its file, line and fix, and asks the agent to check each one first and to explain, instead of changing code, when one isn't real. The same prompt is in the markdown output (in a <details> block), in JSON (agentPrompt), and it's what the Claude Code hook hands back to the agent.Cada revisión termina con un prompt que podés pegar tal cual en Claude Code, Cursor o Codex. Lista cada hallazgo con su archivo, línea y arreglo, y le pide al agente que verifique cada uno antes, y que explique en lugar de cambiar código cuando alguno no es real. El mismo prompt está en la salida markdown (en un bloque <details>), en JSON (agentPrompt), y es lo que el hook de Claude Code le devuelve al agente.

Choosing your AIElegir tu IA#

If you don't chooseSi no elegís#

With no ai.provider in any settings file, tollbar picks one on its own, in this order:Si no hay ai.provider en ningún archivo de configuración, tollbar elige solo, en este orden:

  1. Claude Code, if the claude command runs (claude-cli).Claude Code, si el comando claude funciona (claude-cli).
  2. The Anthropic API, if ANTHROPIC_API_KEY is set (anthropic).La API de Anthropic, si está definida ANTHROPIC_API_KEY (anthropic).
  3. None: rules only.Ninguna: solo reglas.

tollbar status says when the AI was "picked by itself".tollbar status te avisa cuando la IA fue elegida sola ("picked by itself").

ProvidersProveedores#

providerUsesUsaYou setVos ponés
claude-cliYour Claude Code, with your subscription or API keyTu Claude Code, con tu suscripción o tu API keymodel (default sonnet; also haiku, opus)model (por defecto sonnet; también haiku, opus)
cliAny command that reads the prompt on stdinCualquier comando que lea el prompt por stdincommand
anthropicAnthropic API, through the official SDKLa API de Anthropic, con el SDK oficialThe key in ANTHROPIC_API_KEY; model (default claude-opus-5-5)La clave en ANTHROPIC_API_KEY; model (por defecto claude-opus-5-5)
openaiOpenAI APILa API de OpenAIOPENAI_API_KEY and modelOPENAI_API_KEY y model
openrouterOpenRouter (hundreds of models)OpenRouter (cientos de modelos)OPENROUTER_API_KEY and modelOPENROUTER_API_KEY y model
geminiGoogle's API (OpenAI-compatible endpoint)La API de Google (su endpoint compatible con OpenAI)GEMINI_API_KEY and modelGEMINI_API_KEY y model
ollamaA local model, freeUn modelo local, gratismodel, with ollama serve runningmodel, con ollama serve corriendo
openai-compatibleDeepSeek, Groq, any OpenAI-compatible APIDeepSeek, Groq, cualquier API compatible con OpenAIbase_url, api_key_env and modelbase_url, api_key_env y model
noneRules onlySolo reglas

Put the choice in your personal settings (~/.tollbar/config.yml, which tollbar setup writes) so it applies to every repo. A repo's .tollbar.yml can also choose, with some limits. Keys never go in a file: tollbar reads them from environment variables, and the settings only hold the variable's name.Poné la elección en tu configuración personal (~/.tollbar/config.yml, la que escribe tollbar setup) para que valga en todos los repos. El .tollbar.yml de un repo también puede elegir, con algunos límites. Las claves nunca van en un archivo: tollbar las lee de variables de entorno, y la configuración solo guarda el nombre de la variable.

Claude Code (claude-cli)#

ai:
  provider: claude-cli
  model: sonnet        # or haiku (cheaper, faster) or opus (reviews best)

tollbar runs claude -p with whatever account Claude Code is logged into: Pro, Max, Team, Enterprise, or an API key. The call is locked down: no tools, none of your hooks, plugins or MCP servers, no saved session. The AI only sees what tollbar sends. See Company setups for Bedrock, Vertex and gateways.tollbar corre claude -p con la cuenta en la que esté logueado Claude Code: Pro, Max, Team, Enterprise, o una API key. La llamada va encerrada: sin herramientas, sin tus hooks, plugins ni servidores MCP, sin guardar la sesión. La IA solo ve lo que le manda tollbar. Para Bedrock, Vertex y gateways, mirá En empresas.

Any command (cli)Cualquier comando (cli)#

ai:
  provider: cli
  command: "codex exec"        # or "gemini -p", "ollama run qwen2.5-coder"

tollbar sends the prompt on stdin and reads the answer from stdout. It asks for JSON, pulls the first JSON object out of the answer, and retries once if it can't. The command runs through your shell. There's no cost tracking for this provider. A repo's own .tollbar.yml can't set this unless you trust it.tollbar le manda el prompt por stdin y lee la respuesta de stdout. Le pide JSON, saca el primer objeto JSON de la respuesta, y si no puede reintenta una vez. El comando corre a través de tu shell. Con este proveedor no hay registro de costos. El .tollbar.yml de un repo no puede elegir esto salvo que confíes en él.

Anthropic API (anthropic)API de Anthropic (anthropic)#

ai:
  provider: anthropic
  model: claude-sonnet-5-5     # claude-opus-5-5 (default) reviews best; claude-haiku-5-5 is the cheapest
  # api_key_env: MY_ANTHROPIC_KEY   # if the key is in a variable with another name
  # effort: high                    # low | medium | high | xhigh | max (default high)

Without api_key_env, the SDK finds the key on its own: ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, or an ant auth login profile. The shared part of the prompt (your project rules and learnings) is marked for caching. If the model declines to review security code, tollbar lets the server retry on another model (ai.fallbacks: true, on by default, for the models that support it).Sin api_key_env, el SDK encuentra la clave solo: ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, o un perfil de ant auth login. La parte que se repite del prompt (las reglas de tu proyecto y tus aprendizajes) va marcada para caché. Si el modelo se niega a revisar código de seguridad, tollbar deja que el servidor reintente con otro modelo (ai.fallbacks: true, prendido por defecto, en los modelos que lo soportan).

OpenAI, OpenRouter, Gemini#

ai:
  provider: openrouter         # or openai, or gemini
  model: your-model-id         # required: the model id exactly as the provider names it

The keys come from OPENAI_API_KEY, OPENROUTER_API_KEY or GEMINI_API_KEY (or another name with api_key_env). tollbar asks for structured JSON; if the provider doesn't support it, it falls back to plain JSON.Las claves salen de OPENAI_API_KEY, OPENROUTER_API_KEY o GEMINI_API_KEY (u otro nombre con api_key_env). tollbar pide JSON estructurado; si el proveedor no lo soporta, pasa a JSON simple.

A local model (ollama)Un modelo local (ollama)#

ai:
  provider: ollama
  model: qwen2.5-coder
  # base_url: http://localhost:11434/v1   # the default

Free, and the code never leaves your machine. Expect more false alarms than with a large model. Start it with ollama serve; tollbar status tells you if it isn't answering or doesn't have the model.Gratis, y el código no sale de tu máquina. Esperá más falsas alarmas que con un modelo grande. Prendelo con ollama serve; tollbar status te avisa si no responde o si no tiene el modelo.

Any OpenAI-compatible API (openai-compatible)Cualquier API compatible con OpenAI (openai-compatible)#

ai:
  provider: openai-compatible
  base_url: https://api.deepseek.com/v1
  api_key_env: DEEPSEEK_API_KEY
  model: your-model-id

Choosing with tollbar setupElegir con tollbar setup#

The same choices as options (only the variable's name is ever written):Las mismas opciones, como flags (solo se escribe el nombre de la variable, nunca la clave):

tollbar setup --yes --ai claude-cli --model opus
tollbar setup --yes --ai anthropic --model claude-sonnet-5-5
tollbar setup --yes --ai openrouter --model your-model-id --api-key-env MY_OPENROUTER_KEY
tollbar setup --yes --ai ollama --model qwen2.5-coder
tollbar setup --yes --ai openai-compatible --base-url https://api.deepseek.com/v1 --api-key-env DEEPSEEK_API_KEY --model your-model-id
tollbar setup --yes --ai cli --command "codex exec"
tollbar setup --yes --ai none

Fine-tuningAjuste fino#

KeyClaveDefaultPor defectoWhat it doesQué hace
ai.modeldepends on the providersegún el proveedorThe model. --model overrides it for one run.El modelo. --model lo cambia para una corrida.
ai.efforthigh with anthropichigh con anthropicHow much the model thinks: low, medium, high, xhigh, max. Also passed to Claude Code when set.Cuánto piensa el modelo: low, medium, high, xhigh, max. Si lo ponés, también se le pasa a Claude Code.
ai.verifytrueThe skeptic pass. Off means one call instead of two, and more false alarms.La pasada escéptica. Apagada son una llamada en vez de dos, y más falsas alarmas.
ai.timeout_seconds300How long to wait for each call.Cuánto espera cada llamada.
ai.fallbackstrueAnthropic only: let the server retry on another model if one declines.Solo Anthropic: que el servidor reintente con otro modelo si uno se niega.
ai.price(built-in for Anthropic models)(incluido para los modelos de Anthropic){ input, output } in US$ per million tokens, for cost estimates.{ input, output } en US$ por millón de tokens, para estimar costos.

What it costsCuánto cuesta#

tollbar has no server and resells nothing: the AI bills your own account.tollbar no tiene servidor ni revende nada: la IA le cobra a tu propia cuenta.

  • The footer shows the cost when it's known: cost ~US$0.031 · this month US$0.03 of 5.El pie muestra el costo cuando se conoce: cost ~US$0.031 · this month US$0.03 of 5.
  • Claude Code reports a cost for every call. On a subscription that figure is an estimate of the tokens used, not a bill, but tollbar still shows it and counts it.Claude Code informa un costo en cada llamada. Con una suscripción ese número es una estimación de los tokens usados, no una factura, pero tollbar igual lo muestra y lo cuenta.
  • Anthropic API: tollbar computes the cost from its built-in price list.API de Anthropic: tollbar calcula el costo con su lista de precios incluida.
  • Other providers: tollbar only knows the cost if you set ai.price. With the cli provider it never knows.Otros proveedores: tollbar solo sabe el costo si ponés ai.price. Con el proveedor cli no lo sabe nunca.
  • Each review with AI makes two calls (review plus skeptic pass) for normal-sized changes. Bigger changes are split into parts, one call each.Cada revisión con IA hace dos llamadas (la revisión y la pasada escéptica) en cambios de tamaño normal. Los cambios más grandes se parten en partes, una llamada cada una.

A monthly cap: budget_usd_monthUn tope mensual: budget_usd_month#

budget_usd_month: 5    # US$ per month, on this machine
  • Once this month's recorded spend reaches the cap, reviews run with rules only, and say so.Cuando lo gastado este mes llega al tope, las revisiones van solo con reglas, y te lo dicen.
  • If tollbar knows the price per token (Anthropic model ids, or ai.price), it also estimates each review before calling the AI, and skips the AI when the estimate doesn't fit in what's left.Si tollbar sabe el precio por token (ids de modelos de Anthropic, o ai.price), además estima cada revisión antes de llamar a la IA, y la saltea cuando la estimación no entra en lo que te queda.
  • The spend is kept per month in ~/.tollbar/usage.json. It only counts costs tollbar knows about.Lo gastado se guarda por mes en ~/.tollbar/usage.json. Solo cuenta los costos que tollbar conoce.

Real messages:Mensajes reales:

$ tollbar review   (budget_usd_month: 5, already spent 5.10)
...
no AI (rules only) · this month US$5.10 of 5 · 0.2 s
Monthly cap of US$5 reached (US$5.10 so far): this review runs with rules only.
$ tollbar review   (ai.price set, US$0.005 left)
...
no AI (rules only) · this month US$5.00 of 5 · 0.3 s
This review would cost ~US$0.08 and you have US$0.00 left this month: rules only.

When nothing was found, the verdict makes the missing AI visible, and --require-ai turns it into a failure:Cuando no se encontró nada, el veredicto deja a la vista que faltó la IA, y --require-ai lo convierte en un fallo:

$ tollbar review   (budget reached)
tollbar · uncommitted changes · 1 files, +2 −0

[NO AI] No problems found. Monthly cap reached: only the rules ran, the logic wasn't reviewed.

no AI (rules only) · this month US$5.10 of 5 · 0.1 s
Monthly cap of US$5 reached (US$5.10 so far): this review runs with rules only.
$ echo $?
0
$ tollbar review --require-ai   (budget reached)
tollbar · uncommitted changes · 1 files, +2 −0

[NO AI] No problems found. Monthly cap reached: only the rules ran, the logic wasn't reviewed.

no AI (rules only) · this month US$5.10 of 5 · 0.1 s
Monthly cap of US$5 reached (US$5.10 so far): this review runs with rules only.
require_ai is on and the AI did not review the whole change: exiting with code 4.
$ echo $?
4

With claude-cli and a model alias like sonnet, there's no price per token to estimate with: the cap is checked against what you've already spent, so the review that crosses the line still runs. Set ai.price if you want the estimate too.Con claude-cli y un alias de modelo como sonnet, no hay precio por token para estimar: el tope se compara con lo que ya gastaste, así que la revisión que cruza la línea igual corre. Poné ai.price si también querés la estimación.

Company setupsEn empresas#

  • Claude Enterprise or Team through Claude Code. Use provider: claude-cli. tollbar uses whatever account Claude Code is logged into, including your company's.Claude Enterprise o Team a través de Claude Code. Usá provider: claude-cli. tollbar usa la cuenta en la que esté logueado Claude Code, también la de tu empresa.
  • Bedrock, Vertex, an internal gateway, an API key helper. If your company set Claude Code up for them in ~/.claude/settings.json, tollbar passes those settings along (the env, apiKeyHelper, awsAuthRefresh, awsCredentialExport, forceLoginMethod and forceLoginOrgUUID keys). They go through a private temporary file, never on the command line, and the file is deleted right after. Environment variables you set in your shell are inherited too.Bedrock, Vertex, un gateway interno, un API key helper. Si tu empresa configuró Claude Code para eso en ~/.claude/settings.json, tollbar le pasa esa configuración (las claves env, apiKeyHelper, awsAuthRefresh, awsCredentialExport, forceLoginMethod y forceLoginOrgUUID). Van por un archivo temporal privado, nunca por la línea de comandos, y el archivo se borra enseguida. Las variables de entorno que tengas definidas en tu shell también se heredan.
  • Company-wide (managed) Claude Code settings always apply on their own.La configuración administrada (managed) de Claude Code para toda la empresa siempre se aplica sola.
  • A gateway for the Anthropic API. provider: anthropic with base_url and api_key_env in your personal settings.Un gateway para la API de Anthropic. provider: anthropic con base_url y api_key_env en tu configuración personal.

To check where the code would go, look at the Privacy line of tollbar status. To test with a real call: tollbar status --check. If it fails with claude-cli, try claude -p "reply with ok": if that fails too, Claude Code isn't logged in, or your company doesn't allow non-interactive use.Para ver adónde iría el código, mirá la línea Privacy de tollbar status. Para probar con una llamada real: tollbar status --check. Si falla con claude-cli, probá claude -p "reply with ok": si eso también falla, Claude Code no está logueado, o tu empresa no permite usarlo sin interacción.

Hooks: Claude Code and git pushHooks: Claude Code y git push#

Hooks make tollbar run on its own at the right moment. Both kinds are installed per repo (the Claude Code one can also cover a whole folder of repos), and both block only on major or worse.Los hooks hacen que tollbar corra solo en el momento justo. Los dos se instalan por repo (el de Claude Code también puede cubrir una carpeta con muchos repos), y los dos frenan solo en major o peor.

Claude Code Stop hookHook Stop de Claude Code#

What it's for: when Claude Code says it's done, tollbar reviews what it left uncommitted. If something is serious, it hands the list back, and the agent keeps working until it's fixed.Para qué sirve: cuando Claude Code dice que terminó, tollbar revisa lo que dejó sin commitear. Si hay algo grave, le devuelve la lista, y el agente sigue trabajando hasta arreglarlo.

tollbar hook install            # rules only: under 2 seconds
tollbar hook install --ai       # also review the logic: 15-40 seconds each time
tollbar hook install --local    # in .claude/settings.local.json, which stays out of git
$ tollbar hook install
Added the Stop hook in ~\projects\shop\.claude\settings.json:
  tollbar hook claude-stop

From now on, when Claude Code finishes a task here, tollbar reviews what's left uncommitted and, if something is serious, hands it back so the agent fixes it before saying "done".
With --ai it also reviews the logic (slower: 15-40 s each time).

It adds this to .claude/settings.json, keeping everything else that's there:Agrega esto a .claude/settings.json, sin tocar lo demás que haya:

{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "tollbar hook claude-stop",
            "timeout": 60
          }
        ]
      }
    ]
  }
}

(With --ai the command gets --ai and the timeout is 300 seconds.)(Con --ai, el comando lleva --ai y el timeout es de 300 segundos.)

When the agent finishes with serious problems in its work, this is what Claude Code receives ({"decision": "block", "reason": ...}); the reason is what the agent reads:Cuando el agente termina con algo grave en su trabajo, esto es lo que recibe Claude Code ({"decision": "block", "reason": ...}); el reason es lo que lee el agente:

tollbar reviewed the uncommitted changes and found problems to fix before finishing:

Review and fix these problems found by an automated review. Check each one before changing anything; if one isn't real, explain why and leave it alone:
1. api/orders.php:4 — SQL query with user input (SQL injection). Use prepared statements (prepare + bind) and never put $_GET/$_POST into SQL.
2. api/orders.php:7 — User input is printed on the page without escaping (XSS). Escape it before printing: esc_html() / esc_attr() in WordPress, htmlspecialchars() in plain PHP.
...
7. tests/payments.test.js:5 — Tests that check nothing. Add real checks of the result, or ask the agent to redo them so they test the behavior.

Fix the real ones. If one looks like a false alarm, do not ignore it on your own: explain why to the user in your reply, and they decide whether to record it with "tollbar ignore".

How it behaves:Cómo se comporta:

  • Nothing serious: nothing is printed and you won't notice it.Si no hay nada grave, no imprime nada y ni te enterás.
  • At most once per task: when Claude Code is already continuing because of the hook, tollbar lets it stop. No loops.Como mucho una vez por tarea: si Claude Code ya está siguiendo por culpa del hook, tollbar lo deja terminar. No hay loops.
  • You decide on false alarms, not the agent: it's told to explain, and only you run tollbar ignore.Las falsas alarmas las decidís vos, no el agente: a él se le pide que explique, y solo vos corrés tollbar ignore.
  • Only uncommitted work. If your agent commits as it goes, the pre-push hook is the better fit.Solo mira lo no commiteado. Si tu agente commitea a medida que avanza, te sirve más el hook pre-push.
  • tollbar's own AI calls never trigger it.Las llamadas de tollbar a su propia IA nunca lo disparan.

A folder full of repos. Run tollbar hook install in a folder that isn't a repo (say ~/projects), and the hook goes in ~/projects/.claude/settings.json. When you open Claude Code in that folder, tollbar reviews each repo under it (one or two levels down) that has uncommitted files changed in the last hour.Una carpeta llena de repos. Corré tollbar hook install en una carpeta que no es un repo (por ejemplo ~/projects), y el hook va a ~/projects/.claude/settings.json. Cuando abrís Claude Code en esa carpeta, tollbar revisa cada repo de adentro (uno o dos niveles abajo) que tenga archivos sin commitear tocados en la última hora.

$ cd ~/projects && tollbar hook install
Added the Stop hook in ~\projects\.claude\settings.json:
  tollbar hook claude-stop
...

tollbar status, inside one of those repos, shows it:tollbar status, adentro de uno de esos repos, lo muestra:

            Claude Code Stop  on from a folder above, rules only (~\projects\.claude\settings.json: applies when Claude Code is opened there)

Taking it out. Only tollbar's entry goes; other hooks and settings stay. If the file ends up empty, it's deleted.Sacarlo. Solo se va la entrada de tollbar; los otros hooks y opciones quedan. Si el archivo queda vacío, se borra.

$ tollbar hook uninstall
Removed tollbar's Stop hook; ~\projects\shop\.claude\settings.json was left empty, so it was deleted.
$ tollbar hook uninstall --local
Removed tollbar's Stop hook; ~\projects\shop\.claude\settings.local.json was left empty, so it was deleted.

git pre-push hookHook pre-push de git#

What it's for: every git push from this repo goes through tollbar first. If what you're about to push has something serious, the push stops. It works with any remote (GitHub, GitLab, Bitbucket, a company server), because git hands the hook the commits locally; nothing gets connected.Para qué sirve: cada git push de este repo pasa primero por tollbar. Si lo que vas a subir tiene algo grave, el push se frena. Sirve con cualquier remoto (GitHub, GitLab, Bitbucket, un servidor de la empresa), porque git le pasa los commits al hook localmente; no hay que conectar nada.

tollbar hook install --git          # rules only: about a second
tollbar hook install --git --ai     # also the AI: 15-40 seconds per push
$ tollbar hook install --git
Added the pre-push hook in ~\projects\shop\.git\hooks\pre-push.

From now on, every git push from this repo goes through tollbar: if what you are about to push has something serious, the push stops. To skip it once: git push --no-verify.
With --ai it also reviews the logic with your AI (slower: 15-40 s per push).

A push with problems:Un push con problemas:

$ git push
Reviewing 5 files (push of main)…
tollbar · push of main · 5 files, +30 −12

[BLOCKED] 7 serious problems: don't ship this.

1. [CRITICAL] SQL query with user input (SQL injection)
   Security · api/orders.php:4 · rule php-sql-injection
...
no AI (rules only) · 0.3 s

Push stopped by tollbar. Fix it and push again; if it is a false alarm: tollbar ignore <n>. To push anyway this once: git push --no-verify
error: failed to push some refs to '…/shop.git'

To push anyway this once:Para pushear igual esta vez:

$ git push --no-verify
   d11a7c9..b2c14e3  main -> main

Details:Detalles:

  • What it compares against: what the remote already has. For a new branch, its upstream or origin/main.Contra qué compara: contra lo que ya tiene el remoto. Para una rama nueva, contra su upstream u origin/main.
  • Tags and branch deletions aren't reviewed (no new code).Los tags y los borrados de ramas no se revisan (no traen código nuevo).
  • The hook file is tollbar's own, in .git/hooks/pre-push. It belongs to your clone and is never committed. It's a three-line shell script; if tollbar isn't on the PATH, it prints tollbar not found: pushing without review and lets the push through.El archivo del hook es de tollbar, en .git/hooks/pre-push. Es de tu clon y nunca se commitea. Es un script de tres líneas; si tollbar no está en el PATH, imprime tollbar not found: pushing without review y deja pasar el push.
  • tollbar ignore <n> works on the last push review, too.tollbar ignore <n> también funciona sobre la última revisión de un push.

An existing pre-push hook. tollbar never overwrites a hook that isn't its own. It tells you the line to add:Un hook pre-push que ya existía. tollbar nunca pisa un hook que no es suyo. Te dice qué línea agregar:

$ tollbar hook install --git
tollbar: There is already a pre-push hook in ~\projects\shop\.git\hooks\pre-push that isn't tollbar's; leaving it alone. To add tollbar, append this line:
  tollbar hook pre-push || exit 1

core.hooksPath (husky and similar). If the repo sends its hooks to another folder, that folder is usually committed and shared with your team. tollbar setup doesn't install there unless you say so:core.hooksPath (husky y parecidos). Si el repo manda sus hooks a otra carpeta, esa carpeta suele commitearse y compartirse con tu equipo. tollbar setup no instala ahí salvo que se lo pidas:

Note: This repo uses core.hooksPath (.husky): the hook would go in that folder, which is usually committed or shared. Not installed. If you want it there anyway: --allow-hooks-path

(When asked interactively, setup asks first. tollbar hook install --git itself follows core.hooksPath.)(Si estás respondiendo las preguntas, setup te pregunta antes. tollbar hook install --git por sí solo sí respeta core.hooksPath.)

Taking it out:Sacarlo:

$ tollbar hook uninstall --git
Removed tollbar's pre-push hook (~\projects\shop\.git\hooks\pre-push). Pushes no longer go through tollbar.
$ tollbar hook uninstall --git
There is no tollbar pre-push hook in this repo.

Hooks through tollbar setupHooks con tollbar setup#

tollbar setup installs, changes and removes both hooks for you, from question 3 or --hooks:tollbar setup instala, cambia y saca los dos hooks por vos, desde la pregunta 3 o con --hooks:

  • pre-push:ai, pre-push:rules;
  • claude-stop:rules, claude-stop:ai;
  • deploy (prints the lines for your deploy script);deploy (te imprime las líneas para tu script de deploy);
  • workflow (GitHub Actions);
  • none.

A hook you leave out gets removed. With the work profile, the Claude Code hook always goes in .claude/settings.local.json, and setup makes git ignore it.Un hook que dejás afuera se saca. Con el perfil work, el hook de Claude Code va siempre en .claude/settings.local.json, y setup hace que git lo ignore.

Deploys without pull requestsDeploys sin pull requests#

mark-deploy and --since-deploymark-deploy y --since-deploy#

What it's for: reviewing everything that changed since the last time you deployed, however many commits that is.Para qué sirve: revisar todo lo que cambió desde la última vez que deployaste, sean los commits que sean.

tollbar mark-deploy                      # right after a deploy
tollbar review --since-deploy            # before the next one

The mark is a git ref (refs/tollbar/last-deploy) in your clone. It isn't pushed, so each clone or machine has its own.La marca es una referencia de git (refs/tollbar/last-deploy) en tu clon. No se pushea, así que cada clon o máquina tiene la suya.

A deploy script with a gateUn script de deploy con freno#

#!/bin/sh
tollbar review --since-deploy --gate major || { echo "Deploy blocked"; exit 1; }
./deploy.sh          # your real deploy: rsync, scp, git pull on the server...
tollbar mark-deploy

When something serious is in there:Cuando hay algo grave:

$ tollbar review --since-deploy --gate major --no-ai || { echo "Deploy blocked"; exit 1; }
tollbar · changes since the last deploy (d11a7c9) · 5 files, +30 −12

[BLOCKED] 6 serious problems: don't ship this.
...
Deploy blocked

After deploying and marking, the next review starts from zero:Después de deployar y marcar, la próxima revisión arranca de cero:

$ tollbar mark-deploy
Deploy marked at 255290e. Next time: tollbar review --since-deploy
$ tollbar review --since-deploy --no-ai
tollbar · changes since the last deploy (255290e) · 0 files, +0 −0

[OK] No problems found. Rules only: the logic wasn't reviewed.

To make sure the gate never passes on rules alone by accident (the AI failed, or the monthly cap was reached), add --require-ai: tollbar then exits with code 4.Para que el freno nunca pase solo con reglas por accidente (la IA falló, o se llegó al tope mensual), agregá --require-ai: en ese caso tollbar sale con código 4.

In PowerShell, where || doesn't exist in version 5.1:En PowerShell, donde || no existe en la versión 5.1:

tollbar review --since-deploy --gate major
if ($LASTEXITCODE -ne 0) { Write-Host "Deploy blocked"; exit 1 }

tollbar setup with option 3 (or --hooks deploy) prints these lines for you. It installs nothing.tollbar setup con la opción 3 (o --hooks deploy) te imprime estas líneas. No instala nada.

tollbar drift: does the server match git?tollbar drift: ¿el servidor coincide con git?#

What it's for: before deploying, find out whether someone edited files on the server by hand (your deploy would overwrite them), whether files are missing, or whether there are files git doesn't know about. On a hacked site, those are often injected files.Para qué sirve: antes de deployar, saber si alguien editó archivos a mano en el servidor (tu deploy los pisaría), si faltan archivos, o si hay archivos que git no conoce. En un sitio hackeado, esos suelen ser archivos inyectados.

tollbar drift --ssh deploy@my-server --path /var/www/shop --ignore "tests/**" --strict
tollbar drift · deploy@my-server:/var/www/shop against last deploy (d11a7c9) · 5 files in git

[DRIFT] The server differs from git in 3 files.

Modified on the server (1): someone edited them by hand, or the last deploy wasn't this commit. Deploying overwrites those changes.
  api/orders.php

Missing on the server (1): they're in git but not on the server.
  public/search.js

Only on the server (1): git doesn't know them. Check they aren't injected files (it happens on hacked sites).
  public/wp-cache.php

(Exit code 3, because of --strict and one hand-edited file.) When everything matches:(Código de salida 3, por --strict y un archivo editado a mano.) Cuando todo coincide:

tollbar drift · deploy@my-server:/var/www/shop against last deploy (d11a7c9) · 5 files in git

[OK] The server matches git.

Options and details:Opciones y detalles:

  • --ref <commit> compares with another commit. By default it uses the last mark-deploy, or HEAD if there's none.--ref <commit> compara contra otro commit. Por defecto usa el último mark-deploy, o HEAD si no hay.
  • --ignore <glob> skips repo files you don't deploy (tests/**, package.json...). Repeat it for several.--ignore <glob> saltea archivos del repo que no deployás (tests/**, package.json...). Repetilo para varios.
  • --strict exits with code 3 when files were edited by hand. Missing and extra files are only reported.--strict sale con código 3 cuando hay archivos editados a mano. Los faltantes y los de más solo se informan.
  • What it compares: file hashes (SHA-256). Windows vs Linux line endings count as equal.Qué compara: hashes de los archivos (SHA-256). Los finales de línea de Windows y de Linux cuentan como iguales.
  • What it skips on the server: node_modules, .git, .next, .next.old, .cache and staging, plus anything your .gitignore ignores (so .env and uploads you ignore don't show up).Qué saltea en el servidor: node_modules, .git, .next, .next.old, .cache y staging, más todo lo que ignora tu .gitignore (así no aparecen el .env ni los uploads que ignorás).
  • What it needs: ssh with key login (it runs with BatchMode=yes, so it never asks for a password), and bash, sha256sum and find on the server.Qué necesita: ssh con login por clave (corre con BatchMode=yes, así que nunca te pide contraseña), y bash, sha256sum y find en el servidor.

Telegram alertsAlertas por Telegram#

What it's for: a message on your phone with the result, for example from a deploy script or a cron job.Para qué sirve: un mensaje en el celular con el resultado, por ejemplo desde un script de deploy o un cron.

export TOLLBAR_TELEGRAM_TOKEN=123456:ABC...   # your bot's token, from @BotFather
export TOLLBAR_TELEGRAM_CHAT=123456789        # the chat the bot writes to
tollbar review --since-deploy --gate major --notify

The message tollbar sent in that run:El mensaje que mandó tollbar en esa corrida:

🔴 BLOCKED · shop
changes since the last deploy (d11a7c9) · 5 files, +30 −12

1. [CRITICAL] SQL query with user input (SQL injection)
   api/orders.php:4

2. [CRITICAL] User input is printed on the page without escaping (XSS)
   api/orders.php:7

3. [CRITICAL] Secret in the code (Stripe secret key)
   src/payments.js:3

4. [CRITICAL] The package "currency-format-utils-pro" doesn't exist on npm
   src/payments.js:1

5. [MAJOR] Looks like code the AI cut short
   src/cart.js:13

6. [MAJOR] Tests that check nothing
   tests/payments.test.js:5

It lists up to 8 findings (titles and places only, no code). If the variables are missing, the review still runs and warns you:Lista hasta 8 hallazgos (solo títulos y lugares, sin código). Si faltan las variables, la revisión corre igual y te avisa:

Warning: the Telegram message was not sent (TOLLBAR_TELEGRAM_TOKEN and/or TOLLBAR_TELEGRAM_CHAT are missing).

GitHub Action#

What it's for: reviewing every pull request and every push on GitHub, with comments right on the lines, using your own AI account.Para qué sirve: revisar cada pull request y cada push en GitHub, con comentarios en las líneas, usando tu propia cuenta de IA.

Set it upConfigurarlo#

Copy examples/github-workflow.yml to .github/workflows/tollbar.yml (or run tollbar setup --profile ci in the repo, which adds it), commit it, and add your AI secret.Copiá examples/github-workflow.yml a .github/workflows/tollbar.yml (o corré tollbar setup --profile ci en el repo, que lo agrega), commitealo y cargá el secreto de tu IA.

name: tollbar

on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review]
  push:
    branches: [main]        # remove it if you only want PR reviews
  pull_request_review_comment:
    types: [created]        # "false positive" replies to a tollbar comment are saved as learnings

permissions:
  contents: write           # comment on pushed commits and save learnings to .tollbar/learnings.md
  pull-requests: write      # comment on the PR

concurrency:
  group: tollbar-${{ github.event.comment.id || github.event.pull_request.number || github.sha }}
  cancel-in-progress: true

jobs:
  review:
    runs-on: ubuntu-latest
    if: >-
      github.event.pull_request.draft != true &&
      (github.event_name != 'pull_request_review_comment' || github.event.comment.in_reply_to_id)
    steps:
      - uses: actions/checkout@v7
        with:
          fetch-depth: 0    # tollbar needs the history to compare against

      - uses: ernestojost/tollbar@v0
        with:
          gate: major       # the job fails if something major or critical shows up
          # install-claude: 'true'   # for option B
        env:
          # Option A: Anthropic API
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
          # Option B: your Claude subscription (create the token with `claude setup-token`)
          # CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
          # Option C: another provider (set it up in .tollbar.yml)
          # OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
          # With no key at all, tollbar reviews with rules only.

The AI secretEl secreto de la IA#

Add it in Settings → Secrets and variables → Actions. Pick one:Cargalo en Settings → Secrets and variables → Actions. Elegí uno:

  • A. Anthropic API key: a secret named ANTHROPIC_API_KEY.A. API key de Anthropic: un secreto llamado ANTHROPIC_API_KEY.
  • B. Your Claude subscription: run claude setup-token on your machine, save the token as CLAUDE_CODE_OAUTH_TOKEN, uncomment that line and set install-claude: 'true'. The action installs Claude Code and tollbar uses it (claude-cli).B. Tu suscripción de Claude: corré claude setup-token en tu máquina, guardá el token como CLAUDE_CODE_OAUTH_TOKEN, descomentá esa línea y poné install-claude: 'true'. La action instala Claude Code y tollbar lo usa (claude-cli).
  • C. Another provider: set ai: in the repo's .tollbar.yml and pass that provider's key variable.C. Otro proveedor: poné ai: en el .tollbar.yml del repo y pasale la variable de la clave de ese proveedor.
  • No secret: rules only.Sin secreto: solo reglas.

Inputs#

InputDefaultPor defectoWhat it doesQué hace
gateempty (use .tollbar.yml)vacío (usa .tollbar.yml)Fail the job at this level or worse: critical, major, minor, none.Falla el job en ese nivel o peor: critical, major, minor, none.
modelemptyvacíoModel for the AI, overriding .tollbar.yml.Modelo para la IA; pisa el de .tollbar.yml.
argsemptyvacíoMore options for tollbar github, e.g. --no-ai --max-findings 10.Más opciones para tollbar github, por ejemplo --no-ai --max-findings 10.
github-token${{ github.token }}Token for posting comments.El token para publicar comentarios.
install-claude'false'Install Claude Code, for option B.Instala Claude Code, para la opción B.

What shows up on a pull requestQué aparece en un pull request#

One review with an inline comment on each problem line. A real one:Una review con un comentario en cada línea con problema. Uno real:

**🔴 [CRITICAL] SQL query with user input (SQL injection)**

What the visitor sends goes straight to the database. With that they can read, change or delete everything.

**Fix:** Use prepared statements (prepare + bind) and never put $_GET/$_POST into SQL.

<details><summary>Prompt for your agent</summary>

```
In api/orders.php:4: SQL query with user input (SQL injection). Use prepared statements (prepare + bind) and never put $_GET/$_POST into SQL. Check that the problem is real before changing the code.
```
</details>

<sub>tollbar · rule `php-sql-injection`</sub>
<!-- tollbar:fp=c46c6e4b210c -->

When the AI knows the exact replacement, the comment also carries a GitHub ```suggestion block, so you can apply it with one click. The review itself says **tollbar** found 7 new problems. Full summary in the PR comment.Cuando la IA sabe el reemplazo exacto, el comentario trae además un bloque ```suggestion de GitHub, para aplicarlo con un clic. La review en sí dice **tollbar** found 7 new problems. Full summary in the PR comment.

One summary comment, updated on every push instead of piling up (trimmed):Un solo comentario de resumen, que se actualiza en cada push en lugar de acumularse (recortado):

### 🔴 BLOCKED: 6 serious problems: don't ship this.
<sub>PR #7 · 5 files, +30 −12</sub>

**1. [CRITICAL] SQL query with user input (SQL injection)**  
`api/orders.php:4` · Security · rule `php-sql-injection`
...
<details><summary>Prompt for your agent</summary>
...
</details>

<sub>Incremental review: the AI looked at 1 files new or changed since the previous review.</sub>

<sub>6 open threads from earlier reviews.</sub>

Incremental reviews. On each new push, the rules check the whole PR again, but the AI only looks at the files that changed since the last reviewed commit. Problems that already have a comment aren't commented again.Revisiones incrementales. En cada push nuevo, las reglas vuelven a mirar todo el PR, pero la IA solo mira los archivos que cambiaron desde el último commit revisado. Los problemas que ya tienen un comentario no se comentan de nuevo.

Threads close themselves. When a problem tollbar commented on is gone from a file it re-reviewed, it replies and resolves the thread:Los hilos se cierran solos. Cuando un problema que tollbar comentó ya no está en un archivo que volvió a revisar, responde y resuelve el hilo:

Looks fixed in 255290e. ✅

The job log sums it up:El log del job lo resume:

GitHub: 7 new comments · 0 threads resolved · summary created
...
GitHub: 0 new comments · 1 threads resolved · summary updated

Always, even without permission to comment: annotations on the diff and a job summary. Annotations look like this in the log (critical and major are errors, minor are warnings):Siempre, aunque no haya permiso para comentar: anotaciones en el diff y un resumen del job. Las anotaciones se ven así en el log (crítico e importante son errores, menor son avisos):

::error file=api/orders.php,line=4,title=tollbar%3A SQL query with user input (SQL injection)::What the visitor sends goes straight to the database. With that they can read, change or delete everything.%0AFix: Use prepared statements (prepare + bind) and never put $_GET/$_POST into SQL.

On a push without a pull requestEn un push sin pull request#

If the push has findings, tollbar leaves one comment on the pushed commit with the same summary. (That needs contents: write.)Si el push tiene hallazgos, tollbar deja un comentario en el commit pusheado con el mismo resumen. (Para eso hace falta contents: write.)

Block merges: make it a required checkFrenar merges: hacelo un check obligatorio#

With gate: major, the job fails (exit code 2) when something serious shows up. To block merging, go to Settings → Branches (or Rules), protect your main branch, and require the status check from this workflow (the job is called review).Con gate: major, el job falla (código 2) cuando aparece algo grave. Para que eso frene el merge, andá a Settings → Branches (o Rules), protegé tu rama principal y marcá como obligatorio el check de este workflow (el job se llama review).

Replies teach tollbarLas respuestas le enseñan a tollbar#

Reply to a tollbar comment with "false positive", "ignore", "not an issue", "wontfix", "falso positivo", "ignorar", "no aplica" or similar. tollbar then:Respondé a un comentario de tollbar con "falso positivo", "ignorar", "no aplica", "no es un problema", "false positive", "ignore", "wontfix" o parecido. tollbar entonces:

  1. commits the learning to .tollbar/learnings.md on the PR branch;commitea el aprendizaje en .tollbar/learnings.md del branch del PR;
  2. answers; andcontesta; y
  3. resolves the thread.resuelve el hilo.
Learning recorded in .tollbar/learnings.md: - `tests/payments.test.js`: "Tests that check nothing". false positive: smoke test, it only checks that charge() doesn't throw (@sam) <!-- fp:71dcc051b2c4 -->

The reply on the thread:La respuesta en el hilo:

Recorded in `.tollbar/learnings.md` (commit 7f3e2a1): I won't flag it again. If that was a mistake, delete that line.

Only replies from people with write access count (owner, member, collaborator):Solo cuentan las respuestas de gente con permiso de escritura (dueño, miembro, colaborador):

::warning title=tollbar::@stranger has no write access to the repo: the learning is not recorded.

On a PR from a fork, tollbar can't write to the fork's branch, so it replies with the line to add by hand.En un PR que viene de un fork, tollbar no puede escribir en el branch del fork, así que contesta con la línea para que la agregues a mano.

Security on GitHubSeguridad en GitHub#

  • pull_request_target is refused, because it runs with write permissions on someone else's code:pull_request_target se rechaza, porque corre con permisos de escritura sobre código de terceros:

    ::warning title=tollbar::pull_request_target runs with write permissions on third-party code: tollbar refuses it for security. Use pull_request.
  • Fork PRs get no secrets and a read-only token from GitHub. tollbar then reviews with rules only, and the annotations and the job summary remain:Los PRs desde forks no reciben secretos y tienen un token de solo lectura (así lo hace GitHub). tollbar revisa entonces solo con reglas, y quedan las anotaciones y el resumen del job:

    ::warning title=tollbar::GitHub refused to post (403). Add "permissions: pull-requests: write" to the workflow (and "contents: write" to comment on commits). On fork PRs the token is read-only: annotations and the job summary remain.

    With no token at all, it says No GITHUB_TOKEN: annotations and job summary only.Sin ningún token, dice No GITHUB_TOKEN: annotations and job summary only.

  • The diff is data, never instructions. The AI is told so, and asked to report text in the diff that tries to give it orders.El diff es un dato, nunca una orden. Se lo dice a la IA, y le pide que reporte cualquier texto del diff que intente darle instrucciones.
  • In CI, the repo's .tollbar.yml applies in full. The trust limits are for clones on your machine.En CI, el .tollbar.yml del repo vale entero. Los límites de confianza son para los clones en tu máquina.

False alarms and learningsFalsas alarmas y aprendizajes#

What it's for: when tollbar flags something that isn't a problem, you tell it once and it doesn't flag it again. Only you decide; the agent is told not to.Para qué sirve: cuando tollbar marca algo que no es un problema, se lo decís una vez y no lo vuelve a marcar. Lo decidís solo vos; al agente se le pide que no lo haga.

tollbar ignore#

<n> is the finding's number in the last review in this clone.<n> es el número del hallazgo en la última revisión de este clon.

$ tollbar review --no-ai --max-findings 10
tollbar · uncommitted changes · 6 files, +35 −12

[REVIEW] 7 serious problems.
...
8. [MINOR] A test var_dump / print_r was left
   Deploy · tools/seed.php:5 · rule debug-print
   > var_dump($rows);
   It prints internal data on the page, in front of visitors.
   Fix: Delete it, or use error_log() if you need to record it.
...
$ tollbar ignore 7 --reason "smoke test: it only checks that charge() doesn't throw"
Recorded in .tollbar/learnings.md:
- `tests/payments.test.js`: "Tests that check nothing". smoke test: it only checks that charge() doesn't throw <!-- fp:71dcc051b2c4 -->

Commit it so it also applies on GitHub and for the rest of the team.
$ tollbar ignore 8 --rule --path "tools/**" --reason "internal scripts, never deployed"
Recorded in .tollbar/learnings.md:
- ignore rule `debug-print` in `tools/**`: internal scripts, never deployed

Commit it so it also applies on GitHub and for the rest of the team.

The next review hides them and says so:La próxima revisión los oculta y te lo dice:

$ tollbar review --no-ai
tollbar · uncommitted changes · 7 files, +41 −12

[REVIEW] 6 serious problems.
...
no AI (rules only) · 0.2 s
2 findings are hidden because they are in .tollbar/learnings.md.
  • tollbar ignore <n> hides that finding (it's recognized by file, kind and code, so it survives line moves).tollbar ignore <n> oculta ese hallazgo (lo reconoce por archivo, tipo y código, así que sobrevive aunque cambie de línea).
  • --rule hides the whole rule in that file. Add --path <glob> for a folder or pattern. It only works for rule findings; for an AI finding, leave --rule out.--rule oculta la regla entera en ese archivo. Sumale --path <glob> para una carpeta o un patrón. Solo sirve para hallazgos de reglas; para uno de la IA, sacá --rule.
  • --reason is optional but helps your future self and your team. The AI reads it too.--reason es opcional, pero le sirve a tu yo del futuro y a tu equipo. La IA también lo lee.
  • Instead of a number you can pass the start of a finding's id (as in the JSON output).En lugar del número podés pasar el comienzo del id de un hallazgo (como aparece en la salida JSON).

The learnings fileEl archivo de aprendizajes#

It's a normal Markdown file in your repo. You can read it, edit it, delete lines, and commit it so it applies on GitHub and for your team:Es un archivo Markdown normal en tu repo. Lo podés leer, editar, borrarle líneas y commitearlo para que valga en GitHub y para tu equipo:

# tollbar learnings

False alarms tollbar must not flag again. They're read on every review: edit or delete them by hand.

- `tests/payments.test.js`: "Tests that check nothing". smoke test: it only checks that charge() doesn't throw <!-- fp:71dcc051b2c4 -->
- ignore rule `debug-print` in `tools/**`: internal scripts, never deployed

tollbar understands two kinds of lines, without AI:tollbar entiende dos tipos de líneas, sin IA:

  • any line with <!-- fp:xxxxxxxxxxxx --> (12 hex characters): that exact finding;cualquier línea con <!-- fp:xxxxxxxxxxxx --> (12 caracteres hexadecimales): ese hallazgo exacto;
  • ignore rule `rule-id` in `glob` (the in ... part is optional): that rule there, or everywhere.ignore rule `id-de-la-regla` in `glob` (la parte in ... es opcional): esa regla ahí, o en todos lados.

The whole file is also given to the AI as context, so a plain-language note ("we validate ids in the router, don't flag them in controllers") helps too.Además, el archivo entero se le pasa a la IA como contexto, así que una nota en palabras simples ("los ids se validan en el router, no los marques en los controllers") también ayuda.

Other ways to quiet thingsOtras formas de bajar el ruido#

  • disabled_rules: [debug-print] in a settings file turns rules off everywhere (ids in the catalog).disabled_rules: [debug-print] en un archivo de configuración apaga reglas en todos lados (los ids están en el catálogo).
  • ignore: ["legacy/**"] skips files entirely, for rules and AI.ignore: ["legacy/**"] saltea archivos por completo, para reglas e IA.
  • min_severity: major hides all minor issues.min_severity: major oculta todos los detalles menores.

Learnings that stay out of the repoAprendizajes fuera del repo#

With learnings: local (the work profile sets it), tollbar ignore writes to .git/tollbar/learnings.md in that clone instead. Nothing is committed:Con learnings: local (lo pone el perfil work), tollbar ignore escribe en .git/tollbar/learnings.md de ese clon. No se commitea nada:

$ tollbar ignore 7 --reason "smoke test"
Recorded in .git/tollbar/learnings.md (this clone only, inside .git: never committed):
- `tests/payments.test.js`: "Tests that check nothing". smoke test <!-- fp:71dcc051b2c4 -->

In GitHub Actions there's no clone to keep them in, so they go to the repo file as usual.En GitHub Actions no hay un clon donde guardarlos, así que van al archivo del repo como siempre.

Configuration referenceReferencia de configuración#

Where settings liveDónde vive la configuración#

FileArchivoApplies toVale paraWritten byLo escribe
~/.tollbar/config.ymlEvery repo on this machineTodos los repos de esta máquinatollbar setup, tollbar init --global, or youtollbar setup, tollbar init --global, o vos
.tollbar.yml (or .tollbar.yaml) at the repo root.tollbar.yml (o .tollbar.yaml) en la raíz del repoThat repo, for everyone who clones itEse repo, para todos los que lo clonentollbar init, or youtollbar init, o vos
  • The repo's file wins over your personal one.El archivo del repo gana sobre el personal.
  • The ai section merges key by key. If the repo picks a different provider, that only applies in CI or after tollbar trust; then the repo's ai section is used alone.La sección ai se combina clave por clave. Si el repo elige otro proveedor, eso solo vale en CI o después de tollbar trust; en ese caso se usa solo la sección ai del repo.
  • ignore and disabled_rules add up from both files.ignore y disabled_rules se suman entre los dos archivos.
  • Outside CI, a repo's file has limits until you trust it.Fuera de CI, el archivo de un repo tiene límites hasta que confiás en él.
  • TOLLBAR_CONFIG points tollbar at another personal file.TOLLBAR_CONFIG apunta tollbar a otro archivo personal.

tollbar init --global writes a short personal template (it refuses if the file exists):tollbar init --global escribe una plantilla personal corta (si el archivo ya existe, no lo toca):

# tollbar: your personal settings, for every repo on this machine.
# If a repo has its own .tollbar.yml, that file wins.
ai:
  provider: claude-cli   # your Claude Code, with whatever account you're logged into (your company's too)
  model: sonnet
# check_registry: false  # don't look up imported packages on npm (at work: internal package names never leave)
# gate: major
# budget_usd_month: 5

tollbar init writes the repo template:tollbar init escribe la plantilla del repo:

# tollbar: code review with your own AI. AI costs go to your own account.
ai:
  # Pick ONE:
  #   claude-cli   your installed Claude Code (uses your subscription or API key)
  #   cli          any command that reads the prompt on stdin: "codex exec", "gemini -p", "ollama run qwen2.5-coder"
  #   anthropic    Anthropic API with your ANTHROPIC_API_KEY
  #   openai       OpenAI API with your OPENAI_API_KEY
  #   openrouter   OpenRouter with your OPENROUTER_API_KEY (hundreds of models)
  #   gemini       Google API with your GEMINI_API_KEY
  #   ollama       local model, free (more false alarms)
  #   openai-compatible  any OpenAI-compatible API (set base_url and api_key_env)
  #   none         rules only, no AI
  provider: claude-cli
  model: sonnet
  # anthropic: claude-opus-5-5 (default, reviews best) · claude-sonnet-5-5 (cheaper) · claude-haiku-5-5 (cheapest)
  # effort: high          # anthropic: low | medium | high | xhigh | max
  # api_key_env: MY_KEY   # name of the environment variable holding the key
  # base_url: https://api.deepseek.com/v1
  # price: { input: 2, output: 10 }   # US$ per million tokens, to estimate cost for models tollbar doesn't know
  verify: true           # second pass that tries to refute each finding

# budget_usd_month: 5    # monthly cap on this machine: once reached, reviews run with rules only

gate: major              # tollbar review --gate: exit 2 if something major or worse shows up
min_severity: minor      # anything below is not shown
max_findings: 7          # cap on minor issues (serious ones are always shown)

ignore:
  - "assets/**"

disabled_rules: []       # e.g. [debug-print]

# Files with project rules the AI must follow
rules_files:
  - CLAUDE.md
  - AGENTS.md
  - .tollbar/rules.md

learnings_file: .tollbar/learnings.md
check_registry: true     # look up imported packages on npm to catch invented names

Note that this template lists three rules files; without rules_files, tollbar reads five (see Project rules).Ojo: esta plantilla lista tres archivos de reglas; sin rules_files, tollbar lee cinco (mirá Archivos de reglas del proyecto).

All the keysTodas las claves#

KeyClaveDefaultPor defectoWhat it doesQué hace
profile(none)(ninguno)personal, work or ci. Written by tollbar setup; shown by status.personal, work o ci. Lo escribe tollbar setup y lo muestra status.
ai.providerdetecteddetectadoSee Choosing your AI.Mirá Elegir tu IA.
ai.modelsonnet (claude-cli), claude-opus-5-5 (anthropic)Required for openai, openrouter, gemini, ollama, openai-compatible.Obligatorio para openai, openrouter, gemini, ollama, openai-compatible.
ai.commandFor cli: the command to run.Para cli: el comando a correr.
ai.api_key_envthe provider's usual variablela variable de siempre del proveedorThe name of the variable holding the key.El nombre de la variable con la clave.
ai.base_urlthe provider's official URLla URL oficial del proveedorRequired for openai-compatible.Obligatoria para openai-compatible.
ai.efforthigh (anthropic)low, medium, high, xhigh, max.
ai.verifytrueThe skeptic pass.La pasada escéptica.
ai.timeout_seconds300Per AI call.Por cada llamada a la IA.
ai.fallbackstrueAnthropic: let the server retry on another model if one declines.Anthropic: que el servidor reintente con otro modelo si uno se niega.
ai.price{ input: 3, output: 15 }: US$ per million tokens, for estimates and the budget.{ input: 3, output: 15 }: US$ por millón de tokens, para las estimaciones y el tope.
budget_usd_monthno capsin topeMonthly cap in US$ on this machine.Tope mensual en US$ en esta máquina.
gatenoneDefault for tollbar review (exit 2 at this level or worse). The hooks always use major.El de por defecto para tollbar review (sale con 2 en ese nivel o peor). Los hooks siempre usan major.
require_aifalsetrue works like --require-ai.true funciona igual que --require-ai.
min_severityminorHide anything below this level.Oculta lo que esté debajo de ese nivel.
max_findings7Cap on minor findings shown (serious ones always show).Tope de detalles menores a mostrar (lo grave se muestra siempre).
ignoresee belowmirá abajoExtra file globs to skip. Added to the defaults.Globs extra de archivos a saltear. Se suman a los de siempre.
disabled_rules[]Rule ids to turn off.Ids de reglas a apagar.
rules_filesfive files, see belowcinco archivos, mirá abajoProject rules the AI must follow. Must be inside the repo.Reglas del proyecto que la IA tiene que respetar. Tienen que estar adentro del repo.
learnings_file.tollbar/learnings.mdWhere false alarms are recorded. Must be inside the repo.Dónde se anotan las falsas alarmas. Tiene que estar adentro del repo.
learningsrepolocal keeps them in .git/tollbar/learnings.md of each clone.local las guarda en .git/tollbar/learnings.md de cada clon.
check_registrytrueLook up imported package names on the public npm registry.Consulta los nombres de los paquetes importados en el registro público de npm.
hooks.pre_push, hooks.claude_stopai, rules or off: what tollbar setup suggests in each repo. They don't install anything by themselves.ai, rules u off: lo que tollbar setup propone en cada repo. Por sí solas no instalan nada.

Always ignored: package-lock.json, yarn.lock, pnpm-lock.yaml, composer.lock, bun.lockb, *.lock, *.min.js, *.min.css, *.map, *.snap, node_modules/**, vendor/**, dist/**, build/**, .next/**, .astro/**, coverage/**.Siempre se ignoran: package-lock.json, yarn.lock, pnpm-lock.yaml, composer.lock, bun.lockb, *.lock, *.min.js, *.min.css, *.map, *.snap, node_modules/**, vendor/**, dist/**, build/**, .next/**, .astro/**, coverage/**.

Globs: ** is any depth, * is anything inside one folder name, ? is one character. A pattern without / matches the file name in any folder. Case doesn't matter.Globs: ** es cualquier profundidad, * es cualquier cosa dentro del nombre de una carpeta, ? es un carácter. Un patrón sin / compara contra el nombre del archivo en cualquier carpeta. No distingue mayúsculas de minúsculas.

ProfilesPerfiles#

personalworkwork (trabajo)ci (GitHub only)ci (solo GitHub)
Personal settings fileArchivo de configuración personalyessíyessíyessí
check_registrytrue, unless you set it to false yourselftrue, salvo que vos lo hayas puesto en falsefalse: package names never leave the machinefalse: los nombres de paquetes no salen de la máquinasame as personaligual que personal
learningsrepo, unless you set it to local yourselfrepo, salvo que vos lo hayas puesto en locallocal: inside .gitlocal: adentro de .gitsame as personaligual que personal
Claude Code hook goes toEl hook de Claude Code va en.claude/settings.json (or --local).claude/settings.json (o --local)always .claude/settings.local.json, plus an entry in .git/info/exclude so git ignores itsiempre .claude/settings.local.json, más una línea en .git/info/exclude para que git lo ignorenot installedno se instala
pre-push hookHook pre-push.git/hooks/pre-push.git/hooks/pre-pushnot installedno se instala
Adds a file to the repoAgrega un archivo al repono (unless you commit .claude/settings.json)no (salvo que commitees .claude/settings.json)no.github/workflows/tollbar.yml, which you commit.github/workflows/tollbar.yml, que commiteás vos
ai sectionSección aiyour choicela que elijasyour choicela que elijasleft as it is (on GitHub the AI comes from the secret)queda como está (en GitHub la IA sale del secreto)

Switching from work back to personal turns check_registry back on and moves learnings back to the repo file.Si pasás de work a personal, check_registry vuelve a prenderse y los aprendizajes vuelven al archivo del repo.

Trust: what a repo's file can and can't doConfianza: qué puede y qué no puede el archivo de un repo#

A .tollbar.yml arrives with the code. In a repo you just cloned, it could try to run a command on your machine or send your API key somewhere else. So, outside CI, until you trust it, tollbar doesn't apply these from a repo's file:Un .tollbar.yml llega con el código. En un repo que acabás de clonar, podría intentar ejecutar un comando en tu máquina o mandar tu API key a otro lado. Por eso, fuera de CI y hasta que confíes en él, tollbar no aplica esto del archivo de un repo:

  • ai.command, ai.base_url, ai.api_key_env;
  • ai.provider, when it isn't the one you chose: the provider decides where your code goes (its model and effort are dropped with it);ai.provider, cuando no es el que elegiste vos: el proveedor decide a dónde va tu código (su modelo y su effort se descartan con él);
  • check_registry: true when your personal settings say false;check_registry: true cuando tu configuración personal dice false;
  • moving learnings back into the repo when your personal settings say learnings: local.volver a meter los aprendizajes en el repo cuando tu configuración personal dice learnings: local.

Everything else in the file applies, including another model for your own provider. Files it points at (rules_files, learnings_file) must be inside the repo.Todo lo demás del archivo se aplica, incluido otro modelo para tu mismo proveedor. Los archivos a los que apunta (rules_files, learnings_file) tienen que estar adentro del repo.

You're told when something is skipped:Cuando algo se saltea, te avisa:

$ cat .tollbar.yml
ai:
  provider: cli
  command: "codex exec"
gate: major
$ tollbar review --no-ai
...
no AI (rules only) · 0.1 s
This repo's .tollbar.yml asks for ai.command, ai.provider: cli. Not applied: that can run commands, send your code to another AI or your keys elsewhere, and this repo isn't marked as trusted. If it's yours or you trust it: tollbar trust

If the repo is yours, or you trust it:Si el repo es tuyo, o confiás en él:

$ tollbar trust
Trusting this repo's .tollbar.yml as it is now. If it changes, you'll be asked again.
$ tollbar status
tollbar 0.3.2 · profile: not chosen
Config      ~/.tollbar/config.yml   (missing: tollbar setup creates it)
            .tollbar.yml in the repo: trusted (tollbar trust)
AI          cli · can't find "codex"   [--check to test it]

Trust is for the file's exact content. When someone edits it, the limits come back until you trust it again:La confianza es para el contenido exacto del archivo. Cuando alguien lo edita, los límites vuelven hasta que confíes de nuevo:

$ (someone edits .tollbar.yml)
Config      ~/.tollbar/config.yml   (missing: tollbar setup creates it)
            .tollbar.yml in the repo: not trusted (it can't pick the AI or turn npm back on)
            This repo's .tollbar.yml asks for ai.command, ai.provider: cli. Not applied: that can run commands, send your code to another AI or your keys elsewhere, and this repo isn't marked as trusted. If it's yours or you trust it: tollbar trust
$ tollbar trust --revoke
Done: this repo is no longer trusted.

Trusted repos are kept in ~/.tollbar/trusted.json (or the file in TOLLBAR_TRUST_FILE). In GitHub Actions, the repo's file always applies in full.Los repos de confianza se guardan en ~/.tollbar/trusted.json (o en el archivo de TOLLBAR_TRUST_FILE). En GitHub Actions, el archivo del repo siempre vale entero.

Project rules filesArchivos de reglas del proyecto#

The AI reads your project's own rules and follows them. By default:La IA lee las reglas propias de tu proyecto y las respeta. Por defecto:

  • CLAUDE.md
  • AGENTS.md
  • .cursorrules
  • .github/copilot-instructions.md
  • .tollbar/rules.md

Up to 8,000 characters of each go to the AI with every review (secrets masked). .tollbar/rules.md is the place for review-only notes, such as "money is always in cents" or "every admin page must check manage_options". Change the list with rules_files:.De cada uno van a la IA hasta 8.000 caracteres en cada revisión (con los secretos tapados). .tollbar/rules.md es el lugar para notas solo para la revisión, como "la plata siempre va en centavos" o "toda página de admin chequea manage_options". Cambiá la lista con rules_files:.

Environment variablesVariables de entorno#

VariableWhat it doesQué hace
TOLLBAR_CONFIGPath to the personal settings file.Ruta del archivo de configuración personal.
TOLLBAR_TRUST_FILEPath to the list of trusted repos.Ruta de la lista de repos de confianza.
TOLLBAR_USAGE_FILEPath to the monthly spend file.Ruta del archivo de gasto mensual.
TOLLBAR_DEBUGA file where every AI prompt and answer is saved.Un archivo donde se guarda cada prompt y cada respuesta de la IA.
TOLLBAR_HOOK_LOGA file where the Claude Code hook logs what it receives.Un archivo donde el hook de Claude Code anota lo que recibe.
TOLLBAR_TELEGRAM_TOKEN, TOLLBAR_TELEGRAM_CHATFor --notify.Para --notify.
NO_COLORNo colors in the terminal.Sin colores en la terminal.
ANTHROPIC_API_KEY, OPENAI_API_KEY, OPENROUTER_API_KEY, GEMINI_API_KEYThe providers' usual key variables.Las variables de clave de siempre de cada proveedor.
CLAUDE_CONFIG_DIRWhere tollbar looks for Claude Code's settings.json (default ~/.claude).Dónde busca tollbar el settings.json de Claude Code (por defecto ~/.claude).

Files tollbar writesArchivos que escribe tollbar#

FileArchivoWhatQuéCommitted?¿Se commitea?
~/.tollbar/config.ymlPersonal settingsConfiguración personalNo (outside repos)No (está fuera de los repos)
~/.tollbar/trusted.jsonTrusted reposRepos de confianzaNo
~/.tollbar/usage.jsonSpend per monthGasto por mesNo
.git/tollbar/last-review.jsonThe last review, for tollbar ignore <n>La última revisión, para tollbar ignore <n>No (inside .git)No (está adentro de .git)
.git/tollbar/history.jsonlOne line per review, for stats and statusUna línea por revisión, para stats y statusNo
.git/tollbar/learnings.mdLearnings with learnings: localAprendizajes con learnings: localNo
refs/tollbar/last-deployThe deploy mark (a git ref)La marca de deploy (una referencia de git)Not pushedNo se pushea
.tollbar/learnings.mdLearningsAprendizajesYes, if you commit itSí, si lo commiteás
.git/hooks/pre-pushThe pre-push hookEl hook pre-pushNo
.claude/settings.json / .claude/settings.local.jsonThe Claude Code hookEl hook de Claude Codesettings.json only if you commit itsettings.json solo si lo commiteás

Rule catalogCatálogo de reglas#

Rules look only at lines that were added or changed. A few also read the whole new file to decide (for example, "does this file check a nonce anywhere?"). Each line rule reports at most three hits per file. Security rules skip test files, because those are full of sample attacks (secrets are still checked there).Las reglas miran solo las líneas agregadas o cambiadas. Algunas además leen el archivo nuevo entero para decidir (por ejemplo, "¿este archivo chequea un nonce en algún lado?"). Cada regla de línea marca como mucho tres casos por archivo. Las reglas de seguridad no corren en archivos de tests, porque están llenos de ataques de ejemplo (los secretos sí se buscan ahí).

"JS/TS" means .js .mjs .cjs .jsx .ts .mts .cts .tsx .vue .svelte .astro. "PHP" means .php .phtml .inc. Test files are those under test/, tests/, __tests__/ or spec/, or named like *.test.js, *.spec.ts, test_*.py."JS/TS" quiere decir .js .mjs .cjs .jsx .ts .mts .cts .tsx .vue .svelte .astro. "PHP" quiere decir .php .phtml .inc. Los archivos de tests son los que están en test/, tests/, __tests__/ o spec/, o se llaman como *.test.js, *.spec.ts, test_*.py.

Rule idId de la reglaWhat it catchesQué detectaSeveritySeveridadFilesArchivos
secretKeys with a known format: Anthropic, OpenAI, AWS, GitHub, Stripe live, Google, Telegram bot, Slack, private key blocksClaves con formato conocido: Anthropic, OpenAI, AWS, GitHub, Stripe live, Google, bot de Telegram, Slack, bloques de clave privadacriticalAll, except *.example, *.sample, *.template, *.distTodos, salvo *.example, *.sample, *.template, *.dist
secretA password, secret, API key or token written as a literal (8+ characters, not a placeholder or an env lookup)Una contraseña, secreto, API key o token escrito como texto fijo (8 caracteres o más, que no sea un placeholder ni una lectura de variable de entorno)majorSameIgual
sensitive-fileA new .env file (not .env.example, .sample, .template, .dist)Un archivo .env nuevo (no .env.example, .sample, .template, .dist)criticalAnyCualquiera
sensitive-fileA new private key or credentials file: id_rsa*, id_ed25519*, id_ecdsa*, .pem, .key, .p12, .pfx, .jks, .keystore, .htpasswdUna clave privada o archivo de credenciales nuevo: id_rsa*, id_ed25519*, id_ecdsa*, .pem, .key, .p12, .pfx, .jks, .keystore, .htpasswdcriticalAnyCualquiera
sensitive-fileA new database dump or backup: .sql, .sql.gz, .dump, .bak, .backupUn dump o backup de base de datos nuevo: .sql, .sql.gz, .dump, .bak, .backupmajorAnyCualquiera
sensitive-filewp-config.php changed (not with --all)Cambió wp-config.php (no con --all)majorWordPress
sensitive-file.htaccess changed (not with --all)Cambió .htaccess (no con --all)minorApache
sensitive-fileA new .log fileUn archivo .log nuevominorAnyCualquiera
phantom-importImports a package that isn't in package.json and doesn't exist on npmImporta un paquete que no está en package.json y no existe en npmcriticalJS/TS (needs a package.json)JS/TS (necesita un package.json)
undeclared-importImports a package that isn't in package.json (it exists, or npm wasn't checked)Importa un paquete que no está en package.json (existe, o no se consultó npm)majorJS/TS
ai-truncatedComments like // ... rest of the code, # ... existing code, <!-- ... unchanged --> (English and Spanish)Comentarios como // ... rest of the code, # ... código existente, <!-- ... sin cambios --> (en inglés y en español)majorAnyCualquiera
ai-not-implementedthrow new Error("not implemented"), raise NotImplementedError, PHP throw new Exception("TODO")throw new Error("not implemented"), raise NotImplementedError, throw new Exception("TODO") en PHPmajorAny, not testsCualquiera, menos tests
ai-placeholderComments like "implement later", "replace with real", "placeholder", "mock data", "hardcoded for now"Comentarios como "implementar después", "reemplazar por el real", "placeholder", "datos de prueba", "por ahora hardcode"minorAny, not testsCualquiera, menos tests
lorem-ipsumLorem ipsum filler textTexto de relleno lorem ipsumminorAny, not testsCualquiera, menos tests
empty-catchcatch (e) {}minorAnyCualquiera
empty-exceptexcept: passminorPython
debug-wpdefine('WP_DEBUG', true) or WP_DEBUG_DISPLAY ondefine('WP_DEBUG', true) o WP_DEBUG_DISPLAY prendidomajorAnyCualquiera
debug-phpini_set('display_errors', 1), APP_DEBUG=truemajorAnyCualquiera
debug-jsA debugger statementUna sentencia debuggermajorJS/TS
debug-printvar_dump, print_r, var_export, dd, dump at the start of a linevar_dump, print_r, var_export, dd, dump al principio de una líneaminorPHP, not testsPHP, menos tests
wp-sql-injection$wpdb->query/get_results/get_row/get_var/get_col with a variable in the SQL, without prepare$wpdb->query/get_results/get_row/get_var/get_col con una variable en el SQL, sin preparecriticalPHP
wp-prepare-interpolated$wpdb->prepare("... $var ..."): the variable inside the SQL text$wpdb->prepare("... $var ..."): la variable adentro del texto SQLcriticalPHP
php-sql-injectionmysqli_query, ->query, mysql_query, pg_query with $_GET, $_POST, $_REQUEST or $_COOKIE in the callmysqli_query, ->query, mysql_query, pg_query con $_GET, $_POST, $_REQUEST o $_COOKIE en la llamadacriticalPHP
php-xssecho, print or <?= of request data or $_SERVER values like PHP_SELF, without escapingecho, print o <?= de datos del pedido o de valores de $_SERVER como PHP_SELF, sin escaparcriticalPHP
php-code-execeval/assert/create_function with a variable, shell functions with a variable, backticks with request data, eval(base64_decode(...))eval/assert/create_function con una variable, funciones de shell con una variable, backticks con datos del pedido, eval(base64_decode(...))criticalPHP
php-file-includeinclude/require with request datainclude/require con datos del pedidocriticalPHP
php-unserializeunserialize() of request dataunserialize() de datos del pedidocriticalPHP
php-extract-inputextract() of request dataextract() de datos del pedidocriticalPHP
php-ssrf-lfifile_get_contents, fopen, readfile, file, curl_init, wp_remote_get/post, simplexml_load_file, unlink with request datafile_get_contents, fopen, readfile, file, curl_init, wp_remote_get/post, simplexml_load_file, unlink con datos del pedidocriticalPHP
wp-missing-nonceReads $_POST[...] in a WordPress file that never checks a nonceLee $_POST[...] en un archivo de WordPress que nunca chequea un noncemajorPHP
wp-ajax-nopriv-no-nonceA public wp_ajax_nopriv_ action in a file that never checks a nonceUna acción pública wp_ajax_nopriv_ en un archivo que nunca chequea un noncemajorPHP
wp-admin-no-capabilityA wp_ajax_ or admin_post_ action in a file that never calls current_user_can()Una acción wp_ajax_ o admin_post_ en un archivo que nunca llama a current_user_can()majorPHP
wp-rest-openA REST route with 'permission_callback' => '__return_true'Una ruta REST con 'permission_callback' => '__return_true'majorPHP
php-option-rawupdate_option, add_option, update_post_meta, update_user_meta with unsanitized request dataupdate_option, add_option, update_post_meta, update_user_meta con datos del pedido sin sanitizarmajorPHP
php-upload-uncheckedmove_uploaded_file() in a file that never checks the file typemove_uploaded_file() en un archivo que nunca chequea el tipo de archivomajorPHP
php-open-redirectheader('Location: ...') or wp_redirect() with request dataheader('Location: ...') o wp_redirect() con datos del pedidomajorPHP
php-weak-password-hashmd5, sha1 or crc32 of a password variablemd5, sha1 o crc32 de una variable de contraseñamajorPHP
php-loose-secret-compareA token, secret, hash or password compared with == or !=Un token, secreto, hash o contraseña comparado con == o !=minorPHP
wp-direct-accessA new PHP file in a WordPress plugin or theme without the ABSPATH checkUn archivo PHP nuevo en un plugin o theme de WordPress sin el chequeo de ABSPATHminorPHP
tls-verify-offSSL certificate checks turned off: sslverify => false, CURLOPT_SSL_VERIFYPEER 0, rejectUnauthorized: false, NODE_TLS_REJECT_UNAUTHORIZED=0, verify=FalseSe apagó la verificación del certificado SSL: sslverify => false, CURLOPT_SSL_VERIFYPEER 0, rejectUnauthorized: false, NODE_TLS_REJECT_UNAUTHORIZED=0, verify=FalsemajorAnyCualquiera
js-inner-htmlinnerHTML or outerHTML set from anything but a fixed stringinnerHTML u outerHTML asignado con algo que no es un texto fijomajorJS/TS
js-evaleval( or new Function(eval( o new Function(majorJS/TS
test-no-assertA test file that defines tests but has no expect, assert, should... anywhereUn archivo de tests que define tests pero no tiene ningún expect, assert, should...majorTest filesArchivos de tests

To turn a rule off, put its id in disabled_rules. Turning off phantom-import also turns off undeclared-import (they're one check).Para apagar una regla, poné su id en disabled_rules. Apagar phantom-import también apaga undeclared-import (son un mismo chequeo).

Does it help? Measuring¿Sirve? Medilo#

tollbar stats#

What it's for: of everything tollbar flagged in this clone, how much got fixed and how much was a false alarm.Para qué sirve: de todo lo que marcó tollbar en este clon, cuánto se arregló y cuánto fue falsa alarma.

$ tollbar stats
tollbar stats · 3 reviews (2026-12-03 to 2026-12-03)

With AI: 0 · from the Claude Code hook: 1 · blocked: 1
Average time: 0.2 s · total reported cost: US$0.00

7 distinct findings:
  fixed (the flagged line is gone):        2
  false alarms (in learnings.md):           1
  still there:                              4

Acceptance (fixed / fixed + false alarms): 67%  — goal: over 50%
  rules: 67% of 7 findings

Rules that fire most:
  php-sql-injection            1
  php-xss                      1
  secret                       1
  phantom-import               1
  js-inner-html                1
  ai-truncated                 1
  test-no-assert               1  (1 false alarms)

How it decides, from the files as they are now:Cómo decide, mirando los archivos como están ahora:

  • fixed: the flagged code is no longer there;arreglado: el código marcado ya no está;
  • false alarm: it's in your learnings;falsa alarma: está en tus aprendizajes;
  • still there: the flagged code is still in the file.sigue ahí: el código marcado sigue en el archivo.

"Fixed" really means "the line is gone", which could also be a rewrite for other reasons. It counts reviews from the terminal and the hooks in this clone (.git/tollbar/history.jsonl), not GitHub Actions runs. With no history yet: No reviews in this repo yet. Run "tollbar review" and come back."Arreglado" en realidad quiere decir "la línea ya no está", que también puede ser una reescritura por otros motivos. Cuenta las revisiones de la terminal y de los hooks en este clon (.git/tollbar/history.jsonl), no las de GitHub Actions. Sin historial todavía: No reviews in this repo yet. Run "tollbar review" and come back.

tollbar eval#

What it's for: a rough answer to "would tollbar have caught the bugs I already fixed?", using your own history.Para qué sirve: una respuesta aproximada a "¿tollbar habría visto los bugs que ya arreglé?", usando tu propio historial.

For each commit whose message looks like a fix (fix, fixes, fixed, bug, bugfix, hotfix, revert, arregl..., corrig..., soluciona):Para cada commit cuyo mensaje parece un arreglo (fix, fixes, fixed, bug, bugfix, hotfix, revert, arregl..., corrig..., soluciona):

  1. git blame finds the commit that wrote the lines the fix changed;git blame encuentra el commit que escribió las líneas que cambió el arreglo;
  2. tollbar reviews that commit as if it were new;tollbar revisa ese commit como si fuera nuevo;
  3. it checks whether any finding landed within 3 lines of them.se fija si algún hallazgo cayó a 3 líneas o menos de ellas.
$ tollbar eval --no-ai
Reviewing 238c38e (it introduced what a7e9657 fixed: "fix: discount took 15 as 1500%")…
Reviewing 0d0dea5 (it introduced what ad8775b fixed: "Fix SQL injection in order lookup")…
tollbar eval · real bugs from this repo ("fix" commits) · rules only

· b2a4149 "Fix year on the about page"
    skipped: doesn't touch code
✘ a7e9657 "fix: discount took 15 as 1500%"
    introduced by 238c38e in includes/discounts.php:6
    tollbar flagged nothing on those lines
✔ ad8775b "Fix SQL injection in order lookup"
    introduced by 0d0dea5 in includes/orders.php:6
    tollbar flagged it: [critical] SQL query built with variables (SQL injection) (rule, line 6)

Recall: 1/2 (50%) · 0 AI calls · cost ~US$0.00
Careful: many "fix" commits fix things no review can see (copy, design, data). Read the ✘ one by one before drawing conclusions.

Here the rules caught the SQL injection but not the discount bug, which needs the AI (it's the same kind of bug the AI example caught).Acá las reglas agarraron la inyección SQL pero no el bug del descuento, que necesita la IA (es el mismo tipo de bug que agarró el ejemplo con IA).

  • --limit <n> evaluates up to n fixes (default 10). Each one may cost a review with AI; --no-ai is free.--limit <n> evalúa hasta n arreglos (por defecto 10). Cada uno puede costar una revisión con IA; --no-ai es gratis.
  • It skips fixes that don't touch code, bugs that came in the repo's first commit, and introducing commits over 3,000 lines.Saltea los arreglos que no tocan código, los bugs que vinieron en el primer commit del repo, y los commits de origen de más de 3.000 líneas.

What eval can't tell you:Lo que eval no te puede decir:

  • How many false alarms tollbar raises (that's stats).Cuántas falsas alarmas tira tollbar (para eso está stats).
  • Bugs nobody fixed yet, or fixes whose message doesn't say "fix".Los bugs que nadie arregló todavía, o los arreglos cuyo mensaje no dice "fix".
  • Anything solid from a handful of cases.Nada firme a partir de un puñado de casos.

Many "fix" commits are about copy, design or data, which no code review can see. One data point from the author: on one real repo, eval caught 2 of 8 past fixes, and most of the misses were visual or content fixes. Read the ✘ lines one by one.Muchos commits "fix" son de textos, diseño o datos, y eso no lo ve ningún review de código. Un dato del autor: en un repo real, eval agarró 2 de 8 arreglos pasados, y la mayoría de los que se le escaparon eran arreglos visuales o de contenido. Mirá las líneas ✘ una por una.

At work, local only, and letting an agent set it upEn el trabajo, solo local, y que lo configure un agente#

The situationLa situación#

Your company's GitHub (or GitLab) can't be connected to outside tools, or you'd rather not add anything to the team's repos. tollbar still works: it runs on your machine, against your local clone, and never talks to the remote.El GitHub (o GitLab) de tu empresa no se puede conectar a herramientas de afuera, o preferís no agregar nada a los repos del equipo. tollbar igual funciona: corre en tu máquina, sobre tu clon local, y nunca habla con el remoto.

tollbar setup                       # answer "On my work machine"
tollbar status                      # check what got installed
tollbar review --base origin/main   # what your branch adds, like a PR review

Or without questions:O sin preguntas:

$ tollbar setup --print --profile work --hooks pre-push:ai,claude-stop:rules

Here's what I'll do:
  write    ~/.tollbar/config.yml  (profile: work)
           AI: claude-cli (sonnet) · doesn't query npm · false alarms kept out of the repo
  install  .git\hooks\pre-push                              (this clone, never committed) · with AI
  install  .claude\settings.local.json                      (ignored by git) · Claude Code, rules only
  add      .claude/settings.local.json → .git\info\exclude  (so git ignores it, without touching .gitignore)

(--print: nothing was written. To do it, run the same command with --yes and without --print.)

After --yes:Después de --yes:

$ tollbar status
tollbar 0.3.2 · profile: work
Config      ~/.tollbar/config.yml
            repo's .tollbar.yml: none
AI          claude-cli (sonnet) · Claude Code 2.1.292 found   [--check to test it]
Privacy     code only goes to: Claude Code, with whatever account it's logged into (or your company's gateway)
            public npm: not queried · false alarms: inside .git (out of the repo)
Gate        none: tollbar review never fails by itself (use --gate) · hooks stop major or worse
This repo   ~\work\acme-portal
            pre-push          on, with AI      (.git\hooks\pre-push, never committed)
            Claude Code Stop  on, rules only   (.claude\settings.local.json, ignored by git)
            deploy marked     no (tollbar mark-deploy after deploying)
Spend       US$0.00 this month on this machine · no cap
To change something: tollbar setup

What the work profile does:Qué hace el perfil de trabajo:

  • Settings: in ~/.tollbar/config.yml, outside every repo.Configuración: en ~/.tollbar/config.yml, fuera de todos los repos.
  • Before every push: a hook in .git/hooks/pre-push, which belongs to your clone and is never committed. If the repo uses core.hooksPath (husky), setup asks first. It never overwrites a hook that isn't tollbar's.Antes de cada push: un hook en .git/hooks/pre-push, que es de tu clon y nunca se commitea. Si el repo usa core.hooksPath (husky), setup te pregunta antes. Nunca pisa un hook que no sea de tollbar.
  • When Claude Code finishes: the hook goes in .claude/settings.local.json, and setup makes git ignore it through .git/info/exclude, without touching .gitignore. Check it with git check-ignore -q .claude/settings.local.json && echo ignored.Cuando Claude Code termina: el hook va en .claude/settings.local.json, y setup hace que git lo ignore a través de .git/info/exclude, sin tocar el .gitignore. Comprobalo con git check-ignore -q .claude/settings.local.json && echo ignored.
  • Internal package names stay inside: check_registry: false, so imports are never looked up on the public npm registry.Los nombres de paquetes internos no salen: check_registry: false, así que los imports nunca se consultan en el registro público de npm.
  • False alarms you mark with tollbar ignore stay inside .git (learnings: local).Las falsas alarmas que marcás con tollbar ignore quedan adentro de .git (learnings: local).
  • The AI: with claude-cli, your code goes to Claude through Claude Code, using your company account or your company's Bedrock, Vertex or gateway setup (see Company setups).La IA: con claude-cli, tu código va a Claude a través de Claude Code, con la cuenta de tu empresa o con su configuración de Bedrock, Vertex o gateway (mirá En empresas).
  • Skip the check once: git push --no-verify.Saltear el chequeo una vez: git push --no-verify.
  • Take it out: tollbar hook uninstall --git and tollbar hook uninstall --local. Only tollbar's own hooks are removed.Sacarlo: tollbar hook uninstall --git y tollbar hook uninstall --local. Solo se sacan los hooks de tollbar.

Let your coding agent set it upQue lo configure tu agente#

Paste this into Claude Code (or another agent):Pegale esto a Claude Code (o a otro agente):

Install and set up tollbar on this machine following https://ernestojost.github.io/tollbar/setup.md and turn it on in this repo.Instalá y configurá tollbar en esta PC siguiendo https://ernestojost.github.io/tollbar/setup.md y activalo en este repo.

The agent follows docs/setup.md, which tells it to:El agente sigue docs/setup.md, que le indica:

  1. check Node.js 20+, git and Claude Code;chequear Node.js 20+, git y Claude Code;
  2. install the npm package (and stop and show you the error if the install fails, for example because of a company proxy or npm mirror);instalar el paquete de npm (y si la instalación falla, por ejemplo por un proxy o un mirror de npm de la empresa, frenar y mostrarte el error);
  3. ask you two questions: where you'll use it, and when it should review;hacerte dos preguntas: dónde lo vas a usar y cuándo tiene que revisar;
  4. show you the plan with tollbar setup --print ..., and apply it with --yes only after you agree;mostrarte el plan con tollbar setup --print ..., y aplicarlo con --yes solo después de que digas que sí;
  5. check with tollbar status, and run tollbar status --check only if you say yes (it spends a few tokens);comprobar con tollbar status, y correr tollbar status --check solo si le decís que sí (gasta unos pocos tokens);
  6. run a first, read-only tollbar review;hacer una primera tollbar review, que no modifica nada;
  7. tell you what was installed, how to skip it once, how to mark a false alarm, and how to take it out.contarte qué se instaló, cómo saltearlo una vez, cómo marcar una falsa alarma y cómo sacarlo.

It's told to keep everything local, never commit to your repos, never put keys in files or commands, and never work around company blocks.Tiene indicado dejar todo local, no commitear nada en tus repos, no poner claves en archivos ni en comandos, y no esquivar bloqueos de la empresa.

Privacy and securityPrivacidad y seguridad#

What leaves your machine, and whereQué sale de tu máquina, y adónde#

WhatQuéGoes toVa aWhenCuándoTo turn it offPara apagarlo
The diff, the changed files (whole if small, otherwise the parts around the changes), lines where changed functions are used, your project rules files, your learnings, commit messages, rule finding titlesEl diff, los archivos que cambiaron (enteros si son chicos, si no las partes alrededor de los cambios), las líneas donde se usan las funciones tocadas, tus archivos de reglas del proyecto, tus aprendizajes, los mensajes de commit, los títulos de los hallazgos de reglasThe AI you chose (or your own machine with Ollama)La IA que elegiste (o tu propia máquina, con Ollama)Every review with AIEn cada revisión con IA--no-ai, or provider: none--no-ai, o provider: none
Names of imported npm packages that aren't in package.jsonNombres de paquetes de npm importados que no están en package.jsonregistry.npmjs.orgReviews that touch JS/TS importsEn revisiones que tocan imports de JS/TScheck_registry: false, --offline, or the work profilecheck_registry: false, --offline, o el perfil work
Comments, and learning commits from repliesComentarios, y commits de aprendizajes por respuestasThe GitHub APILa API de GitHubOnly tollbar github, inside ActionsSolo tollbar github, adentro de ActionsDon't use the ActionNo usar la Action
Titles and places of findings (no code)Títulos y lugares de los hallazgos (sin código)TelegramOnly with --notifySolo con --notifyDon't pass --notifyNo pasar --notify
The list of repo files, to hash on the serverLa lista de archivos del repo, para calcular hashes en el servidorYour server, over SSHTu servidor, por SSHOnly tollbar driftSolo tollbar driftDon't run itNo correrlo

Nothing else. No telemetry, no account, no tollbar server.Nada más. Sin telemetría, sin cuenta, sin servidor de tollbar.

What protects youQué te protege#

  • Secrets are masked before anything goes to the AI, and in what tollbar prints ([REDACTED]). Suggestions that would contain a masked secret are dropped.Los secretos se tapan antes de mandar cualquier cosa a la IA, y en lo que imprime tollbar ([REDACTED]). Las sugerencias que tendrían un secreto tapado se descartan.
  • The Claude Code call is locked down: no tools (it can't read files or run commands), none of your hooks, plugins or MCP servers, no slash commands, no saved session, and it runs from the system's temp folder.La llamada a Claude Code va encerrada: sin herramientas (no puede leer archivos ni ejecutar comandos), sin tus hooks, plugins ni servidores MCP, sin comandos de barra, sin guardar la sesión, y corre desde la carpeta temporal del sistema.
  • The diff is data, not instructions. The AI is told to ignore orders inside the code it reviews and to report them as a security problem.El diff es un dato, no una orden. A la IA se le dice que ignore las instrucciones que aparezcan adentro del código que revisa y que las reporte como problema de seguridad.
  • A cloned repo can't run commands or redirect your keys through its .tollbar.yml until you trust it, and trust ends when the file changes.Un repo clonado no puede ejecutar comandos ni desviar tus claves con su .tollbar.yml hasta que confíes en él, y la confianza se termina cuando el archivo cambia.
  • On GitHub: pull_request_target is refused; fork PRs get rules only; only people with write access can teach tollbar to ignore something.En GitHub: pull_request_target se rechaza; los PRs desde forks van solo con reglas; solo la gente con permiso de escritura puede enseñarle a tollbar a ignorar algo.
  • Hooks never overwrite a hook that isn't tollbar's, and uninstall removes only tollbar's entries.Los hooks nunca pisan un hook que no es de tollbar, y al desinstalar se saca solo lo de tollbar.

Troubleshooting and FAQProblemas y preguntas frecuentes#

The last line says "no AI (rules only)". Why? One of these:La última línea dice "no AI (rules only)". ¿Por qué? Alguna de estas:

  • You passed --no-ai.Pasaste --no-ai.
  • No AI was found or configured: tollbar status shows which one applies and whether it was found.No hay IA encontrada ni configurada: tollbar status te dice cuál vale y si la encontró.
  • The monthly cap was reached (a yellow note says so).Se llegó al tope mensual (una nota amarilla lo dice).
  • The AI failed: a Warning: the AI failed (...) line says why.La IA falló: una línea Warning: the AI failed (...) dice por qué.
  • Everything that changed was in ignored files.Todo lo que cambió estaba en archivos ignorados.

The AI didn't answer, or failed. The review still finishes with rules, and tells you:La IA no respondió, o falló. La revisión igual termina con las reglas, y te avisa:

Warning: the AI failed (The variable OPENAI_API_KEY is empty: it must hold your openai API key.). What it didn't review was checked with rules only.
Warning: the AI failed (Couldn't connect to http://localhost:11434/v1: fetch failed (is "ollama serve" running?)). What it didn't review was checked with rules only.

Then:Después:

  1. Run tollbar status --check to test with one short call.Corré tollbar status --check para probar con una llamada corta.
  2. With Claude Code, try claude -p "reply with ok". If that fails too, log in by running claude, or your company may not allow non-interactive use.Con Claude Code, probá claude -p "reply with ok". Si eso también falla, logueate corriendo claude, o puede que tu empresa no permita usarlo sin interacción.
  3. Slow model? Raise ai.timeout_seconds (default 300).¿Modelo lento? Subí ai.timeout_seconds (por defecto 300).
  4. Run with TOLLBAR_DEBUG=debug.txt to save every prompt and answer.Corré con TOLLBAR_DEBUG=debug.txt para guardar cada prompt y cada respuesta.

A settings error stops everything. Problems in the settings themselves stop the command with exit code 1, for example:Un error de configuración frena todo. Los problemas en la configuración misma cortan el comando con código 1, por ejemplo:

tollbar: With provider "ollama" you need to choose the model in ai.model.

"Monthly cap of US$5 reached". Raise budget_usd_month, remove it, or wait for next month. Spend is kept in ~/.tollbar/usage.json."Monthly cap of US$5 reached". Subí budget_usd_month, sacalo, o esperá al mes que viene. Lo gastado se guarda en ~/.tollbar/usage.json.

A big change only got rules for some files. AI reviews are split in parts of about 60,000 tokens, up to 6 parts. Beyond that, the rest gets rules only, and tollbar says: The change is very large: N files get no AI review (rules only). Very long lines are clipped, and new untracked files over 512 KB are skipped. Review in smaller pieces (--commit, --base), or add generated files to ignore:.Un cambio grande quedó solo con reglas en algunos archivos. Las revisiones con IA se parten en partes de unos 60.000 tokens, hasta 6 partes. Lo que sobra va solo con reglas, y tollbar lo dice: The change is very large: N files get no AI review (rules only). Las líneas muy largas se recortan, y los archivos nuevos sin seguimiento de más de 512 KB se saltean. Revisá en pedazos más chicos (--commit, --base), o sumá los archivos generados a ignore:.

Why does a plain tollbar review exit 2 in this repo? Its .tollbar.yml has gate: major (the tollbar init template does). Remove it, or set gate: none.¿Por qué un tollbar review pelado sale con 2 en este repo? Su .tollbar.yml tiene gate: major (la plantilla de tollbar init lo trae). Sacalo, o poné gate: none.

The pre-push hook didn't run. Check tollbar status. If tollbar isn't on the PATH that git sees, the hook prints tollbar not found: pushing without review and lets the push through, and status warns you. Reinstall with npm install -g @ernestojost/tollbar.El hook pre-push no corrió. Mirá tollbar status. Si tollbar no está en el PATH que ve git, el hook imprime tollbar not found: pushing without review y deja pasar el push, y status te avisa. Reinstalalo con npm install -g @ernestojost/tollbar.

The Claude Code hook didn't stop the agent. It only looks at uncommitted work, only blocks on major or worse, and only once per task. To see what it received, set TOLLBAR_HOOK_LOG=hook.log.El hook de Claude Code no frenó al agente. Solo mira lo no commiteado, solo frena en major o peor, y una sola vez por tarea. Para ver qué recibió, definí TOLLBAR_HOOK_LOG=hook.log.

tollbar ignore 3 says it can't find the finding. The number refers to the last review in this clone; run tollbar review again and use the new number.tollbar ignore 3 dice que no encuentra el hallazgo. El número es de la última revisión en este clon; corré tollbar review de nuevo y usá el número nuevo.

Windows: tollbar setup says there's no terminal (Git Bash). Git Bash's mintty window doesn't look like a terminal to Node. Use tollbar setup --ask, run it from PowerShell, or pass the answers with --yes.Windows: tollbar setup dice que no hay terminal (Git Bash). La ventana mintty de Git Bash no le parece una terminal a Node. Usá tollbar setup --ask, corrélo desde PowerShell, o pasale las respuestas con --yes.

Windows: Git Bash turns /var/www into C:/Program Files/Git/var/www. That's Git Bash rewriting arguments that look like paths. tollbar drift --path undoes it on its own. For anything else, run the command as MSYS_NO_PATHCONV=1 tollbar ....Windows: Git Bash convierte /var/www en C:/Program Files/Git/var/www. Es Git Bash reescribiendo argumentos que parecen rutas. tollbar drift --path lo deshace solo. Para cualquier otra cosa, corré el comando como MSYS_NO_PATHCONV=1 tollbar ....

Windows: environment variables in PowerShell. $env:TOLLBAR_DEBUG = "debug.txt", then run tollbar. In cmd, set TOLLBAR_DEBUG=debug.txt.Windows: variables de entorno en PowerShell. $env:TOLLBAR_DEBUG = "debug.txt", y después corré tollbar. En cmd, set TOLLBAR_DEBUG=debug.txt.

Typos and wrong values are caught early:Los errores de tipeo y los valores mal puestos se detectan enseguida:

tollbar: --gate must be one of: critical, major, minor, info

(--gate none is also accepted.)(--gate none también se acepta.)

Not in a repo:Fuera de un repo:

tollbar: Not inside a git repository.

I want to see exactly what the AI got. TOLLBAR_DEBUG=debug.txt tollbar review saves every prompt and answer to that file. It contains your code, so treat it like your code.Quiero ver exactamente qué recibió la IA. TOLLBAR_DEBUG=debug.txt tollbar review guarda cada prompt y cada respuesta en ese archivo. Tiene tu código adentro, así que tratalo como tu código.

Appendix: tollbar --helpApéndice: tollbar --help#

tollbar 0.3.2: code review with your own AI, before you deploy.

Usage:
  tollbar setup               Asks how you'll use it and gets it working (run it again any time)
  tollbar setup --yes --profile work --ai claude-cli --hooks pre-push:ai,claude-stop:rules
                              The same with no questions, for agents and scripts (--print: only show
                              what it would do; tollbar setup --help: every option)
  tollbar status [--check]    Which settings, AI and hooks apply in this repo (--check tests the AI)
  tollbar review [options]    Review changes (default: uncommitted work, or the last commit)
  tollbar mark-deploy         Mark the current commit as deployed
  tollbar init                Write .tollbar.yml with the default settings
  tollbar init --global       Write your personal settings (~/.tollbar/config.yml) for every repo
  tollbar trust [--revoke]    Trust this repo's .tollbar.yml (it may pick another AI, a command or a URL)
  tollbar ignore <n> [--reason "why"] [--rule [--path glob]]
                              False alarm: record it in .tollbar/learnings.md so it isn't flagged again
                              (n = number in the last review; --rule = the whole rule in that file or glob)
  tollbar github              Inside GitHub Actions: review the PR or push and post the comments
  tollbar hook install [--ai] [--local]
                              Hook tollbar into Claude Code: review when each task ends and hand
                              back to the agent whatever needs fixing
  tollbar hook install --git [--ai]
                              Review before every git push and stop it if something is serious
                              (works with any remote, nothing to connect)
  tollbar hook uninstall [--git] [--local]
                              Remove tollbar's hook (Claude Code's, or the pre-push one with --git);
                              hooks that aren't tollbar's stay as they were
  tollbar stats              How many findings got fixed, how many were false alarms
  tollbar eval [--limit 10] [--no-ai]
                              Would tollbar have caught the bugs you fixed? (uses your "fix" commits)
  tollbar drift --ssh u@host --path /dir [--ref c] [--ignore glob] [--strict]
                              Compare the server with the last deploy: hand-edited, missing or
                              untracked files (--strict exits 3 on hand-edited files a deploy would overwrite)

What to review:
  --since-deploy              Everything since the last "tollbar mark-deploy"
  --base <branch>             This branch's changes against <branch> (e.g. main)
  --commit <sha>              One commit
  --uncommitted               Only what you haven't committed yet
  --all                       The whole project, as if it were new (audit of an inherited project)

Options:
  --gate <level>              Exit with code 2 if something of that level or worse shows up (critical|major|minor)
  --no-ai                     Rules only, no AI
  --model <model>             Model for the AI (e.g. haiku, sonnet, opus)
  --format <text|markdown|json>
  --max-findings <n>          How many findings to show (default 7)
  --min-severity <level>      Hide what is below this level
  --offline                   Don't query npm to validate packages
  --require-ai                Exit 4 if the AI didn't review everything (it failed, monthly cap, change too large)
  --notify                    Send the result to Telegram (TOLLBAR_TELEGRAM_TOKEN and TOLLBAR_TELEGRAM_CHAT)
  --quiet                     No progress messages
  -h, --help / -v, --version

Exit codes: 0 ok · 1 error (status: something is broken) · 2 blocked by --gate (setup: no terminal
and no --yes, nothing done) · 3 drift with --strict · 4 the AI didn't review everything (--require-ai)