/kubit-integrate skill finds your existing tracing setup, creates or selects an Agent workspace, writes the API key to your env file and adds the Kubit SDK (kubit-otel or @kubit-ai/otel). It shows a diff before every file it changes.
Use this page if you work in Claude Code or Cursor, or if you already send traces to Langfuse or Braintrust. To wire Kubit by hand, use the Kubit SDK for Python, the Kubit SDK for Node or Manual OpenTelemetry. The Quickstart compares the three.
Before you start
- Claude Code installed
- Node.js 18+, for
npx - A Kubit account. Sign-up needs an early-access link from Kubit or an invite from your organization. See Set up your organization.
- Your agent’s repo checked out, with its dependencies installed
- For Python: Python 3.9 or later
- For Node: OpenTelemetry JS SDK v2 or no OpenTelemetry yet.
@kubit-ai/otelneeds@opentelemetry/sdk-trace-base,@opentelemetry/sdk-trace-nodeand@opentelemetry/resourcesat^2.0.0.
Steps
Install the Kubit plugin
npx @kubit-ai/agent-plugin --runtime claude --global, or use --local in place of --global.The plugin adds the Kubit MCP server as kubit-agent and installs eight skills. Restart Claude Code, then run /kubit-help to check that the skills loaded.Sign in to the Kubit MCP server
In Claude Code, run
/mcp, pick kubit-agent and complete the browser sign-in. This is a one-time OAuth sign-in. Until it’s done, every Kubit tool call fails with an auth error. If a skill hits that error and gets a sign-in link, it opens the link in your browser and waits for you to finish.Run /kubit-integrate in your repo
Review each diff
The skill shows a diff for every file it writes or edits: the env file, the bootstrap file and your entrypoint. Approve or reject each one.
What /kubit-integrate does
Detection
The skill looks for tracing tools on two axes.
If it finds more than one sink, it asks you to pick one.
Workspace and API key
The skill offers to create a new workspace, switch to another one or use your current one. Creating a workspace takes about 30 seconds. It detects your timezone for the workspace and falls back toUTC.
A workspace the skill creates starts on the default-otel extraction template. Switch it to default-agent in Data > Extraction, as described in Check the extraction mapping.
It then mints an ingestion key, or takes one you paste, and writes KUBIT_API_KEY=<key> to .env.local or .env. The key goes only into that file. If no env file can be written, it prints an export KUBIT_API_KEY=… line for you to run.
Wiring
For a Next.js app with the Vercel AI SDK, the bootstrap file is
instrumentation.node.ts.
The skill always installs the Kubit SDK. With a sink, it adds KubitSpanProcessor (Node) or calls attach() (Python) next to the sink’s processor. Without one, it calls configure(). The Kubit SDK for Python and Kubit SDK for Node pages describe the code it writes.
Add user and session IDs
/kubit-integrate doesn’t add user or session IDs to your spans. Without them, Kubit can’t group traces into sessions or join them to users. Set them on the root span of each request, as shown in Kubit SDK for Python or Kubit SDK for Node.
Constraints
Other Kubit skills
Using Cursor, Codex or another agent
The plugin installs into Cursor too. Runnpx @kubit-ai/agent-plugin and pick Cursor, or run npx @kubit-ai/agent-plugin --runtime cursor. Pick Both to install into Claude Code and Cursor at once. Restart Cursor afterwards. Cursor asks you to sign in to the Kubit MCP server the first time a skill calls it.
Codex and other agents don’t have the plugin. Give your agent the page that matches your stack and let it follow the steps:
Verify
After you run the skill’s verification command, open Agent > Activity in the Kubit app, set Time Range to Last 1 day and click Execute. The list has a trace whose root span ishello-kubit. Validate in Activity shows what to check in the trace.
With the plugin installed, you can also ask Claude Code or Cursor:
“Show me traces from the last 15 minutes”
If it fails
More checks are in Is my data flowing?.
Next steps
- Quickstart: check the extraction mapping and validate in Activity.
- Concepts: what Kubit does with your spans.