Skip to main content

Typed events for Claude Code transcripts: discovery, a superset JSONL parser (Python + Rust), and ingestion-state tracking.

Project description

cc-transcript

PyPI Python Docs License: PolyForm Noncommercial

cc-transcript parses Claude Code's on-disk JSONL transcripts into a typed superset event model — every entry type preserved, nothing dropped — so you build on one faithful representation and apply your own semantic filtering on top.

The one property that makes it worth using: the parser is non-lossy. It never silently discards sidechains, synthetic turns, tool results, or unrecognized entry types; filtering is opt-in and lives in your code, not buried in the parser.

Install

uv add cc-transcript        # or: pip install cc-transcript

Quickstart

Discover the transcripts on disk, parse one, and look at the events:

from cc_transcript import TranscriptDiscovery, parse_events, AssistantEvent, UserEvent

events = parse_events(TranscriptDiscovery.find_transcripts()[0])

for event in events:
    match event:
        case UserEvent(text=text):
            print("user:", text[:80])
        case AssistantEvent(model=model, text=text):
            print(f"assistant ({model}):", text[:80])

SENTIMENT_FILTER is a ready-made filter that keeps only user and assistant turns, dropping sidechains, synthetic turns, compacted summaries, empty events, and tool/command noise:

from cc_transcript import apply_filters, SENTIMENT_FILTER

clean = list(apply_filters(events, SENTIMENT_FILTER))

Build your own with FilterConfig — every rule is off by default, so a bare FilterConfig() passes everything through.

What problems does this solve?

  • One faithful parse. Anything reading Claude Code transcripts re-implements the same JSONL quirks (str-or-list content, tool results nested two ways, envelope-less mode markers). This is that parser, written once and typed strictly.
  • Non-lossy by design. The event model is a superset: sidechains, <synthetic> turns, thinking blocks, and unrecognized entry types all survive parsing. You decide what to drop, via FilterConfig.
  • Incremental ingestion. FileStateStore tracks per-file mtimes in SQLite (WAL, thread-safe) so re-runs only reparse changed files, and you compose your own writes in the same transaction.
  • Pluggable backends. A Rust backend (PyO3 + rayon) is the default fast path, with a pure-Python reference parser behind the same Backend protocol as the fallback — both at full event parity.

Docs

Read the docs for the full guide and API reference.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cc_transcript-0.3.0.tar.gz (36.5 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

cc_transcript-0.3.0-cp313-abi3-manylinux_2_28_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.13+manylinux: glibc 2.28+ x86-64

cc_transcript-0.3.0-cp313-abi3-manylinux_2_28_aarch64.whl (981.2 kB view details)

Uploaded CPython 3.13+manylinux: glibc 2.28+ ARM64

cc_transcript-0.3.0-cp313-abi3-macosx_11_0_x86_64.whl (976.5 kB view details)

Uploaded CPython 3.13+macOS 11.0+ x86-64

cc_transcript-0.3.0-cp313-abi3-macosx_11_0_arm64.whl (913.8 kB view details)

Uploaded CPython 3.13+macOS 11.0+ ARM64

File details

Details for the file cc_transcript-0.3.0.tar.gz.

File metadata

  • Download URL: cc_transcript-0.3.0.tar.gz
  • Upload date:
  • Size: 36.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cc_transcript-0.3.0.tar.gz
Algorithm Hash digest
SHA256 8bcabf9d35cf3a07ef66982d8849f07d5307dd77b3aea188a33315ad5e47a1ef
MD5 a2957f38720211d3611a57637ac56432
BLAKE2b-256 cf7c36342b1ed31951135a3734a68bf813c7f9570ce750ae776310a79043e20a

See more details on using hashes here.

Provenance

The following attestation bundles were made for cc_transcript-0.3.0.tar.gz:

Publisher: release-pypi.yml on yasyf/cc-transcript

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cc_transcript-0.3.0-cp313-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for cc_transcript-0.3.0-cp313-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e3af7c720868f1dae9b3b988861a78d317ece4c281ec81d46e066a82dbc58caa
MD5 9cd89bd2d49fdb40c601cbd2ce2b8bba
BLAKE2b-256 92b9aaf1b70ddc9fed6e8ec5073b0cec77aadc3e24c948b8d503432fa8d10096

See more details on using hashes here.

Provenance

The following attestation bundles were made for cc_transcript-0.3.0-cp313-abi3-manylinux_2_28_x86_64.whl:

Publisher: release-pypi.yml on yasyf/cc-transcript

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cc_transcript-0.3.0-cp313-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for cc_transcript-0.3.0-cp313-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 5ad0d2e49eda7f5ebc4d9b4d397a0e050e51e1dca799399d0f6b68ee365747b8
MD5 861fc18b94e425cc6d2bb6fbf3d09ba1
BLAKE2b-256 641ac5170396e27f0fcfef52dc578a97b818d1d6899ad99a372976187c7b9eb8

See more details on using hashes here.

Provenance

The following attestation bundles were made for cc_transcript-0.3.0-cp313-abi3-manylinux_2_28_aarch64.whl:

Publisher: release-pypi.yml on yasyf/cc-transcript

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cc_transcript-0.3.0-cp313-abi3-macosx_11_0_x86_64.whl.

File metadata

File hashes

Hashes for cc_transcript-0.3.0-cp313-abi3-macosx_11_0_x86_64.whl
Algorithm Hash digest
SHA256 e4f75274d52518cac8fc9f014c3443646f81df99f140896ae2843ce198c53c82
MD5 6247de699f07ebf5d355c8ed9c655a13
BLAKE2b-256 4c62add32e4cc6f5aac66a96736dbac8362d3abfb52b7e9b0edd8e1e25ac80f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for cc_transcript-0.3.0-cp313-abi3-macosx_11_0_x86_64.whl:

Publisher: release-pypi.yml on yasyf/cc-transcript

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cc_transcript-0.3.0-cp313-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for cc_transcript-0.3.0-cp313-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6c32fef23b05d41175c04529a637bf1168d15dfb3d8a344551315da00179d709
MD5 c49e2a8f725eff5afd452b25eda5ef70
BLAKE2b-256 14dc2ca9710eb461bef7fc62d4598474b00b2bab83c1cc1f5a60f9956b4c60c1

See more details on using hashes here.

Provenance

The following attestation bundles were made for cc_transcript-0.3.0-cp313-abi3-macosx_11_0_arm64.whl:

Publisher: release-pypi.yml on yasyf/cc-transcript

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page