daseinlabs/parsec

Agent runtime optimization with Small Language Models

Rust

25

11 commits

updated Sep 18, 2026

See the code

See what people are saying (1)

SourceMessageScoreDate

Parsec: Open Token Efficiency Model + Proxy (r/opensource)

We built a model that actually looks at what agents are observed to be using and need for task completion and learned to trim the rest as well as a proxy layer to integrate it with major harnesses. When a token enters the context window its there forever or at least until compaction. Even at 1/10…

2

Sep 16, 2026

README

parsec

parsec

2× the context. ½ the cost.
Same model. Longer reach.

latest release CI MIT license

Context savings for coding agents. parsec is a local proxy and plugin for Claude Code, OpenCode, Codex CLI, pi, and Claude Desktop that cuts the tokens your agent spends per turn: it blocks wasteful re-reads, breaks command loops, and (with scoring enabled) curates the conversation context before each request, cache-safely. Savings are measured per request against the provider's own token counter, never estimated.

Everything runs on your machine with your own credentials. Model traffic never touches anyone else's infrastructure.

Install

macOS
macOS
Apple silicon
Windows
Windows
x64
Linux
Linux
x64
.pkg installersetup.exe installerone-line script

Every installer signs you in when it opens the browser, then installs the parsec binary and the Claude Code plugin. The native installers are on the releases page next to the raw binaries the scripts download.

macOS

Download parsec-<version>-macos-arm64.pkg from the releases page and open it, or run:

curl -fsSL https://raw.githubusercontent.com/daseinlabs/parsec/main/scripts/install.sh | bash

Windows

Download parsec-<version>-windows-x64-setup.exe from the releases page and run it, or in PowerShell:

irm https://raw.githubusercontent.com/daseinlabs/parsec/main/scripts/install.ps1 | iex

Linux

curl -fsSL https://raw.githubusercontent.com/daseinlabs/parsec/main/scripts/install.sh | bash

The script fetches the parsec-linux-x64 binary for the latest release and installs the plugin.

From the Claude Code CLI

claude plugin marketplace add https://github.com/daseinlabs/parsec
claude plugin install parsec@parsec-marketplace

The plugin fetches its binary from this repository's GitHub Releases on first use (sha256-verified against the release's manifest.json), so a marketplace install needs nothing else. Installed from the old daseinlabs/plugins marketplace? That repository is frozen at its last release. Switch once:

claude plugin marketplace remove parsec-marketplace
claude plugin marketplace add https://github.com/daseinlabs/parsec
claude plugin install parsec@parsec-marketplace

Then in a session: /parsec:setup routes your agent through the proxy, /parsec:savings shows what it saved, /parsec:share --preview shows exactly what opt-in telemetry would upload before anything leaves.

What parsec sends

parsec is a proxy, so this section is the contract. Everything below can be verified in packages/proxy/src and the schemas in packages/contracts.

WhenWhat leaves your machineWhereOff switch
AlwaysYour model requests, with your own auth headersThe provider you already use (api.anthropic.com by default)n/a — this is your agent's own traffic
Always, no key neededAn anonymous install ping: random install id, parsec version, OS, arch, list of configured harnesses. Sent at setup, on key changes, and every 6 hours while the proxy runs. Never your API key.parsec platformPARSEC_INSTALL_REPORT=0 or DO_NOT_TRACK=1
With scoring enabledChunk text (each chunk capped at 2000 chars) plus structural features, for keep/cut scoring. The response is scores; the service does not learn what was dropped.parsec scoring APIPARSEC_FREEZE=off, or run with no scoring endpoint
With a parsec keySavings-ledger rows: token counts per request, model, harness, conversation and request ids. No prompt text.parsec platformremove the key (/parsec:key) or unset PARSEC_PLATFORM_URL
Opt-in onlyFeaturized trace sharing (/parsec:share)parsec platformOff by default; --preview shows the exact bytes first

~/.parsec/ holds local state: the savings ledger, score memo (hashes and quantized scores only), and recordings if you enable PARSEC_RECORD_DIR. Delete it whenever you like.

Layout

PackageLanguageWhat
packages/engineRustChunking, featurization, deterministic freezing, readout. Pure library.
packages/proxyRustThe parsec binary: local proxy, hooks, MCP server, status line, harness setup.
packages/mapgenRustDeterministic repo maps, outlines, symbol lookup for the explore agent.
packages/contractsJSON SchemaCross-language schemas: scoring API, savings ledger, telemetry, install report.
packages/pluginMarkdown/JSONThe Claude Code plugin (agents, skills, hooks, launcher shims).
packages/opencode-pluginJSOpenCode plugin shim.
packages/installerShell/InnoNative macOS and Windows installer sources.
packages/brainPythonThe scoring service: GNN inference over a curator checkpoint, self-validating bundle, calibrated tau. Self-hostable.

