Reference
Classes
Core classes
- TranscriptDiscovery
-
Locates Claude Code transcript files on disk.
- TranscriptParser
-
The public facade over the active parsing backend.
- FileStateStore
-
Tracks which transcript files have been ingested, keyed by mtime.
- rust.RustBackend
-
The Rust parsing backend, at full event parity with
PythonBackend. - parser.PythonBackend
-
The reference pure-Python parsing backend.
- sentiment.NLP
-
Lazy loader for the spaCy
en_core_web_smmodel used to lemmatize text. - sentiment.ConversationBucketer
-
Groups transcript messages into per-session, time-aligned buckets worth scoring.
- sentiment.Lexicon
-
Token-polarity lookup: AFINN base scores layered with coding-domain overrides.
FileStateStore Methods
Methods for the FileStateStore class
- FileStateStore.open()
-
Opens (creating if needed) the store at
path. - FileStateStore.close()
-
Closes the underlying connection.
- FileStateStore.__aenter__()
- FileStateStore.__aexit__()
- FileStateStore.transaction()
-
Yields the locked connection inside a single committed transaction.
- FileStateStore.file_mtimes()
-
Returns the recorded
pathtomtimemap. - FileStateStore.record_file()
-
Upserts the recorded mtime for
path. - FileStateStore.upsert_file()
Dataclasses
Data-holding classes
- ParsedTranscript
-
The parsed events of a single transcript file.
- FilterConfig
-
Opt-in, consumer-side filtering of a transcript event stream.
- FilterSpec
-
An ordered list of
Clauserules applied to an event stream. - AssistantEvent
-
An assistant turn.
- EntryMeta
-
Envelope metadata shared by the conversational transcript events.
- ModeEvent
-
A mode or permission-mode change marker.
- OtherEvent
-
Any recognized entry without a guaranteed conversational envelope.
- SystemEvent
-
A system entry, such as a hook summary or notice.
- TextBlock
-
A text content block from a user or assistant message.
- ThinkingBlock
-
An extended-thinking content block emitted by the assistant.
- ToolResultBlock
-
The result of a tool invocation, delivered in a user turn.
- ToolUseBlock
-
An assistant request to invoke a tool.
- UserEvent
-
A user turn.
- filterspec.KindIs
-
Matches events whose kind is in
kinds. - filterspec.MetaFlag
-
Matches when an
~cc_transcript.models.EntryMetaboolean is set. - filterspec.EntrypointIn
-
Matches when
meta.entrypointis inentrypoints. - filterspec.ModelIs
-
Matches assistant events whose
modelis inmodels. - filterspec.TextEmpty
-
Matches events with blank text.
- filterspec.TextMatchesAny
-
Matches when the event text matches any of the named regex
groups. - filterspec.TextInSet
-
Matches when the normalized event text is in
phrases. - filterspec.WordCountAtMost
-
Matches when the event text has at most
nwhitespace-split words. - filterspec.Clause
-
One filter rule: when
predicateholds, applyaction. - builders.Clause
-
One filter rule: when
predicateholds, applyaction. - builders.EntrypointIn
-
Matches when
meta.entrypointis inentrypoints. - builders.KindIs
-
Matches events whose kind is in
kinds. - builders.MetaFlag
-
Matches when an
~cc_transcript.models.EntryMetaboolean is set. - builders.ModelIs
-
Matches assistant events whose
modelis inmodels. - builders.TextEmpty
-
Matches events with blank text.
- builders.TextInSet
-
Matches when the normalized event text is in
phrases. - builders.TextMatchesAny
-
Matches when the event text matches any of the named regex
groups. - builders.WordCountAtMost
-
Matches when the event text has at most
nwhitespace-split words. - filters.Clause
-
One filter rule: when
predicateholds, applyaction. - filters.EntrypointIn
-
Matches when
meta.entrypointis inentrypoints. - filters.KindIs
-
Matches events whose kind is in
kinds. - filters.MetaFlag
-
Matches when an
~cc_transcript.models.EntryMetaboolean is set. - filters.ModelIs
-
Matches assistant events whose
modelis inmodels. - filters.TextEmpty
-
Matches events with blank text.
- filters.TextMatchesAny
-
Matches when the event text matches any of the named regex
groups. - sentiment.FilteredEngine
-
Wraps an
InferenceEnginewith aScoreSpec: short-circuit - sentiment.FrustrationShortCircuit
-
Pre-empts inference with
scorewhen a user message matchesgroups. - sentiment.MildIrritationDemote
-
Lowers
from_scoretoto_scorefor mild-impatience messages that are not hostile. - sentiment.PositiveClamp
-
Lowers
from_scoretoto_scorewhen a short user message lacks positive lexicon. - sentiment.ResumeClamp
-
Clamps to
to_scorewhen a user message is a bare resume phrase. - sentiment.ScoreSpec
-
An ordered list of
ScoreStageapplied around model inference.
Protocols
Structural typing protocols
- Backend
-
A transcript-parsing backend.
- sentiment.InferenceEngine
Enumerations
Enum types
- filterspec.Action
-
What a matching
Clausedoes to an event.
Named Tuples
NamedTuple types
- AssistantMessage
-
An assistant turn distilled for analysis: its text, tool calls, and responding model.
- ToolCall
-
A single tool invocation within a message: the tool
nameand optional target file path. - UserMessage
-
A user turn distilled for analysis: its text, tool calls, and authoring metadata.
- sentiment.BucketKey
-
Stable identity of a
ConversationBucket: its session and bucket index. - sentiment.ConversationBucket
-
A session’s messages grouped into one fixed-width time window — the unit that gets scored.
Functions
Public functions
- build_spec()
-
Flattens
Clause/tuple[Clause, ...]fragments into aFilterSpec. - drop_compacted()
-
Drops compaction-summary and transcript-only entries.
- drop_empty()
-
Drops blank events of one kind.
- drop_entrypoints()
-
Drops events whose
meta.entrypointis inentrypoints. - drop_junk()
-
Drops events matching any group in the named
JUNK_CATEGORIES. - drop_meta_flag()
-
Drops events whose
EntryMetabooleanflagis set. - drop_phrases()
-
Drops events whose normalized text is one of
phrases. - drop_short()
-
Drops events with at most
max_wordswhitespace-split words. - drop_sidechain()
-
Drops sidechain events;
except_assistantskeeps assistant sidechains. - drop_synthetic()
-
Drops assistant events with the
<synthetic>model. - keep_only()
-
Drops every event whose kind is not in
kinds. - apply_filters()
-
Yields the events that survive
config. - annotate_spec()
-
Yields
(event, labels)for events survivingspec, with TAG labels. - apply_spec()
-
Yields the events that survive every
DROPclause ofspec. - keep()
-
Returns whether
eventsurvives everyDROPclause ofspec. - labels_for()
-
Returns the TAG labels
specrecords forevent, in clause order. - parse_event()
- parse_events_from_bytes()
- rust.is_portable()
-
Returns whether every clause is executable by the Rust interpreter.
- rust.spec_to_json()
-
Serializes
specto the JSON contract consumed by the Rust backend. - parser.parse_meta()
- parser.flatten_result_content()
- parser.parse_user_blocks()
- parser.parse_assistant_blocks()
- parser.parse_assistant_block()
- parser.decode_line()
- parser.parse_one()
- parser.parse_one_filtered()
- parser.load_rust_backend()
- filterspec.compile_groups()
- filterspec.event_kind()
- filterspec.event_text()
- filterspec.event_meta()
- filterspec.normalize_bare()
- filterspec.predicate_matches()
- filterspec.meta_flag()
- filterspec.clause_matches()
- filterspec.is_portable()
-
Returns whether every clause is executable by the Rust interpreter.
- filterspec.clause_portable()
- filterspec.spec_to_json()
-
Serializes
specto the JSON contract consumed by the Rust backend. - filterspec.clause_to_dict()
- filterspec.predicate_to_dict()
- filters.compile_groups()
- sentiment.NOOP_PROGRESS()
- sentiment.build_score_spec()
-
Assembles
stagesinto aScoreSpecfor the engine to apply around inference. - sentiment.clamp_positive()
-
Composes the post-process stage that lowers a top score on a short message lacking positive lexicon.
- sentiment.clamp_resume()
-
Composes the post-process stage that neutralizes a bare resume phrase to a middling score.
- sentiment.demote_mild_irritation()
-
Composes the post-process stage that softens a non-hostile mild-impatience message off the floor score.
- sentiment.extract_bucket_keys()
-
Returns the
BucketKeyof every scorable bucket inmessages. - sentiment.flag_frustration()
-
Composes the short-circuit stage that pins a frustrated message to
scorebefore inference.
Async Functions
Asynchronous functions
Constants
Module-level constants and data
- CcVersion
- EntryUuid
- SessionId
- ToolUseId
- parser.ContentBlock
- parser.TranscriptEvent
- parser.INTERRUPT_MARKER
- parser.build_event
- models.ContentBlock
- models.TranscriptEvent
- filterspec.TranscriptEvent
- filterspec.EventKind
- filterspec.MetaFlagName
- filterspec.TRAILING_PUNCT
- filterspec.STRUCTURAL_TAG_GROUP
- filterspec.STRUCTURAL_GROUPS
- filterspec.AGENT_INJECTION_GROUPS
- filterspec.INTERRUPT_MARKER_GROUPS
- filterspec.STOP_HOOK_GROUPS
- filterspec.CONTINUATION_GROUPS
- filterspec.COMMAND_ECHO_GROUPS
- filterspec.JUNK_CATEGORIES
- filterspec.STRUCTURAL_NOISE_GROUPS
- filterspec.SENTIMENT_JUNK_GROUPS
- filterspec.FRUSTRATION_GROUPS
- filterspec.MILD_IMPATIENCE_GROUPS
- filterspec.PORTABLE_GROUP_NAMES
- filterspec.RESUME_PHRASE_SET
- filterspec.TRIVIAL_ACK_SET
- filterspec.SHORT_MESSAGE_MAX_WORDS
- filterspec.CONVERSATIONAL
- filterspec.USERS
- filterspec.ASSISTANTS
- filterspec.Predicate
- filterspec.STRUCTURAL_NOISE_RE
- filterspec.INTERRUPT_MARKER_RE
- filterspec.STOP_HOOK_RE
- backend.TranscriptEvent
- builders.ASSISTANTS
- builders.JUNK_CATEGORIES
- builders.USERS
- builders.EventKind
- builders.MetaFlagName
- builders.NOISE_SPEC
- store.FILE_SCHEMA
- discovery.CLAUDE_PROJECTS_DIR
- filters.ASSISTANTS
- filters.SENTIMENT_JUNK_GROUPS
- filters.USERS
- filters.EventKind
- filters.TranscriptEvent
- filters.JUNK_USER_MESSAGE_RE
- filters.KIND_BY_TYPE
- messages.BaseMessage
- messages.TranscriptMessage
- sentiment.BUCKET_MINUTES
- sentiment.MIN_USER_CHARS
- sentiment.MIN_USER_TURNS_PER_SESSION
- sentiment.BaseMessage
- sentiment.BucketIndex
- sentiment.ScoreStage
- sentiment.SentimentScore
- sentiment.TranscriptMessage
Other
Additional exports
- domains
-
Built-in domains layered on the cc-transcript core.