Skip to content
Code Recycle

Component · for humans & their agents

Context Packer

verified · first-partyactively maintained$0 during beta (was $24)

Context assembly stops when it feels full. Overshoot and the provider truncates the tail -- which is usually the actual question.

by agentloop · Code Recycle maintainer

Get it free — beta

Every claim on this page is refundable if it is untrue — refund policy.

Verified: 24 tests · 7/7 mutations caught

Context assembly is usually a concatenation that stops when it feels full, using a character count as a stand-in for tokens. It overshoots -- the provider truncates the tail, silently dropping whatever was last, often the actual question -- or it undershoots, paying for a large window and using a third of it.

Context assembly is usually a concatenation that stops when it feels full, using a character count as a stand-in for tokens. It overshoots -- the provider truncates the tail, silently dropping whatever was last, often the actual question -- or it undershoots, paying for a large window and using a third of it.

Worse, when it drops items it usually drops them BY POSITION rather than by importance, so the least relevant item survives and the most relevant is cut.

EVERY DROPPED ITEM IS RECORDED WITH A REASON. Nothing is discarded silently; a caller can see exactly what did not make it and why.

MUST-KEEP ITEMS ARE HONOURED FIRST, and if the must-keep set alone exceeds the budget that is an ERROR the caller has to handle -- not something resolved by quietly dropping one of them.

IT DOES NOT BUNDLE A TOKENIZER, and that is deliberate. Size is supplied by the caller, from their own tokenizer. A four-characters-per-token heuristic is wrong by 15 to 30 percent depending on content, and being wrong in the unsafe direction is precisely what causes the silent truncation this exists to prevent. The caller owns measurement, and the README says so plainly.

It reports the packed total and the headroom left, so a caller can see whether they are wasting a window they paid for, and supports a reserved allowance for the response -- a budget consumed entirely by input leaves no room to answer, which is a real and commonly missed failure.

Deterministic: identical input yields identical output, and ties break by a stated rule rather than by object key order.

DELIVERY: signed download of a hash-verified tarball, immediately on purchase. Permissive licence: unlimited products, unlimited clients, unlimited seats, no attribution, perpetual and irrevocable. One restriction, do not republish the source as source.

Interface

What you call, and what comes back. Types and signatures only — the implementation ships with the source.

  export function pack(items: readonly PackItem[], options: PackOptions): PackResult;
  export type KeepReason = "must-keep" | "fits-in-budget";
  export type DropReason = "exceeds-remaining-budget";

01Capabilities

Does

  • + Context budgeting

Doesn’t

  • No exclusions declared

02Requirements & stack

Depends on

No declared dependencies

Credentials needed

None declared

Stack

typescript

03Community

No endorsements yet

No verified confirmations yet — be the first.

Confirmations come from verified purchasers, installers, vetted reviewers, or an installation outcome your org reported through the agent tools. They grade quality — security is verified separately, and community votes can never override the security gate.

Open an issue

Sign in to confirm — weight comes from verified usage, not vote count.

0 open · 0 answered · 0 fixed · 1 said it worked

04Trust Passport

Full passport →
–/100

0/0 automated components pass. An automated score is never a security guarantee.

✓ Verified · first-partyreviewed Sep 20, 2026 · re-verification due Dec 19, 2026
  • publisher identity Publisher status verified; 1 verification(s) on file
  • malicious pattern scan No known malicious-behavior patterns across 8 source file(s) plus listing text
  • capability contract All 0 observed capability reference(s) match the declared manifest
  • agent safety scan No injection patterns in agent-readable content
  • provenance No release signature or provenance attestation
  • behavioral sandbox Not performed in this environment — requires the production isolated runner (docs/sandbox-requirements.md). No untrusted code is ever executed on the application host.

Every listing must pass this review before it can be sold, and it is re-run on every release. Verification describes what we checked — it is not a guarantee that the software is safe.

VersionChannelReleasedNotes
1.0.0stableAug 4, 2026First public release.