The training pipeline and the account platform are separate, closed components. Everything here talks to them only over the contracts in packages/contracts, and runs without them.

Self-host the scoring service

The proxy runs without any scoring service (no-reread hook, loop breaker, savings ledger). Curation needs one, and you can run it yourself: it is packages/brain, one Python process holding the curator checkpoint and the bge-large encoder.

The released curator checkpoints live on the Hugging Face Hub at huggingface.co/parsecai/curator. Use curator_v7-9_10nn_prod.pt: it is self-contained and needs no neighbor store at serve time. The model card lists the other checkpoint and its calibration tables.

# 1. a curator checkpoint — fetched and cached via huggingface_hub, or a local path
pip install huggingface_hub
export PARSEC_CKPT=hf://parsecai/curator/curator_v7-9_10nn_prod.pt
# 2. the service (in-process bge-large; CPU works, a GPU is faster)
docker compose up -d                                   # http://127.0.0.1:8090
# 3. point the proxy at it
export PARSEC_BRAIN_URL=http://127.0.0.1:8090

packages/brain/README.md has the bare-uvicorn form, the auth options, and a Cloud Run recipe. A self-hosted brain is where the chunk text in "What parsec sends" goes; with your own host, nothing leaves your infrastructure.

Build

cargo build --release   # engine, proxy (the `parsec` binary), mapgen
make check              # fmt + clippy + tests, same flags CI runs
make plugin             # build and install a local plugin binary for `claude --plugin-dir`

Rust 1.98 is pinned in rust-toolchain.toml. No model download, no network needed for the Rust test suite. The scoring service's tests (make brain-test) run their hermetic subset without a checkpoint. See CONTRIBUTING.md for the dev loop.

Invariants

These are what the test suite protects; see DIRECTION.md §8.

  1. Cache stability: replayed conversations are byte-identical on every previously served turn.
  2. Parity: the Rust port matches the reference implementation byte-for-byte on freezing and vector-for-vector on featurization.
  3. Fail open, but measured: every layer degrades to passthrough, and fail-open events are counted.
  4. Measurement honesty: savings only from the count_tokens counterfactual, never a modeled baseline.

License

MIT, see LICENSE. Third-party notices and trademark note in THIRD_PARTY.md. Security reports: SECURITY.md.

Contributors

subygan

11 commits

daseinlabs/parsec

Agent runtime optimization with Small Language Models

Rust

25

11 commits

updated Sep 18, 2026

See the code

See what people are saying (1)

SourceMessageScoreDate

Parsec: Open Token Efficiency Model + Proxy (r/opensource)

We built a model that actually looks at what agents are observed to be using and need for task completion and learned to trim the rest as well as a proxy layer to integrate it with major harnesses. When a token enters the context window its there forever or at least until compaction. Even at 1/10…

2

Sep 16, 2026

README

parsec

parsec

2× the context. ½ the cost.
Same model. Longer reach.

latest release CI MIT license

Context savings for coding agents. parsec is a local proxy and plugin for Claude Code, OpenCode, Codex CLI, pi, and Claude Desktop that cuts the tokens your agent spends per turn: it blocks wasteful re-reads, breaks command loops, and (with scoring enabled) curates the conversation context before each request, cache-safely. Savings are measured per request against the provider's own token counter, never estimated.

Everything runs on your machine with your own credentials. Model traffic never touches anyone else's infrastructure.

Install

macOS
macOS
Apple silicon
Windows
Windows
x64
Linux
Linux
x64
.pkg installersetup.exe installerone-line script

Every installer signs you in when it opens the browser, then installs the parsec binary and the Claude Code plugin. The native installers are on the releases page next to the raw binaries the scripts download.

macOS

Download parsec-<version>-macos-arm64.pkg from the releases page and open it, or run:

curl -fsSL https://raw.githubusercontent.com/daseinlabs/parsec/main/scripts/install.sh | bash

Windows

Download parsec-<version>-windows-x64-setup.exe from the releases page and run it, or in PowerShell:

irm https://raw.githubusercontent.com/daseinlabs/parsec/main/scripts/install.ps1 | iex

Linux

curl -fsSL https://raw.githubusercontent.com/daseinlabs/parsec/main/scripts/install.sh | bash

The script fetches the parsec-linux-x64 binary for the latest release and installs the plugin.

From the Claude Code CLI

claude plugin marketplace add https://github.com/daseinlabs/parsec
claude plugin install parsec@parsec-marketplace

The plugin fetches its binary from this repository's GitHub Releases on first use (sha256-verified against the release's manifest.json), so a marketplace install needs nothing else. Installed from the old daseinlabs/plugins marketplace? That repository is frozen at its last release. Switch once:

claude plugin marketplace remove parsec-marketplace
claude plugin marketplace add https://github.com/daseinlabs/parsec
claude plugin install parsec@parsec-marketplace

