Set Up Traceway with a Coding Agent
The traceway-setup skill lets your coding agent do the integration work. It reads your repository, proposes which Traceway projects you need, adds OpenTelemetry to your backend and the Traceway SDK to your browser or mobile app, and then checks that data arrives. You approve the plan before anything is created, and you review the code changes like any other diff.
It works with Claude Code, Cursor, Codex and every other agent that reads SKILL.md.
| What you do | How often | |
|---|---|---|
| 1 | Install the skill | Once per machine |
| 2 | Run it in your repository and confirm what it found | Once per repository |
| 3 | Approve the plan in Traceway | Once per repository |
| or | Start from a project you already created, in place of step 3 | Once per project |
Step 1: Install the skill
The skill is a set of Markdown files that teach the agent how Traceway works and how each language and framework is instrumented. It runs no code by itself.
npx skills add tracewayapp/skills --skill traceway-setup--all in place of --skill traceway-setup installs all four Traceway skills, including traceway for querying production data afterwards.
You invoke it as /traceway-setup in . Agents name a skill differently, and the prompts on this page follow the one you pick.
Step 2: Run it in your repository
Open your agent in the repository you want to monitor and type:
/traceway-setupThe agent starts by reading, not by changing. It looks at your languages and frameworks, what is deployed, which jobs run in the background, where model calls are made, and which observability tools are already there. Then it shows you a table like this and waits:
| Component | What it found | Traceway project | Integration |
|---|---|---|---|
apps/api | Go module with HTTP routes | Shop Backend | OpenTelemetry |
apps/worker | Queue consumers | Shop Backend | OpenTelemetry |
apps/web | Svelte and Vite | Shop Web | Traceway Svelte SDK |
Correct anything that is wrong: a component that is not deployed, a name, a service that should have its own project. A backend system is one project, however many services it has. Each browser app and each mobile app is a project of its own. Project Structure explains why.
Nothing has been created or edited at this point.
Step 3: Approve the plan
The agent cannot create projects by itself. It asks you for a setup token, which only lets it propose a plan.
- Open cloud.tracewayapp.com/setup?mode=add (opens in a new tab) and log in. If you have no account yet, register (opens in a new tab) and keep AI selected on the second step. On your own server, use the same paths on its address.
- Copy the setup token the page shows. It starts with
tws_. Paste it into the chat with your agent, and keep the page open. - The agent submits the project list. It appears on the page you have open.
- Check the names and frameworks, then press Approve Setup.
Approving creates the projects. The agent then writes each project token into the env file it named in the plan, such as backend/.env, and continues with the integration: it adds the SDK, wires the exporter, and marks background jobs and model calls.
A setup token expires after 6 hours, and Generate New Token replaces it. It can propose a plan and nothing else: it cannot read data and it cannot create anything without your approval.
Alternative: start from a project you already created
If the project exists, skip the plan. Open the project's Connection page in Traceway. Its AI tab shows two steps, Install the Traceway Skill and Run the Setup Prompt, and the prompt already carries the project's token and your server's address:
/traceway-setup with token <project token> and url https://cloud.tracewayapp.com
Copy it into your agent. With one deployable component and a token in hand, the agent skips the project list and goes straight to the integration.
Check that it works
The skill verifies its own work and then tells you how to see it yourself, with requests against your own app. For a backend that is usually:
- Call one route with a parameter three times, for example
/users/1,/users/2and/users/3. Open Endpoints and set the time range to the last 15 minutes. You see one row with a count of 3, not three rows. - Trigger an error. It appears under Issues with its stack trace, and the request that failed shows status 500.
- Run a background job once. It appears under Tasks by its name.
If the agent could not run one of its checks, for example because a deployment secret is not set yet, it says which one and why.
What it can set up
| Area | What the agent does |
|---|---|
| Backends | Adds OpenTelemetry in the language you use and exports traces, logs and metrics over OTLP/HTTP. The guides under OpenTelemetry describe the same setup by hand |
| Background work | Marks cron jobs, queue consumers and workers so they appear under Tasks |
| AI calls | Finds model calls and records them with the OpenTelemetry GenAI conventions. See AI Tracing |
| Browser apps | Adds the Traceway SDK for React, Vue, Svelte or plain JavaScript, and the source map upload to your release build |
| Mobile apps | Adds the Flutter, Android, iOS or React Native SDK, and the symbol upload for release builds |
| Servers and clusters | Installs the OTel Agent for host metrics, or the Kubernetes manifests |
| Your own product | Embeds a Traceway dashboard in your application. See Dashboards |
What it does not do:
- It does not change code before you have seen what it found and confirmed the plan.
- It does not create projects without your approval on the Traceway page.
- It does not print project tokens in the chat, and it does not commit them. Tokens go from Traceway into untracked env files. For hosted deployments it gives you the command or the settings page where the secret goes.
- It does not deploy anything.
Examples
The words after the skill name limit what it works on. A run like this adds to the setup you have and leaves the rest of the code alone.
/traceway-setup track ai useFinds the model calls in your backend, shows you the list, and instruments them. AI Traces then shows tokens, cost and conversations.
/traceway-setup instrument the background jobsGives each cron job, queue consumer and worker a task span with a stable name.
/traceway-setup only apps/workerRuns the whole setup for one directory or component.
/traceway-setup check that the setup worksChanges nothing. It runs the checks for what is already set up and reports what fails and why.
Do it by hand instead
Everything the skill does is documented. For a backend, start at OpenTelemetry and pick your language: Node.js, Python, Go, Java, .NET, Rust, Ruby, PHP, Elixir or C++. The skill's own instructions are plain Markdown in the tracewayapp/skills (opens in a new tab) repository, so you can read exactly what your agent is told to do.