Typed events for Claude Code transcripts: discovery, a superset JSONL parser (Python + Rust), and ingestion-state tracking.
Project description
cc-transcript
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, viaFilterConfig. - Incremental ingestion.
FileStateStoretracks 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
Backendprotocol 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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8bcabf9d35cf3a07ef66982d8849f07d5307dd77b3aea188a33315ad5e47a1ef
|
|
| MD5 |
a2957f38720211d3611a57637ac56432
|
|
| BLAKE2b-256 |
cf7c36342b1ed31951135a3734a68bf813c7f9570ce750ae776310a79043e20a
|
Provenance
The following attestation bundles were made for cc_transcript-0.3.0.tar.gz:
Publisher:
release-pypi.yml on yasyf/cc-transcript
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cc_transcript-0.3.0.tar.gz -
Subject digest:
8bcabf9d35cf3a07ef66982d8849f07d5307dd77b3aea188a33315ad5e47a1ef - Sigstore transparency entry: 1755143033
- Sigstore integration time:
-
Permalink:
yasyf/cc-transcript@4691ab7cb6019bf277c945c9021ede18bb352074 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/yasyf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@4691ab7cb6019bf277c945c9021ede18bb352074 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cc_transcript-0.3.0-cp313-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: cc_transcript-0.3.0-cp313-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 1.0 MB
- Tags: CPython 3.13+, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3af7c720868f1dae9b3b988861a78d317ece4c281ec81d46e066a82dbc58caa
|
|
| MD5 |
9cd89bd2d49fdb40c601cbd2ce2b8bba
|
|
| BLAKE2b-256 |
92b9aaf1b70ddc9fed6e8ec5073b0cec77aadc3e24c948b8d503432fa8d10096
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cc_transcript-0.3.0-cp313-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
e3af7c720868f1dae9b3b988861a78d317ece4c281ec81d46e066a82dbc58caa - Sigstore transparency entry: 1755143048
- Sigstore integration time:
-
Permalink:
yasyf/cc-transcript@4691ab7cb6019bf277c945c9021ede18bb352074 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/yasyf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@4691ab7cb6019bf277c945c9021ede18bb352074 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cc_transcript-0.3.0-cp313-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: cc_transcript-0.3.0-cp313-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 981.2 kB
- Tags: CPython 3.13+, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ad0d2e49eda7f5ebc4d9b4d397a0e050e51e1dca799399d0f6b68ee365747b8
|
|
| MD5 |
861fc18b94e425cc6d2bb6fbf3d09ba1
|
|
| BLAKE2b-256 |
641ac5170396e27f0fcfef52dc578a97b818d1d6899ad99a372976187c7b9eb8
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cc_transcript-0.3.0-cp313-abi3-manylinux_2_28_aarch64.whl -
Subject digest:
5ad0d2e49eda7f5ebc4d9b4d397a0e050e51e1dca799399d0f6b68ee365747b8 - Sigstore transparency entry: 1755143115
- Sigstore integration time:
-
Permalink:
yasyf/cc-transcript@4691ab7cb6019bf277c945c9021ede18bb352074 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/yasyf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@4691ab7cb6019bf277c945c9021ede18bb352074 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cc_transcript-0.3.0-cp313-abi3-macosx_11_0_x86_64.whl.
File metadata
- Download URL: cc_transcript-0.3.0-cp313-abi3-macosx_11_0_x86_64.whl
- Upload date:
- Size: 976.5 kB
- Tags: CPython 3.13+, macOS 11.0+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4f75274d52518cac8fc9f014c3443646f81df99f140896ae2843ce198c53c82
|
|
| MD5 |
6247de699f07ebf5d355c8ed9c655a13
|
|
| BLAKE2b-256 |
4c62add32e4cc6f5aac66a96736dbac8362d3abfb52b7e9b0edd8e1e25ac80f2
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cc_transcript-0.3.0-cp313-abi3-macosx_11_0_x86_64.whl -
Subject digest:
e4f75274d52518cac8fc9f014c3443646f81df99f140896ae2843ce198c53c82 - Sigstore transparency entry: 1755143040
- Sigstore integration time:
-
Permalink:
yasyf/cc-transcript@4691ab7cb6019bf277c945c9021ede18bb352074 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/yasyf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@4691ab7cb6019bf277c945c9021ede18bb352074 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cc_transcript-0.3.0-cp313-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: cc_transcript-0.3.0-cp313-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 913.8 kB
- Tags: CPython 3.13+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c32fef23b05d41175c04529a637bf1168d15dfb3d8a344551315da00179d709
|
|
| MD5 |
c49e2a8f725eff5afd452b25eda5ef70
|
|
| BLAKE2b-256 |
14dc2ca9710eb461bef7fc62d4598474b00b2bab83c1cc1f5a60f9956b4c60c1
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cc_transcript-0.3.0-cp313-abi3-macosx_11_0_arm64.whl -
Subject digest:
6c32fef23b05d41175c04529a637bf1168d15dfb3d8a344551315da00179d709 - Sigstore transparency entry: 1755143057
- Sigstore integration time:
-
Permalink:
yasyf/cc-transcript@4691ab7cb6019bf277c945c9021ede18bb352074 -
Branch / Tag:
refs/tags/v0.3.0 - Owner: https://github.com/yasyf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@4691ab7cb6019bf277c945c9021ede18bb352074 -
Trigger Event:
push
-
Statement type: