Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.honeyhive.ai/llms.txt

Use this file to discover all available pages before exploring further.

The Cursor SDK is Cursor’s TypeScript SDK for running coding agents programmatically. Use the cursor-sdk-honeyhive cookbook to trace Cursor agent runs in HoneyHive. We plan to add first-class support through an instrumentor package soon. One Cursor run becomes one HoneyHive session with the agent run, tool calls, and final assistant response.
Cursor’s TypeScript SDK is currently in public beta. Treat this cookbook workflow as experimental until package support is available.
Screenshot of a Cursor SDK trace in HoneyHive. The event tree shows an agent.run chain with nested tool.read and tool.glob events and a final turn.agent model event. The detail panel displays the prompt asking the agent to summarize the cookbook and the assistant's response with a top-level layout table.

Quick Start

Cursor SDK tracing is currently available as a cookbook example while first-class package support is in progress. Clone the cookbook to try the workflow, then vendor the helper into your Cursor SDK project if you want to use it today.
You need Node.js 20+, pnpm, a Cursor API key, and a HoneyHive API key.
git clone https://github.com/honeyhiveai/cookbook.git
cd cookbook/cursor-sdk-honeyhive
pnpm install
cp .env.example .env
Set credentials in .env:
CURSOR_API_KEY=your_cursor_api_key
HH_API_KEY=your_honeyhive_api_key
Run the example:
pnpm start
After the run finishes, open the HoneyHive Log Store to inspect the trace.

Add Tracing

Wrap any Cursor Agent with traceRun:
import { Agent } from '@cursor/sdk';
import { HoneyHiveCursorInstrumentor } from './instrumentor/index.js';

const instrumentor = new HoneyHiveCursorInstrumentor({
  apiKey: process.env.HH_API_KEY,
  project: 'My Cursor Project',
});

const agent = await Agent.create({
  apiKey: process.env.CURSOR_API_KEY,
  model: { id: 'composer-2' },
  local: { cwd: process.cwd() },
});

const result = await instrumentor.traceRun({
  agent,
  message: 'Run the test suite and fix any failing tests',
});

console.log(result.honeyhiveSessionId);
Use HH_PROJECT, HH_SOURCE, and HH_API_URL to customize the project label, source label, or API endpoint. Set HH_API_URL for self-hosted or dedicated HoneyHive deployments.

What Gets Traced

Each Cursor run appears in HoneyHive as:
EventTypeNotes
session.startsessionTop-level container for the Cursor run.
agent.runchainCursor SDK invocation with the prompt, result, model, Git metadata, token usage, and step summaries.
tool.<name>toolOne event per Cursor tool call, such as tool.read, tool.glob, or tool.shell.
turn.agentmodelFinal assistant response with chat history and token usage metadata.
The cookbook redacts common secret fields, truncates large payloads, and stores only the workspace folder name instead of the full local path.

Cookbook source

Full runnable Cursor SDK tracing example

Enrich Your Traces

Add user IDs and custom metadata to Cursor SDK traces

Custom Spans

Create spans for business logic around agent calls

Tracing Quickstart

Get started with HoneyHive tracing

Resources