Skip to main content
The Bitfab Cursor plugin brings the full evaluation workflow into Cursor. It provides MCP tools for trace inspection and diagnostics, slash commands for setup and iteration, and automatic notifications so you never have to leave your editor.

Installation

Run the CLI from your project directory:
This installs the Bitfab plugin, opens your browser to log in, and launches /bitfab-setup. Pass an initial setup request with --prompt (or -p) to carry it into the Cursor handoff:
The CLI checks that Cursor Agent is signed in before it launches the Bitfab agent. If needed, run cursor agent login first.
Add this to your .cursor/mcp.json (project-level) or ~/.cursor/mcp.json (global):
Visit the setup page to get a pre-configured snippet with your API key already embedded, or use the one-click deep link installation.

What the Plugin Does

Automatic Setup

The /bitfab-setup command runs a multi-phase workflow:
  1. Login — Opens your browser for OAuth authentication, saves credentials securely
  2. Instrument + Replay (in parallel, per workflow) — Reads your codebase, finds all AI workflows (LLM calls, agents, AI-driven decisions), and presents them as a numbered list. You choose which to instrument: it adds tracing with minimal diffs and generates a replay script so you can regression-test your trace functions against production data with one command
You can run individual phases:
The setup is interactive: it presents 2-5 concrete options per decision point with a recommended choice, so you stay in control throughout.

Assistant

The /bitfab-assistant command turns production traces into code improvements, whether the goal is correctness (improving pass rates) or efficiency (cutting token usage and cost). Your agent will do the mechanical work and collaborate with you on three steps:
  1. Build a dataset from production traces: search for failures, label them with expected outcomes
  2. Experiment against that dataset: make isolated code changes, replay, compare results
  3. Hill climb: repeat until the best change is found, then present results
Run it with an optional trace function key:

Building the Dataset

Your coding agent does the data wrangling: it searches production traces for failures, reads full inputs and outputs, and identifies edge cases. It then presents edge cases for your judgment: is this a failure (and what should the output be), correct, or irrelevant? This labeled dataset becomes the benchmark for all experiments. The plugin opens a rich UI for navigating and labeling the dataset, then brings you back to your coding agent so you stay in flow. You can label every trace yourself, or label a few and let the agent classify the rest based on the patterns you’ve established.

Running Experiments

The command reads your code, diagnoses failure patterns, and categorizes proposed changes:
  • Code fixes: deterministic bugs, bundled into one experiment as a foundation
  • Judgment-based fixes: prompt changes, search tuning, output formatting, each gets its own experiment
  • Infrastructure proposals: larger changes noted for future work, not experimented on
Independent experiments run in parallel, each in its own isolated subagent on a separate git worktree. Each subagent edits the code, runs the replay script against your labeled dataset, and compares new outputs to expected outcomes.

Results

After each round, you see which traces now match expected outcomes, which still diverge, and whether any regressions occurred. The assistant works through the planned experiments in turn without pausing to ask whether to keep going, then wraps up once the plan is complete. The final summary shows pass rate improvement and all files changed, uncommitted in your working tree for review.

MCP Tools

The plugin registers MCP tools that Cursor can call during conversations. These let you inspect traces, diagnose failures, and improve your code without leaving the editor.

Core

Trace Inspection

Labeling and Datasets

Experiments

Templates

Instrumentation

Slash Commands

Example Workflows

Instrument a new project

The agent detects your project language, finds AI workflows, presents options, and instruments your chosen workflows, all interactively.

Diagnose and fix a failing function

Ask Cursor naturally:
The plugin calls search_traces and read_traces to inspect failing traces and suggests code fixes directly. For a specific failing trace, run /bitfab-assistant fix <trace-id>. The agent diagnoses the failure, confirms why the original trace is wrong before editing when the trace or conversation does not already make that clear, makes the focused code fix, and replays only that trace first. Once the fix passes, it adds that trace to a dataset with a validated failing label, then branches: inspect the before/after in Studio, re-run the full dataset (in Studio or terminal-only), keep iterating, or stop. If that full-dataset re-run reveals real regressions (previously-passing traces the fix broke), it reports them and keeps the target trace saved as a red test to revisit. If the replay still fails, it offers to keep iterating or save the trace as a failing test instead.

Iterate on a trace function

The agent finds failing traces, walks you through labeling them with expected outcomes, diagnoses the failure patterns in your code, then runs experiments: editing prompts or code, replaying against your labeled dataset, and reporting what improved. You stay in control at every decision point.

Replay after a code change

After updating a function, run your replay script to test against production data:
Or ask Cursor to do it for you. While the replay runs, Cursor runs it in the background and reports progress to you as it goes: one line per trace as it finishes (a pass/fail mark, the running count, and how long that trace took), with any error reason inline, plus a periodic “still running” heartbeat when a slow trace takes a while so the run never looks stuck, then a summary with the total and average time. Full per-item outputs are written under that replay run’s .bitfab/replays/<run-id>/items/ folder and referenced from .bitfab/replays/<run-id>/events.jsonl.

Configuration

Credentials

Credentials are stored in .bitfab/credentials.local.json when that project-local file exists, otherwise in ~/.config/bitfab/credentials.json (created by /bitfab-setup login with owner-readable permissions).

Environment Variables

Troubleshooting

Not authenticated

If you see “Not authenticated” on session start:
  1. Run /bitfab-setup login to authenticate via browser
  2. Check that ~/.config/bitfab/credentials.json exists and contains your API key
  3. If using an environment variable, verify BITFAB_API_KEY is set

MCP tools not available

If Cursor can’t access the Bitfab tools:
  1. Verify the MCP configuration in .cursor/mcp.json or ~/.cursor/mcp.json
  2. Try restarting Cursor after adding or modifying the MCP configuration
  3. Check the MCP Setup guide for troubleshooting steps

Plugin updates

Run /bitfab-update to install the latest version.