Typed events for Claude Code transcripts: discovery, a superset JSONL parser (Python + Rust), and ingestion-state tracking.
Project description
cc-transcript
The shared transcript-parsing core extracted from cc-sentiment, now powering cc-pushback, cc-sentiment, and captain-hook. It parses Claude Code's on-disk JSONL transcripts into a typed superset event model — every entry type preserved, nothing dropped — so each consumer applies its own semantic filtering on top of one faithful representation.
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 the consumer, not buried in the parser.
Install
uv add cc-transcript
Quickstart
Discover the transcripts on disk, parse one, and look at the events:
from cc_transcript import TranscriptDiscovery, parse_events, AssistantEvent, UserEvent
path, _mtime = TranscriptDiscovery.find_in(TranscriptDiscovery.find_transcripts()[0].parent)[0]
events = parse_events(path)
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])
Apply cc-sentiment's filtering rules to drop sidechains, synthetic turns, and junk:
from cc_transcript import apply_filters, SENTIMENT_FILTER
clean = list(apply_filters(events, SENTIMENT_FILTER))
What problems does this solve?
- One faithful parse, many consumers. Every project that reads 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 consumers compose their own writes in the same transaction. - Pluggable backends. A pure-Python reference parser ships today; a Rust backend behind the same
Backendprotocol reaches parity in a later release.
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.1.0.tar.gz.
File metadata
- Download URL: cc_transcript-0.1.0.tar.gz
- Upload date:
- Size: 22.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1601c7a8ecf67d5f47ebb4421418664a86db5903a85d83ba3d0d94b79748e389
|
|
| MD5 |
ad400cbc486a8b534f5a843d8eb03bb8
|
|
| BLAKE2b-256 |
afc2d0fa6bc0ddd25051b1615cccb6347fa6cb2f46e2eba0fb1014d23960cc97
|
Provenance
The following attestation bundles were made for cc_transcript-0.1.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.1.0.tar.gz -
Subject digest:
1601c7a8ecf67d5f47ebb4421418664a86db5903a85d83ba3d0d94b79748e389 - Sigstore transparency entry: 1754818242
- Sigstore integration time:
-
Permalink:
yasyf/cc-transcript@4b3c24ef7891edfe4fae415c87b8dd673937f71c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/yasyf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@4b3c24ef7891edfe4fae415c87b8dd673937f71c -
Trigger Event:
push
-
Statement type:
File details
Details for the file cc_transcript-0.1.0-cp313-abi3-manylinux_2_28_x86_64.whl.
File metadata
- Download URL: cc_transcript-0.1.0-cp313-abi3-manylinux_2_28_x86_64.whl
- Upload date:
- Size: 471.4 kB
- 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 |
7ad7c272859dc23dbe7a9fa6799dfc7c768d6d695202fdcc0ab0c7237bb2e3d0
|
|
| MD5 |
7fd49d0de9e0b3d3ad0e4739779172f9
|
|
| BLAKE2b-256 |
d00be35edadcf982d7ce6839a0b200b19f9c998e70726b5c99764a643e5410b2
|
Provenance
The following attestation bundles were made for cc_transcript-0.1.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.1.0-cp313-abi3-manylinux_2_28_x86_64.whl -
Subject digest:
7ad7c272859dc23dbe7a9fa6799dfc7c768d6d695202fdcc0ab0c7237bb2e3d0 - Sigstore transparency entry: 1754818359
- Sigstore integration time:
-
Permalink:
yasyf/cc-transcript@4b3c24ef7891edfe4fae415c87b8dd673937f71c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/yasyf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@4b3c24ef7891edfe4fae415c87b8dd673937f71c -
Trigger Event:
push
-
Statement type:
File details
Details for the file cc_transcript-0.1.0-cp313-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: cc_transcript-0.1.0-cp313-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 445.3 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 |
dcc52adf540577ea5ad0cfd872215253728b50179f8bbba6ac2e0cd8e7cb4524
|
|
| MD5 |
cbd9270cba9f2723d19ddef138d72c7e
|
|
| BLAKE2b-256 |
796d7932ea30861e4477451a8df9f1c0b7d89fdf9ea0369730207b974c6808d7
|
Provenance
The following attestation bundles were made for cc_transcript-0.1.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.1.0-cp313-abi3-manylinux_2_28_aarch64.whl -
Subject digest:
dcc52adf540577ea5ad0cfd872215253728b50179f8bbba6ac2e0cd8e7cb4524 - Sigstore transparency entry: 1754818329
- Sigstore integration time:
-
Permalink:
yasyf/cc-transcript@4b3c24ef7891edfe4fae415c87b8dd673937f71c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/yasyf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@4b3c24ef7891edfe4fae415c87b8dd673937f71c -
Trigger Event:
push
-
Statement type:
File details
Details for the file cc_transcript-0.1.0-cp313-abi3-macosx_11_0_x86_64.whl.
File metadata
- Download URL: cc_transcript-0.1.0-cp313-abi3-macosx_11_0_x86_64.whl
- Upload date:
- Size: 434.0 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 |
e22c7a326e5910bef1348bed6bcf3f70c234b164d156e737260322fd162179c4
|
|
| MD5 |
752bca92ec5cd79eededd07925657028
|
|
| BLAKE2b-256 |
bd030a2ecfa7b565ca7d37c68630a163942b2104b2a05ad0a1ac4be52fa27826
|
Provenance
The following attestation bundles were made for cc_transcript-0.1.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.1.0-cp313-abi3-macosx_11_0_x86_64.whl -
Subject digest:
e22c7a326e5910bef1348bed6bcf3f70c234b164d156e737260322fd162179c4 - Sigstore transparency entry: 1754818307
- Sigstore integration time:
-
Permalink:
yasyf/cc-transcript@4b3c24ef7891edfe4fae415c87b8dd673937f71c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/yasyf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@4b3c24ef7891edfe4fae415c87b8dd673937f71c -
Trigger Event:
push
-
Statement type:
File details
Details for the file cc_transcript-0.1.0-cp313-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: cc_transcript-0.1.0-cp313-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 407.2 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 |
86893a0a2bc3215b80b3210df0ae1f77ad47911c1da9a1990e4224edfbd2f3b1
|
|
| MD5 |
ea9352c98dc3e4e68931bebd6bc109cb
|
|
| BLAKE2b-256 |
ad929bfafe4263d1bbd7f70c4f5e1defdabe8aca44043ce0915449b3bd74b4bf
|
Provenance
The following attestation bundles were made for cc_transcript-0.1.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.1.0-cp313-abi3-macosx_11_0_arm64.whl -
Subject digest:
86893a0a2bc3215b80b3210df0ae1f77ad47911c1da9a1990e4224edfbd2f3b1 - Sigstore transparency entry: 1754818250
- Sigstore integration time:
-
Permalink:
yasyf/cc-transcript@4b3c24ef7891edfe4fae415c87b8dd673937f71c -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/yasyf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@4b3c24ef7891edfe4fae415c87b8dd673937f71c -
Trigger Event:
push
-
Statement type: