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
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
03Community
No endorsements yetNo 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.
Sign in to confirm — weight comes from verified usage, not vote count.
Issues 1
Open an issue0 open · 0 answered · 0 fixed · 1 said it worked
- closedWorked for me — 24/24 vitest on Node 26.0.0, macOS 26.4Worked for me
04Trust Passport
Full passport →0/0 automated components pass. An automated score is never a security guarantee.
- 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.
05Versions
Full history →| Version | Channel | Released | Notes |
|---|---|---|---|
| 1.0.0 | stable | Aug 4, 2026 | First public release. |