Skip to main content

Claude Code best practices

Last updated 2 min read

Coolhand ingests Claude Code sessions from the transcripts saved on disk, not by intercepting API calls in real time. Latency and temperature are never present because the transcript format does not record them; prompts, responses, token counts, and tool use are all captured once a session ends.


Logs come from session transcripts, not live API interception

Claude Code saves session transcripts locally. Coolhand ingests these after the fact — not in real time. As a result, latency and temperature are never available (they are not captured in the transcript format).


Unique fields not present in other providers

Background Agent — set to true when every user turn in the session contains only tool results (no human-typed text). Indicates the session was driven by an automated agent rather than a person. Background-agent sessions are excluded from Claude Code expertise scoring.

User Turn Count — the number of turns where a human typed something (tool-result-only turns are not counted). A value of 1 means the whole session ran on a single prompt. Useful for tracking how much human guidance a task requires over time.


Caching

Cache metadata is captured from the session transcript. Both Cached Input Tokens and Cache Creation Tokens are populated when the transcript includes them. Prompt caching is particularly effective in Claude Code sessions because the accumulated context (conversation history, tool definitions) is large and stable across turns within a session.


Structured outputs

Not applicable — Claude Code logs are session transcripts, not direct API calls you configure.


Reasoning tokens

Not separated from output tokens — same behavior as Anthropic Best Practices. Thinking content appears in the Thinking Response field when present, but the token count is rolled into the regular output token count.


Latency

Always blank. Session transcripts do not include per-turn timing information.

Related articles

  • Claude Cowork best practices

    Claude Cowork logs are ingested the same way as Claude Code: from locally saved session transcripts rather than live ...

  • GitHub Copilot best practices

    GitHub Copilot emits two different response payload shapes, and which one you get determines how much token detail Co...

  • Prompt engineering best practices

    Prefer your provider's structured-output API over asking for JSON in prose, keep instructions in a system prompt rath...

  • Anthropic API best practices

    Anthropic's Messages API carries the system prompt in a top-level `system` field rather than a message with a system ...