Skip to main content

moxi-cache

Moxi's cache module tells you when an agent session's prompt cache goes cold. A read gives a session's cache one of five kinds, warm, cold, fresh, no-cache or unknown, with its age and the lifetime it counts, and a reason code whenever it gives no-cache or unknown. It reads Claude Code sessions through the sessions module's transcript reader, Codex threads from their rollout files, and OpenCode sessions from OpenCode's database, opened read-only. Codex and OpenCode lifetimes come from a lifetime table shipped with the module, keyed on harness, provider and model, which you can extend in cache's config. A watcher keeps a clock record for every live Claude Code session, a status line segment shows a session's cache age from that record, and a timer runs the commands that modules or your config subscribe, at set times before or after a session's cache expires. cache says what a session's cache is and leaves what to do about it to the caller. Other Moxi modules import it through moxi_cache.api (comms, with its cache extra, holds a send while the recipient's cache is cold), and it adds these commands:

  • moxi cache read SESSION... [--harness claude|codex|opencode] [--source PATH] [--json] prints each session's kind, age and lifetime, or why it reads no-cache or unknown. It writes nothing.
  • moxi cache segment SESSION [--color|--json] prints a Claude Code session's status line segment from the watcher's record, such as cache:12m3s, and nothing when there is no record.
  • moxi cache watch runs the watcher in the foreground. moxi cache service install|remove|status runs it as a systemd user service instead.
  • moxi cache timers [--json] lists the timer's subscriptions, the refused ones and why, and when each subscription next asks about each live session.
  • moxi cache doctor checks the config, the lifetime table, the drift record and the watcher, and exits 1 when something there stops reads.

Its settings are claude.ttl_seconds, lifetime (your own lifetime table rows), watch.tick, segment.warn_before and timer.subscriber; moxi config cache shows them.

Install

Linux, Python 3.11 or later, and uv.

uv tool install moxi
moxi install cache

Before the modules are on PyPI, install the core from git and give moxi install a git source for sessions and for cache, in that order:

uv tool install git+https://github.com/moxihq/moxi
moxi install cache \
  --from 'moxi-sessions @ git+https://github.com/moxihq/sessions' \
  --from 'moxi-cache @ git+https://github.com/moxihq/cache'

The front door's README, at moxihq/moxi, covers the moxi command and the other modules.

Dependencies

moxi, Moxi's core, and moxi-sessions. cache has no optional extras. The watcher lists live sessions with Claude Code's claude agents --json, so it needs claude on PATH or at ~/.local/bin/claude, and moxi cache service needs a systemd user manager.

License

MIT. See LICENSE.

Metadata

Release files for moxi-cache 0.1.1

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

Source distribution (sdist)

Source distribution for moxi-cache 0.1.1
File Size Uploaded Provenance
moxi_cache-0.1.1.tar.gz 104.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for moxi-cache 0.1.1
File Interpreter ABI Platform
moxi_cache-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 174.9 kB

Release files / moxi_cache-0.1.1.tar.gz

Download URL moxi_cache-0.1.1.tar.gz
Size 104.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4fb1aee3d409496655991a44429e5d7d7aa4189aa599417a4ff84cb926da8c05
BLAKE2b-256 checksum
How to use checksums
cf07eaceef5594a62ad2b63e8eed8d8cea82f5a884d8a91e33444ace6613c3d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / moxi_cache-0.1.1-py3-none-any.whl

Download URL moxi_cache-0.1.1-py3-none-any.whl
Size 70.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
96a2472d44e760149a162baa6f2d30214a154f229a78277b651e7ed09fe6be81
BLAKE2b-256 checksum
How to use checksums
015562e6ac6c97fba76eb479736252a34f1f38181432c5d2af14bdc971e08d33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for moxi-cache 0.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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