Skip to main content

cctx

Claude Code context utility: see what a session costs, cut it where you want, and put a price on the subscription buckets.

Reads the transcripts Claude Code writes under ~/.claude/projects/ and never modifies them in place unless you ask (trim, repair). Every other operation writes a new file.

pip install lykos-cctx

The command is cctx. A <session> argument is a session-id prefix, an agent id, a title fragment, or a path to a .jsonl.

Sessions

command what it does
cctx list sessions across all projects; --agents includes subagent transcripts
cctx show <session> numbered turns, so you can pick a cut point
cctx fork <session> plain copy, what fork-before-compact does
cctx fork <session> --until 42 rewind: keep turns 1 to 42
cctx fork <session> --from 43 trim: drop turns 1 to 42, insert a native boundary marker
cctx splice <src> --onto <dst> append a range of turns onto another session
cctx verify <session> integrity check: parse, chain, parent links
cctx repair <session> fix broken parentUuid links that silently truncate context

Cost

command what it does
cctx rounds <session> context added per turn, carry cost, tool hogs, cold-cache rewrites with their cause, and every subagent the session spawned
cctx tokens <session> per-call context growth
cctx compact <session> what each compaction saved and what the next turns paid
cctx cost spend by day, model, project and session across the machine, fork-deduplicated
cctx limits what a percent of the 5h, 7d and Fable buckets costs, from the cc-shim usage ledger

Costs are API-equivalent dollars from a built-in price table and ITE, input-token-equivalents, a model-agnostic unit (cache write 1.25×, cache read 0.10×, output 5× an input token).

What it knows about the format

docs/FORMAT.md is a measured reference for the transcript format: the linked-list structure, the four kinds of user record, how usage is restated across a call's records, subagent transcripts, wake-up records, and what the transcripts do not contain. Everything in it was verified against real files and says so.

Development

pip install -e . pytest
pytest -q

Releases are tags: push vX.Y.Z and CI tests, builds, publishes to PyPI and creates the GitHub release. The version comes from the tag.

Metadata

Release files for lykos-cctx 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lykos-cctx 0.3.0
File Size Uploaded
lykos_cctx-0.3.0.tar.gz 57.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lykos-cctx 0.3.0
File Interpreter ABI Platform
lykos_cctx-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 100.4 kB

Release files / lykos_cctx-0.3.0.tar.gz

Download URL lykos_cctx-0.3.0.tar.gz
Size 57.3 kB
Tags Source
SHA-256 checksum
How to use checksums
6ee569d983136007f596373ac9dd1a60d493f79412bbdeec958b225e2f5f9fe2
BLAKE2b-256 checksum
How to use checksums
e3b7c40df463e6c23dc23e648a6c634526a8fbda3149203dfeab5c0454f01095
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release files / lykos_cctx-0.3.0-py3-none-any.whl

Download URL lykos_cctx-0.3.0-py3-none-any.whl
Size 43.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b77fb443546424f11da0359a784d05d9467c3e97f06b6ba80dfdbd0bd4c25f11
BLAKE2b-256 checksum
How to use checksums
076464398012c0e5bdfbf9cad6295f65da27305ed251f25e2a518395937f4e45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page