Skip to main content

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:

  1. Lossless: the same data, written more compactly.
  2. Repeats only: every distinct value or kind of line shown, repeats counted.
  3. 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, then client = 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

Apache License 2.0.

Metadata

Release files for pithio 0.1.2

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

Source distribution (sdist)

Source distribution for pithio 0.1.2
File Size Uploaded Provenance Actions
pithio-0.1.2.tar.gz 1.6 MB With provenance Details for pithio-0.1.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pithio 0.1.2
File Actions
pithio-0.1.2-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for pithio-0.1.2-py3-none-win_amd64.whl
pithio-0.1.2-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for pithio-0.1.2-py3-none-manylinux_2_28_aarch64.whl
pithio-0.1.2-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.2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
pithio-0.1.2-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.2-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.2.tar.gz

Download URL pithio-0.1.2.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
ea708d4659ac4618d3dea39f2229e319f5d5fcf4b925ad32fb58705d04a7ad1f
BLAKE2b-256 checksum
How to use checksums
48f8affea6f3fc6bd3f933f2158f5afed1354f55ac56eed8ee854b1b25dd5d44
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 log

Release files / pithio-0.1.2-py3-none-win_amd64.whl

Download URL pithio-0.1.2-py3-none-win_amd64.whl
Size 6.2 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
a03c54b5b734f987a572bbfec89721a0a0122ac3d2185a8e39277af2aa3b40d6
BLAKE2b-256 checksum
How to use checksums
5b3bd0f4ce6f9ed108fff1b593c6a8e1c8199aba1900a68d9422fc91c18801a2
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 log

Release files / pithio-0.1.2-py3-none-manylinux_2_28_aarch64.whl

Download URL pithio-0.1.2-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
38cc035ddf635a23c0f8f9522fa41a5f31c83a5b68569af58dbf5f5e20defb74
BLAKE2b-256 checksum
How to use checksums
66296f6f3ad015fb902e73cf81b255a270f0234a2c8b8bebce162aa8c2555beb
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 log

Release files / pithio-0.1.2-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL pithio-0.1.2-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
61c35285862773d268f978c3b41548551858fce42c05dc968d8b71afd1b955b2
BLAKE2b-256 checksum
How to use checksums
cd54fd35523beb075d4842c35f47eb83efdc8f01bbf55ff532b2d75ec7f78386
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 log

Release files / pithio-0.1.2-py3-none-macosx_10_12_universal2.macosx_10_12_x86_64.macosx_11_0_arm64.whl

Download URL pithio-0.1.2-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
b5fb5f124c28bc3510eea08d4aa080dfa24e779870533b4ca11c7afcd4f71b2b
BLAKE2b-256 checksum
How to use checksums
9bbb46e5d465ba87e74fb30b56df2c1a44e077fef13c435ed6a27a8f46395f9e
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 log

Security for pithio 0.1.2

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.

Select from 5 files

Attestation for pithio-0.1.2.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 log

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.

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