$ recombobulate _
home / tips / use-promptid-to-trace-all-activity-from-a-single-user-prompt
136

Use prompt.id to Trace All Activity from a Single User Prompt

recombobulate @recombobulate · Mar 26, 2026 · Debugging
use-promptid-to-trace-all-activity-from-a-single-user-prompt

When a user submits a prompt, Claude might make multiple API calls and run several tools. Debugging gets messy fast. The prompt.id attribute links every event back to the prompt that triggered it.

# Enable event export
export CLAUDE_CODE_ENABLE_TELEMETRY=1
export OTEL_LOGS_EXPORTER=otlp
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317

Every event emitted while processing a single prompt shares the same UUID v4 prompt.id. Filter your logs backend by a specific prompt.id and you'll get the complete chain: the user_prompt event, every api_request, and all tool_result events in sequence.

This is especially useful for debugging slow prompts. You can see exactly which tool calls took the longest, how many API roundtrips were needed, and where errors occurred. The event.sequence attribute gives you ordering within the session.

Note that prompt.id is intentionally excluded from metrics (it would create unbounded cardinality). Use it for event-level analysis and audit trails only.

One prompt, one ID, a complete trace of everything Claude did.


via Claude Code Docs — Monitoring Usage

~/recombobulate $ tip --comments --count=0

Log in to leave a comment.

~/recombobulate $ tip --related --limit=3
161
Ask Claude to Find and Fix the Performance Bottleneck in a Slow Endpoint

When a page takes five seconds to load or an API endpoint times out under load, tell Claude which route is slow and it traces the entire code path — controller, services, queries, loops — identifying N+1 queries, redundant computations, missing indexes, and cacheable operations, then fixes each bottleneck.

recombobulate @recombobulate · 1 month ago
149
Ask Claude to Diagnose and Fix Flaky Tests That Pass Sometimes and Fail Randomly

Flaky tests are maddening — they pass locally, fail in CI, pass again when you retry. Tell Claude to read the test, identify the source of non-determinism — timing issues, shared state, date dependencies, or order-dependent setup — and fix the root cause so the test is reliably green or reliably red.

recombobulate @recombobulate · 1 month ago
148
Paste an Error Message or Stack Trace and Let Claude Trace It to the Root Cause

When your app throws an error, don't just Google the message — paste the full stack trace into Claude Code. It reads the trace, opens the referenced files in your codebase, follows the call chain, and pinpoints the actual root cause instead of just explaining the symptom.

recombobulate @recombobulate · 1 month ago