Then in a session: /parsec:setup routes your agent through the proxy, /parsec:savings shows what it saved, /parsec:share --preview shows exactly what opt-in telemetry would upload before anything leaves.

What parsec sends

parsec is a proxy, so this section is the contract. Everything below can be verified in packages/proxy/src and the schemas in packages/contracts.

WhenWhat leaves your machineWhereOff switch
AlwaysYour model requests, with your own auth headersThe provider you already use (api.anthropic.com by default)n/a — this is your agent's own traffic
Always, no key neededAn anonymous install ping: random install id, parsec version, OS, arch, list of configured harnesses. Sent at setup, on key changes, and every 6 hours while the proxy runs. Never your API key.parsec platformPARSEC_INSTALL_REPORT=0 or DO_NOT_TRACK=1
With scoring enabledChunk text (each chunk capped at 2000 chars) plus structural features, for keep/cut scoring. The response is scores; the service does not learn what was dropped.parsec scoring APIPARSEC_FREEZE=off, or run with no scoring endpoint
With a parsec keySavings-ledger rows: token counts per request, model, harness, conversation and request ids. No prompt text.parsec platformremove the key (/parsec:key) or unset PARSEC_PLATFORM_URL
Opt-in onlyFeaturized trace sharing (/parsec:share)parsec platformOff by default; --preview shows the exact bytes first

~/.parsec/ holds local state: the savings ledger, score memo (hashes and quantized scores only), and recordings if you enable PARSEC_RECORD_DIR. Delete it whenever you like.

Layout

PackageLanguageWhat
packages/engineRustChunking, featurization, deterministic freezing, readout. Pure library.
packages/proxyRustThe parsec binary: local proxy, hooks, MCP server, status line, harness setup.
packages/mapgenRustDeterministic repo maps, outlines, symbol lookup for the explore agent.
packages/contractsJSON SchemaCross-language schemas: scoring API, savings ledger, telemetry, install report.
packages/pluginMarkdown/JSONThe Claude Code plugin (agents, skills, hooks, launcher shims).
packages/opencode-pluginJSOpenCode plugin shim.
packages/installerShell/InnoNative macOS and Windows installer sources.
packages/brainPythonThe scoring service: GNN inference over a curator checkpoint, self-validating bundle, calibrated tau. Self-hostable.

The training pipeline and the account platform are separate, closed components. Everything here talks to them only over the contracts in packages/contracts, and runs without them.

Self-host the scoring service

The proxy runs without any scoring service (no-reread hook, loop breaker, savings ledger). Curation needs one, and you can run it yourself: it is packages/brain, one Python process holding the curator checkpoint and the bge-large encoder.

The released curator checkpoints live on the Hugging Face Hub at huggingface.co/parsecai/curator. Use curator_v7-9_10nn_prod.pt: it is self-contained and needs no neighbor store at serve time. The model card lists the other checkpoint and its calibration tables.

# 1. a curator checkpoint — fetched and cached via huggingface_hub, or a local path
pip install huggingface_hub
export PARSEC_CKPT=hf://parsecai/curator/curator_v7-9_10nn_prod.pt
# 2. the service (in-process bge-large; CPU works, a GPU is faster)
docker compose up -d                                   # http://127.0.0.1:8090
# 3. point the proxy at it
export PARSEC_BRAIN_URL=http://127.0.0.1:8090

packages/brain/README.md has the bare-uvicorn form, the auth options, and a Cloud Run recipe. A self-hosted brain is where the chunk text in "What parsec sends" goes; with your own host, nothing leaves your infrastructure.

Build

cargo build --release   # engine, proxy (the `parsec` binary), mapgen
make check              # fmt + clippy + tests, same flags CI runs
make plugin             # build and install a local plugin binary for `claude --plugin-dir`

Rust 1.98 is pinned in rust-toolchain.toml. No model download, no network needed for the Rust test suite. The scoring service's tests (make brain-test) run their hermetic subset without a checkpoint. See CONTRIBUTING.md for the dev loop.

Invariants

These are what the test suite protects; see DIRECTION.md §8.

  1. Cache stability: replayed conversations are byte-identical on every previously served turn.
  2. Parity: the Rust port matches the reference implementation byte-for-byte on freezing and vector-for-vector on featurization.
  3. Fail open, but measured: every layer degrades to passthrough, and fail-open events are counted.
  4. Measurement honesty: savings only from the count_tokens counterfactual, never a modeled baseline.

License

MIT, see LICENSE. Third-party notices and trademark note in THIRD_PARTY.md. Security reports: SECURITY.md.

Contributors

subygan

11 commits

Languages

Rust

66.6%

Python

24.4%

Shell

3.1%

PowerShell

2.5%

Inno Setup

1.5%