Cursor SDK (tracing)
Cursor SDK (tracing)
Respan supports Cursor tracing in Python through Cursor hook payloads and in TypeScript through the Cursor SDK (@cursor/sdk). Use the Python setup for Cursor hook events, or the TypeScript setup for programmatic Cursor SDK agent runs.
Set up Respan
Create an account at platform.respan.ai and grab an API key.
Run npx @respan/cli setup to set up with your coding agent.
Example projects
Setup
Initialize and run
For TypeScript, pass sdkModule when your app imports @cursor/sdk directly. This ensures the instrumentor patches the same Cursor SDK module instance your application uses.
Configure Cursor hooks for Python
Use respan-cursor-hook as your Cursor hook command when using the Python hook integration.
View your trace
Open the Traces page to inspect Cursor hook spans or Cursor TypeScript SDK agent spans, generation spans, tool spans, streamed events, and local custom tool activity.
Captured data
Local custom tools
Cursor TypeScript SDK runs can define local custom tools. The instrumentor captures the tool definition and the tool call result.
Attributes
Use Respan attributes to group Cursor runs by user, thread, or workflow.