Skip to main content

Module claude_transcript

Module claude_transcript 

Source
Expand description

Claude Code session transcripts (hive-mind#3570).

Claude Code writes each session to ${CLAUDE_CONFIG_DIR:-~/.claude}/projects/<cwd slug>/<session id>.jsonl. When an API error ends a run, the transcript’s last conversation entry is a synthetic assistant message with isApiErrorMessage: true, even when --output-format stream-json printed only a generic failure. Only that last entry is read, so an error an earlier turn recovered from is not reported.

Structs§

ClaudeTranscriptApiError
The API error that ended a transcript
ClaudeTranscriptOptions
Where to look for Claude transcripts

Constants§

CLAUDE_TRANSCRIPT_LIMIT_SOURCE
limit_source of a limit found in a transcript
TRANSCRIPT_TAIL_BYTES
Bytes read from the end of a transcript

Functions§

apply_claude_transcript_usage_limit
Fill a failed Claude run’s usage-limit fields from its transcript when the output did not report the limit. A killed process cannot report one.
claude_project_slugs
Project directory names Claude Code uses for a working directory: older versions replace /, newer ones every non-alphanumeric character
claude_transcript_api_error
The API error that ended a transcript, if its last conversation entry is one; otherwise why not.
claude_transcript_candidates
Transcript paths that may hold a session, most specific first
read_claude_transcript_api_error
Read the API error that ended a Claude session.