Skip to main content
bt setup configures Braintrust integrations for coding agents (Claude, Cursor, Codex, Opencode). Run it once in a repo or globally to give your agent access to Braintrust skills, MCP tools, and workflow documentation.
bt setup                                  # Interactive wizard
bt setup --local --agent claude           # Configure Claude for current repo
bt setup --global --agent codex           # Configure Codex user-wide

bt setup skills

Writes agent-specific skill files (.claude/skills/braintrust/SKILL.md, .cursor/rules/braintrust.mdc, etc.) so your agent knows how to use Braintrust. Also prefetches workflow docs.
bt setup skills --local --agent claude --workflow evaluate
bt setup skills --global --agent codex --agent cursor

bt setup instrument

Runs a coding agent against your repo to automatically add Braintrust SDK instrumentation (tracing, logging). The agent detects your project language, installs the exact SDK version, instruments your LLM clients, runs the app to verify the integration, and outputs a Braintrust permalink to the emitted trace.
bt setup instrument --agent codex
bt setup instrument --agent claude
bt setup instrument --agent claude --language typescript
What the agent does:
  1. Verifies that BRAINTRUST_API_KEY is set — aborts if missing
  2. Detects the project language from build files: package.json → TypeScript, requirements.txt/pyproject.toml → Python, pom.xml/build.gradle → Java, go.mod → Go, Gemfile → Ruby, .csproj → C#
  3. Looks up and installs the latest exact SDK version (never uses latest)
  4. Instruments LLM clients in the app entry point
  5. Runs the app to verify traces are emitted
  6. Outputs a Braintrust permalink to the captured trace
What the agent does NOT do: refactor unrelated code, add eval code, or add manual flush/shutdown logic. The app is required to run correctly without BRAINTRUST_API_KEY set. Supported languages: Python, TypeScript/JavaScript, Go, Java, Ruby, C# Instrumentation approach by language:
LanguageSDK packageInstrumentation
Pythonbraintrustbraintrust.init_logger() + braintrust.auto_instrument() or manual wrappers
TypeScriptbraintrustinitLogger() + wrapOpenAI() / framework wrappers
Gogithub.com/braintrustdata/braintrust-sdk-gobraintrust.New() + Orchestrion compile-time instrumentation
Javadev.braintrust:braintrust-sdk-javaBraintrust.get() + BraintrustOpenAI.wrapOpenAI()
Rubybraintrust gemrequire "braintrust/setup" or braintrust exec wrapper
C#Braintrust.Sdk NuGetBraintrust.Get(config) + BraintrustOpenAI.WrapOpenAI()
Instrument-specific flags:
FlagDescription
--language <LANG>Force language (repeatable): python, typescript, javascript, go, java, ruby, csharp
--agent-cmd <CMD>Override agent command (replaces the built-in default)
--quiet / -qSuppress streaming agent output
--interactive / -iRun agent in interactive mode
--yoloGrant full permissions and run in background without prompting

bt setup mcp

Adds the Braintrust MCP server to your agent’s config so it can query Braintrust data directly.
bt setup mcp --local --agent claude
bt setup mcp --global --agent codex

bt setup doctor

Diagnoses your coding agent setup and reports what is and isn’t configured.
bt setup doctor --local
bt setup doctor --global

Common flags

FlagDescription
--agent <AGENT>Agent to configure: claude, codex, cursor, opencode (repeatable; auto-detected if omitted)
--localConfigure for the current git repo
--globalConfigure user-wide
--workflow <WORKFLOW>Prefetch docs for a workflow: instrument, observe, annotate, evaluate, deploy (repeatable)
--yes / -ySkip confirmation prompts
--refresh-docsClear and re-fetch any previously downloaded docs