Catalyst instruments the Cursor SDK in TypeScript. Initialize tracing before callingDocumentation Index
Fetch the complete documentation index at: https://docs.inference.net/llms.txt
Use this file to discover all available pages before exploring further.
Agent.create() so the Agent static methods and the returned
SDKAgent / Run objects are patched before any run is observed.
Use this guide for Node applications that run programmatic Cursor agents with
@cursor/sdk. Cursor publishes a TypeScript SDK only, so there is no Python
equivalent for this integration.
Cursor’s SDK streams runs over HTTP/2 via
@connectrpc/connect-node. Run
Catalyst-traced Cursor apps under Node (>= 22). Bun’s HTTP/2 client currently
emits NGHTTP2_FRAME_SIZE_ERROR mid-stream against api.cursor.com.What Is Captured
- One AGENT span named
Cursor Agent Runper observed run, started lazily whenrun.stream(),run.wait(),run.conversation(), orrun.cancel()is first called cursor.agent_id,cursor.run_id,cursor.run_status,cursor.duration_ms, request IDs, and model metadata (llm.model_name,llm.invocation_parameters)input.valuefromagent.send()andoutput.valuefrom streamed assistant text,run.wait()results, orrun.conversation()turns- TOOL child spans for streamed
tool_callevents, includingtool.name,tool_call.id, JSON arguments, and tool results - Aggregate counts:
agent.tool_call_count,agent.llm_call_count - Error status and exception details when run streaming, waiting, or cancellation fails
Install
TypeScript Cursor Agent Run
Initialize tracing before creating Cursor agents. Auto-instrumentation detects@cursor/sdk when it is installed in the project, so the smoothest path is just
setup().
TypeScript
TypeScript
Lazy Span Lifecycle
The AGENT span starts when the application first observes a run throughrun.stream(), run.wait(), run.conversation(), or run.cancel(), not when
agent.send() returns. This avoids leaking open spans for fire-and-handoff
workflows where one process kicks off a Cursor run and another process observes
it later. Each unique observed run produces one AGENT span; observing the same
run twice in the same process does not double-emit.
Verify In Catalyst
Filter traces by yourservice.name (for example cursor-agent-runner). A
successful run should show one Cursor Agent Run AGENT span with cursor.run_id
and the model name, plus nested TOOL spans for each tool call the agent
produced.
For short-lived scripts, always call tracing.shutdown() before process exit so
batched spans are flushed to Catalyst.