CLI · Go · local MCP

toolbelt A toolbelt for AI coding agents

One local tb binary that unifies adversarial verification, fresh-context review, drift detection, anti-cheat guards, invariant memory, on-demand graph search, and an MCP server — under one command and protocol.

Apache-2.0 · Go 1.27+ · Linux / macOS / Windows

The problem it solves

Coding agents burn tokens on blind grep, mix implementation and evaluation in the same context, and sometimes “pass” tests without meeting scope. tb packs the pieces described in the README and architecture: save tokens (queryable graph, compact memory), improve accuracy (sandbox, guard, author/reviewer separation), and speed up the loop (local execution, shared stack, benchmark harness).

  • AI agents — MCP tools and CLI in-repo, no remote service required.
  • People who review their work — verify, review, drift, and guard with JSON output and CI exit codes.

Commands and features

Implemented commands (Phases 1–3). Sample outputs are labeled as examples; format matches the Cobra CLI.

tb verify

Adversarial verification loop with tests and visual rulers (headless screenshot with graceful skip).

shell
tb verify run --ruler tests

tb review

Fresh-context review (Elephant-Goldfish) against ticket/rd.md and invariants; scope/quality/acceptance roles.

shell
tb review --ticket rd.md --base HEAD~1 --head HEAD

tb drift · tb guard

Scope / base-commit / pinned-patch drift; guard checks protected paths and anti-cheat patterns in the diff.

shell · example
tb guard check HEAD~1..HEAD
# guard: ok (3 rules, 0 violations)

tb graph · tb mem

On-demand graph (enable with TB_GRAPH=on or --enable): BM25-ranked search, callers/deps/impact, explain and path; invariant memory kept outside compaction.

shell
TB_GRAPH=on tb graph --enable search HandleRequest
tb graph explain HandleRequest
tb mem list
tb mem add "nunca editar fixtures de teste"

tb stack

Stacks verify/review/drift/guard with shared diff, index, and memory; one aggregated JSON.

shell · example
tb stack guard --base HEAD~1 --head HEAD
{ "ok": true, "steps": […], "total_duration_ms": 0 }

tb ticket · tb router · tb merge

Phase 3: local tickets, a foreground router with workers in worktrees and a fail-closed sandbox, a health watchdog, and atomic merge (fail | last_wins | semantic | prompt).

shell
tb ticket create --title "Create User model" --scope "src/models/**"
tb router run --agent-cmd "my-agent"
tb board list
tb merge --dry-run TKT-001

tb bus

Local bus between agents from different vendors (SQLite, bus/0.1 protocol): only the human creates channels and invites; tb bus run wakes the agent without spending tokens (exec/harness adapters).

shell
tb bus channel create feature-x --owner claude-main --ttl 2h
tb bus invite feature-x --role worker
tb bus join feature-x --invite K7Q2-9XMD --name grok-1 --vendor xai
tb bus recv --channel feature-x --as grok-1 --wait 20s

tb bench · tb init · tb version

Benchmark harness (run/list/report/compare, including A/B); init detects toolchain; version reports the build.

shell
tb init
tb bench run --fake -r 1
tb version

Top-level tb run is planned, not implemented; today use tb sandbox run for Landlock isolation on Linux. Also available: tb workspace (worktrees) and tb mcp.

MCP server

tb mcp starts a stateless MCP server over stdio (JSON-RPC 2.0). It runs locally on your machine — no hosted service required.

Tools (CLI parity)

  • tb_version, tb_run
  • tb_mem_*, tb_verify_run, tb_review
  • tb_drift, tb_guard_check, tb_stack
  • tb_graph_search / callers / deps / impact / explain / path / index
  • tb_ticket_*, tb_board, tb_router_status, tb_watchdog_alerts, tb_merge
  • tb_bus_join / send / recv / claim / complete / heartbeat / status
  • tb_vault_*, tb_egm_*, tb_red_*, tb_blue_*, tb_sec_pair

Graph tools require TB_GRAPH=on in the server process.

mcp.json · example
{
  "mcpServers": {
    "toolbelt": {
      "command": "tb",
      "args": ["mcp"],
      "env": {
        "TB_GRAPH": "on"
      }
    }
  }
}

Install

Prefer binaries from GitHub Releases (linux / darwin / windows × amd64 / arm64) and verify checksums.txt.

Via Go

go
go install github.com/leonardo-moraes360/toolbelt/cmd/tb@latest

go install usually embeds version dev; prefer the Release for the tagged build.

Local build

make
git clone https://github.com/leonardo-moraes360/toolbelt.git
cd toolbelt && make build
./bin/tb version

Open latest release

Documentation

Sources live in the repo — the Cobra CLI wins if docs diverge.