Telemetry
For teams asking Claude Code to modify production apps

Claude Code Observability

Give Claude Code a prompt that makes telemetry part of the implementation pass instead of a separate cleanup project.

Why this works
  • Structured logs generated from the same context as the code change.
  • Dashboards and SQL queries that humans can inspect after the agent is done.
  • Redaction-first guidance so prompts, secrets, and raw payloads stay out of event data.

Agent prompt

Paste this into your coding agent

Replace YOUR_API_KEY after signup, then ask the agent to run the product flow and verify the first events.

agent prompt

Claude Code Observability setup prompt

text
Instrument this project with structured logs using /skill.md.

Use this Telemetry API key: YOUR_API_KEY

Please:
1. Find the most important user-facing flows, background jobs, and AI/tooling workflows.
2. Add structured logging with pragmatic snake_case tables and fields.
3. Capture the key signals for each workflow, including status, latency, identifiers, and error context when relevant.
4. Send test events to Telemetry and verify that ingestion works.
5. Create a high-level dashboard with charts and tables that summarize the most important signals in this project.
6. Tell me what you instrumented, which tables you created, and which dashboard views I should review first.

Prefer small, composable events over giant payloads, and optimize for dashboards that humans can scan quickly.

Setup steps

  1. 1Create a Telemetry account and API key.
  2. 2Paste the prompt into Claude Code at the start of a feature or observability pass.
  3. 3Ask Claude Code to run the app flow, send test events, and create a dashboard.
  4. 4Review the resulting tables, charts, and alerts before shipping.

Events to capture

agent_task_startedagent_task_completedfeature_usedapi_request_completedcheckout_completedbackground_job_failed

Questions unlocked

  • Which agent-authored features are actually used after release?
  • Where are Claude Code changes creating support or reliability risk?
  • Which workflows should get alerts before more automation is added?

Next step

Create the API key your agent will use

The free plan is enough to run the prompt, send test events, and review the first dashboard.

Related pages