- Trace Antigravity sessions to record session, turn, model call, and tool spans in Braintrust.
- Connect to Braintrust MCP to work with Braintrust projects, experiments, logs, and other data from Antigravity.
agy) on macOS and Linux, not IDE sessions. Native Windows tracing setup is not supported.Trace Antigravity sessions
Thebraintrust-antigravity-tracing plugin passes your interactions with Antigravity to bt, which in turn uses a background process to build and deliver the trace to Braintrust.
Antigravity continues to communicate directly with its model provider, and tracing failures do not stop your Antigravity session.
Set up tracing
Install Antigravity
agy command and a Unix-compatible sh are available in your terminal.Install and authenticate bt
bt CLI quickstart to install bt, authenticate, and set your active context.Enable tracing
- Installs (or updates) and enables
braintrust-antigravity-tracingthroughagy. - Writes
~/.gemini/config/braintrust.json, which records whether tracing is enabled and which project receives traces.
bt trace enable.Restart Antigravity
Log a test trace
agy session. When the session finishes, open your Braintrust project and confirm that the trace appears on the Logs page.What Braintrust traces
Antigravity traces in Braintrust include:- Session spans with conversation identifiers, available workspace and model metadata, and Git repository metadata when available.
- Turn spans with prompts and final responses.
- Model call spans reconstructed from the session transcript, with conversation input, response output, and available token metrics.
- Tool spans with available inputs, outputs, approval outcomes, and errors.
bt v0.19.3 or later, session spans also include the local username when available.
Every span records its origin as braintrust.plugin.antigravity. Model inputs are reconstructed from transcripts rather than captured as raw provider requests. Imported sessions do not establish exact historical model-call latency.
Common workflows
Change saved tracing settings
Change saved tracing settings
bt trace enable antigravity 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 enable for future sessions. Standard session metadata takes precedence when keys conflict.With bt v0.19.3 or later, pass --tag ci --tag release-validation to bt trace enable to tag session spans.Trace a saved Antigravity session
Trace a saved Antigravity session
bt trace import with antigravity and the conversation ID to import a past session, even if tracing was not enabled when it ran.You can also attach an imported session to an existing span or experiment.Resume an Antigravity session
Resume an Antigravity session
Stop tracing Antigravity sessions
Stop tracing Antigravity sessions
bt trace disable antigravity to uninstall the tracing plugin and remove its tracing configuration. Saved bt profiles and credentials are preserved. Restart Antigravity afterward.Update the tracing plugin
~/.gemini/config/hooks.json contains a braintrust-antigravity-tracing entry, use “Migrate from a manual hook registration” below instead of the routine update steps.Migrate from a manual hook registration
Migrate from a manual hook registration
~/.gemini/config/braintrust.json (or your BT_DAEMON_CONFIG override). Then follow the CLI migration guide to update bt and complete the applicable migrations.Run this command with the profile, organization, and project you recorded:bt trace update, it rewrites your tracing settings.Compare the tracing file with the settings you recorded and restore any custom values. route.flush_mode resets to fire_and_forget, so restore its previous value if you customized it.Restart Antigravity, run a short agy session, and confirm that its trace appears on the Logs page in the intended Braintrust project.Update bt
bt to the latest version and complete the applicable migrations.Update the tracing plugin
bt trace update updates the installed plugin without changing your saved tracing configuration.Restart and verify Antigravity
agy session, and confirm that its trace appears on the Logs page in the intended Braintrust project.Troubleshooting tracing
First, runbt trace doctor antigravity. Then, review the following:
The tracing plugin is missing or disabled
The tracing plugin is missing or disabled
bt trace enable antigravity --project <your-project> to install and enable the plugin. Restart Antigravity afterward.The doctor report checks tracing settings and authentication, not whether Antigravity loaded the plugin’s hooks.Traces do not appear after setup
Traces do not appear after setup
bt is available in the environment that launches agy.Run bt trace doctor antigravity 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 and the CLI migration troubleshooting guide.Tracing failures do not interrupt the Antigravity session.Antigravity uses an unexpected configuration directory
Antigravity uses an unexpected configuration directory
~/.gemini/config/braintrust.json. To use a different file, set BT_DAEMON_CONFIG to its path before both running bt trace enable antigravity and launching Antigravity.Traces use unexpected settings
Traces use unexpected settings
TRACE_TO_BRAINTRUST, BRAINTRUST_PROJECT, or BRAINTRUST_ADDITIONAL_METADATA from the agent’s environment to override the saved tracing settings.For environment variables accepted by the bt commands themselves, see bt trace.Connect to Braintrust MCP
The Braintrust MCP server lets Antigravity query and update Braintrust data. MCP is configured independently from the tracing plugin.Set up the MCP server
Install Antigravity
Add the Braintrust MCP server
Authenticate
agy session, enter /mcp, select the Braintrust MCP server, and press Enter. Choose Authenticate and complete the sign-in in your browser.MCP authentication is separate from bt login, which authenticates the CLI and tracing integration.Verify the connection
Use MCP tools
Once connected, Antigravity can query logs, compare experiments, work with datasets, and use other Braintrust tools. For example:- “Show me my recent Braintrust experiments.”
- “Query the last 10 logged requests with errors.”
- “Compare accuracy scores between my two latest experiments.”
Troubleshooting MCP
Braintrust MCP tools do not appear
Braintrust MCP tools do not appear
/mcp in an agy session and confirm that the Braintrust server is listed. Use the MCP manager to reload the configuration after adding or changing the server.MCP authentication or connection fails
MCP authentication or connection fails
/mcp in an agy session, select the Braintrust MCP server, and press Enter. Choose Authenticate and complete the OAuth flow.If you previously configured API-key authentication, remove the Authorization header from the Braintrust server’s entry in your MCP configuration before switching to OAuth.For authentication methods, regional and self-hosted endpoints, and network requirements, see the Braintrust MCP guide.Next steps
- Learn the CLI: See the full
bt tracereference. - Run evaluations: Follow the evaluation guide.
- Explore MCP tools: See the Braintrust MCP tool reference.
- Browse the source: View the coding-agent plugins repository.