GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||
GeezerVison is showing docs.braintrust.dev — Muse Code - Braintrust Muse Code is Meta’s coding agent for the terminal and CI. You can connect it to Braintrust in two ways:
Braintrust tracing for Muse Code requires bt v0.28.0 or later and Muse Code 1.3.0 or later.Trace Muse Code sessionsbt traces Muse Code sessions through Muse Code’s command hooks. There is no separate plugin to install.
Set up tracing1 Install Muse Code If you haven’t already, install Muse Code 1.3.0 or later. Make sure its muse command is available in your terminal.2 Install and authenticate bt Follow the bt CLI quickstart to install bt, authenticate, and set your active context.3 Enable tracing Run this command in a terminal:
bt trace enable.4 Log a test trace Muse Code loads hooks when a session starts, so start a new Muse Code session. Then ask Muse Code to do something simple. When the turn finishes, open your Braintrust project and confirm that the trace appears on the Logs page. What Braintrust tracesMuse Code traces in Braintrust include:
braintrust.plugin.muse in context.span_origin. Each turn span and every span under it records the turn’s span ID in metadata.turn_span_id. bt sends pending spans at the end of each turn.
Common workflows
Use different tracing settings for one session Use bt trace run to trace a single Muse Code invocation without changing the saved tracing configuration:muse from the terminal. Set BRAINTRUST_MUSE_BIN to launch a different executable. bt adds its hooks to that invocation only and doesn’t send events through the hooks saved by bt trace enable, so the session isn’t traced twice.To change the saved destination, profile, or organization, rerun bt trace enable muse with the corresponding options. Running bt switch does not change the saved tracing configuration.To add root-span metadata, pass --additional-metadata '<JSON>' to bt trace run for one invocation or to bt trace enable for future sessions. Standard session metadata takes precedence when keys conflict.Pass --tag ci --tag release-validation to either command to tag session spans.
Trace a saved Muse Code session Use bt trace import with muse and the session ID to import a past session, even if tracing was not enabled when it ran. Pass --all to import every saved session. bt reads sessions with muse export, so muse must be on your PATH, or set BRAINTRUST_MUSE_BIN to its path.Imported sessions include prompts, final responses, model calls with responses and token usage, and tool calls. They don’t include the conversation sent to each model call, and they have no subagent, compaction, permission request, or notification spans. With bt v0.30.1 or later, imported and attached turns include prompt images when the Muse Code session is still stored locally. muse export output alone doesn’t contain the images.To follow an active session, pass --attach with its session ID. Pressing Ctrl-C stops following the session without ending it. To record the rest of the session, attach again or import it after it finishes.To nest an imported session under an existing span or send it to an experiment, pass --parent or --destination to bt trace import.
Resume a Muse Code session When you resume a Muse Code session, new turns are added to its existing Braintrust trace.
Stop tracing Muse Code sessions With bt v0.33.0 or later, bt trace disable muse pauses tracing and keeps the hook entries and tracing configuration. Run bt trace enable muse to resume.To remove the Braintrust hook entries from Muse Code’s settings.json and delete its tracing configuration, use bt trace uninstall muse. In earlier versions of bt, bt trace disable muse removes them instead. Other hooks and saved bt profiles and credentials are preserved.Update the tracing hooksUpdatingbt also updates the Braintrust hooks in Muse Code’s settings. To update them, follow these steps:
1 Update bt Follow the CLI migration guide to update bt to the latest version and complete the applicable migrations.2 Update the hooks bt trace update refreshes the Braintrust hook entries in Muse Code’s settings.json without changing your saved tracing configuration. If the hooks aren’t installed, run bt trace enable muse instead.3 Verify in a new session Start a new Muse Code session, run a short task, and confirm that its trace appears on the Logs page in the intended Braintrust project. Troubleshooting tracingFirst, runbt trace doctor muse. The report warns when Muse Code is missing or earlier than 1.3.0, when bt isn’t on your PATH, and when the Braintrust hooks in settings.json are missing or outdated. Then, review the following:
Traces do not appear after setup Muse Code’s hooks run bt by name, so confirm that bt is on the PATH of the environment that launches muse. If a Muse Code session was running when you enabled tracing, start a new session.Run bt trace doctor muse and confirm that tracing is enabled and routed to the intended project.If authentication succeeds but traces do not appear, confirm that your account has permission to write logs to the selected project.For authentication, tracing destination, or endpoint problems, see bt trace troubleshooting.
Setup reports an unrecognized Braintrust forwarder bt trace enable muse and bt trace run muse stop with an error when Muse Code’s settings or managed hooks already contain a Braintrust forwarder, a bt trace hook command that bt didn’t write, so the session isn’t traced twice. Remove the manually added Braintrust hook entries and rerun the command.bt trace run muse also stops when a .muse/hooks.json file in the working directory or one of its parent directories already includes Braintrust tracing.Connect to Braintrust MCPThe Braintrust MCP server lets Muse Code query and update Braintrust data. MCP is configured independently from tracing.1 Choose authentication
Use OAuth when your client supports it. Your client opens a Braintrust authorization page where you sign in and approve access. The server acts with the permissions of the account you sign in with.
/.well-known/oauth-authorization-server on the same host as your MCP endpoint (see next step), so a client can register itself.Use an API key for clients without OAuth support or for programmatic connections. The server acts with the permissions of the account the key belongs to.
Your bt login doesn’t authenticate the MCP server.2 Choose your endpoint Use the endpoint for your organization’s data plane region:
3 Add the server to Muse Code Follow the Muse Code guide to add the remote server. 4 Verify the connection To verify the connection, ask Muse Code to list your recent Braintrust projects. If it can’t connect, see Braintrust MCP troubleshooting. 5 Start using Braintrust tools Muse Code can query logs, compare experiments, work with datasets, and use other Braintrust tools. For example:
Next steps
Was this page helpful? | ||||||
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |