pithio
Local context compression for AI agents. Less to read, details within reach.
pithio shortens the text and data your agents read from terminals, APIs, web pages and connected tools, before the model reads it. Every shortened output says what it left out, and the full original stays on your machine: when the agent needs a detail, it fetches it or queries it exactly.
Install and set up (two commands)
1. Install (one line, no Rust needed):
# macOS and Linux
curl -fsSL https://raw.githubusercontent.com/allenjoseph05/pithio/main/install.sh | sh
# Windows (PowerShell)
irm https://raw.githubusercontent.com/allenjoseph05/pithio/main/install.ps1 | iex
Or with a package manager: pip install pithio or npm install -g pithio. Or download the file for your system from
Releases, or build it with
cargo install --git https://github.com/allenjoseph05/pithio pithio.
2. Connect your agent:
pithio init --agent claude-code --write # or: codex, cursor, copilot, gemini
pithio doctor # checks the setup
That is all: from your agent's next session, its tool outputs are shortened. pithio dashboard shows what was saved;
pithio uninstall --agent claude-code --write removes it again.
Results
| on real developer tool output | without pithio | with pithio |
|---|---|---|
| correct answers (171 questions, Claude Haiku) | 86.5 % | 91.8 % |
| input tokens per tool output | 39,775 | 28,330 (29 % fewer) |
| correct answers on real system logs (Loghub) | 57.4 % | 74.1 %, with 60 % fewer tokens |
| tool-result tokens on GitHub API pages | 100 % | 7.8 %, every answer still visible |
How these were measured: BENCHMARKS.md.
What it shortens
- Terminals and repositories: test runs, builds, compiler diagnostics, git log and diff, file lists.
- Tables and structured data: JSON API responses, CSV and delimited tables, YAML and TOML.
- Logs and search: application logs, failed CI jobs, code and text search matches.
- Web and MCP results: fetched web pages, issue lists, search hits, database rows, connector logs.
Source files the agent is editing and short outputs are left alone. Output is never larger than the input, and the same input always gives the same output, so prompt caches keep working.
Every output says what it did
Each shortened output opens with a note naming its level:
- Lossless: the same data, written more compactly.
- Repeats only: every distinct value or kind of line shown, repeats counted.
- Focused: some parts left out; the note says what and how to get them.
test sample::case_001 ... ok
[... 79 more lines of the kinds shown above (other numbers) ...]
test sample::reports_expired_session ... FAILED
[pithio: level 2, repeats only: every kind of line is shown, repeats folded with exact counts; original 1,204 tokens: kept locally as handle 3f2a9c1e8b7d6a54]
Getting a detail back
The agent (or you) can recover anything from a shortened output by its handle:
pithio more HANDLE # read the original, page by page
pithio more HANDLE --grep timeout # matching lines
pithio q HANDLE # the tables in it and their columns
pithio q HANDLE "count status = 500" # exact counts, sums, filters and lookups (SQL)
pithio grep HANDLE "worker 7" # lines that contain a text
Other ways to use it
- In your own Python app:
pip install pithio-sdk, thenclient = pithio.wrap(anthropic.Anthropic())shortens tool results in every request and adds a recovery tool. The Node SDK (@pithio/node) is coming soon. - MCP gateway: list your MCP servers in the config, then connect your client to
pithio serve --config PATH. - Any shell command:
pithio run -- COMMAND. - Local proxy: point an Anthropic client at
http://127.0.0.1:8788(pithio proxy).
See what it saved
pithio gain # tokens saved today, this week, all time
pithio show # recent shortened outputs, each next to its original
pithio audit # checks every stored output against what its note promised
pithio dashboard # the same in a local web page
Privacy
Everything runs on your machine; pithio sends nothing anywhere. Originals are kept locally for one day
(~/.pithio); pithio forget deletes them. Outputs that look like they hold a secret are never stored.
Building from source
cargo build --release -p pithio
cargo test --release -p pithio-core -p pithio
See CONTRIBUTING.md and SECURITY.md.
Licence
Metadata
Release files for pithio 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pithio-0.1.1.tar.gz | 1.5 MB | With provenance | Details for pithio-0.1.1.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| pithio-0.1.1-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for pithio-0.1.1-py3-none-win_amd64.whl |
| pithio-0.1.1-py3-none-manylinux_2_28_aarch64.whl | Python 3 | none | Linux glibc 2.28+ ARM64 | Details for pithio-0.1.1-py3-none-manylinux_2_28_aarch64.whl |
| pithio-0.1.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | Python 3 | none | Linux glibc 2.17+ x86-64 | Details for pithio-0.1.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
| pithio-0.1.1-py3-none-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl | Python 3 | none | macOS 10.12+ x86-64, macOS 11.0+ ARM64, macOS 10.12+ universal2 (ARM64, x86-64) | Details for pithio-0.1.1-py3-none-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl |
Total release size: 31.9 MB
Release files / pithio-0.1.1.tar.gz
| Download URL | pithio-0.1.1.tar.gz |
|---|---|
| Size | 1.5 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bc2ef4ba03caa242bd7ab96db72a8c7236c3d8e96b9ada70540613744ce7f12f
|
|
BLAKE2b-256 checksum How to use checksums |
6605baa72e77d5ac969526034d03bf44a59eefd687d657ec6a773a13474b09af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Dec 3, 2026.
Transparency logRelease files / pithio-0.1.1-py3-none-win_amd64.whl
| Download URL | pithio-0.1.1-py3-none-win_amd64.whl |
|---|---|
| Size | 6.2 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
6f8f3d50dad7ee35f97f154b53f305b1866595acc10a8b72e13fc5bc797538ea
|
|
BLAKE2b-256 checksum How to use checksums |
3fc42a3fdc8164bdad7df8b3197d0ca3ad9d72b9fff6b350698a9b156ae07d7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Dec 3, 2026.
Transparency logRelease files / pithio-0.1.1-py3-none-manylinux_2_28_aarch64.whl
| Download URL | pithio-0.1.1-py3-none-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 5.9 MB |
| Tags | Linux glibc 2.28+ ARM64 Python 3 |
|
SHA-256 checksum How to use checksums |
89e552b99e85c4d2f3cce27645bd9a3445aa976ae49816f63ddfe048b642af16
|
|
BLAKE2b-256 checksum How to use checksums |
e3281021f3c162d1b57376bfb4a163344e2b5d68ae6e4e8870d6d9ca981ebdb1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Dec 3, 2026.
Transparency logRelease files / pithio-0.1.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | pithio-0.1.1-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 6.3 MB |
| Tags | Linux glibc 2.17+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
b17cadb70d0df191a2a7a95d3a5226b3dbd6b24f5d7d0ed59f052e17ecd2a243
|
|
BLAKE2b-256 checksum How to use checksums |
4ae75c75f0b8f288a84dccf8faac4e8a1900de6ecdc1259d31137a00a6e2a429
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Dec 3, 2026.
Transparency logRelease files / pithio-0.1.1-py3-none-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl
| Download URL | pithio-0.1.1-py3-none-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl |
|---|---|
| Size | 11.9 MB |
| Tags | Python 3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
ab75b276ca8e17e54ff124cbe7efb6f31fd62909639089de8fd59814500f6193
|
|
BLAKE2b-256 checksum How to use checksums |
44cfd3a2a9a4b307cb1adf3e67b4e384ce13b2355570f58ce3bbe5fe886c3ec3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Dec 3, 2026.
Transparency logSecurity for pithio 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.
Full provenance
All 5 files in this release have been uploaded with provenance metadata.
Attestation for pithio-0.1.1.tar.gz
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 Dec 3, 2026.
Transparency logA 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.