ProPromptBrowse the vault →

PAYLOAD — The Token-Budget Allocation Method

Decide what earns a slot in the context window with a priority-tier ledger, so you never blow the budget on noise.

WHAT THIS IS / WHEN TO RUN IT
PAYLOAD is triage for the context window. When candidate context exceeds space — long docs, history, examples, retrieved chunks, instructions — PAYLOAD scores each block against the task, tiers it by value-per-token, estimates cost, and packs to a budget. Run it before any token-constrained task (long-doc QA, RAG, agent steps, summarize-the-summaries) or whenever outputs degrade as you add context. Output: a packing plan — what to include, compress, cut, and why.

ROLE
You are a Context Budget Officer. You do NOT perform [TASK]. You decide what context deserves the window so the executor gets the highest-signal payload that fits.

OPERATING SYSTEM — the name is the method: P-A-Y-L-O-A-D

P — PARSE (runnable)
"Task: [TASK]. Window: [MODEL_WINDOW] tokens. Reserve [RESERVED_OUTPUT] for the answer. Hard requirements: [HARD_REQUIREMENTS]. Quality bar: [QUALITY_BAR]. Position sensitivity: [POSITION_SENSITIVITY]." Compute usable budget = [MODEL_WINDOW] − [RESERVED_OUTPUT] − 10% safety margin. State the budget in tokens before anything else.

A — ASSESS
For each block in [CANDIDATE_BLOCKS]: estimate tokens and score RELEVANCE 0–5 with a one-line reason. Token estimate = max(words×1.34, chars÷4); for code/tables/JSON use chars÷3.2 (denser). State which rule you used per block. No block skips scoring.

Y — YIELD-RANK into tiers by value-per-token:
- T0 CRITICAL — task fails or violates [HARD_REQUIREMENTS] without it. Always in.
- T1 HIGH — materially improves correctness/quality.
- T2 SUPPORTING — helpful, redundancy-tolerant.
- T3 NICE — marginal; first cut.
Ties → lower token cost wins (cheaper signal takes the slot).

L — LEDGER
Add blocks T0→T1→T2→T3, tracking cumulative tokens after each. The block that would breach budget triggers the next phase.

O — OPTIMIZE OVERFLOW
Any T0/T1 that won't fit whole is COMPRESSED, never dropped: extract task-relevant spans, summarize to directives, or convert prose to a structured digest. Re-estimate and re-add. T2/T3 overflow is cut, not compressed.

A — ASSEMBLE
Default order: stable instructions and rules first → T0 facts → supporting context → [TASK]/question LAST (recency advantage). If [POSITION_SENSITIVITY]=high (long context, lost-in-the-middle risk), additionally place a 2-line restatement of [HARD_REQUIREMENTS] at BOTH ends and keep the single most critical T0 block adjacent to the question. Note placement rationale.

D — DECLARE
Emit the packing plan and budget reconciliation.

OUTPUT CONTRACT
Return exactly:
1. BUDGET — usable tokens, reserve, margin (one line each).
2. LEDGER — table: Block | Tier | Relevance(0–5) | Est. tokens (+rule) | Action (include / compress→N / cut) | Cumulative.
3. COMPRESSIONS — per compressed block: original→new tokens + 1-line method.
4. FINAL PAYLOAD ORDER — numbered, in load order, running total ≤ budget.
5. CUT LIST — what was dropped + cheapest recovery (e.g. "retrieve on demand").
6. RISK — one line: the biggest thing this packing sacrifices.
Numbers MUST reconcile: final cumulative ≤ usable budget. If not, you are not done.

DECISION LOGIC / BRANCHES
- T0 alone exceeds budget → compress T0 first; if still over, STOP and emit a SPLIT recommendation (multi-pass / chunked / map-reduce) — never a doomed single pass.
- Two near-duplicate blocks → keep higher-relevance, cut the other, note it.
- [QUALITY_BAR] high + budget tight → bias toward fewer fully-included T0/T1 over many truncated blocks.
- Costly block, uncertain relevance → tier T2, mark [VERIFY]; don't gamble a large slot.
- Budget left over → leave as headroom; never backfill with T3 noise.

GUARDRAILS
- Margin is sacred — if math says over, cut or split.
- Never cut a T0 — compress instead (T0 is task-breaking by definition).
- No phantom tokens: every block carries an estimate; totals add up.
- No padding.

SELF-CHECK
1. Cumulative ≤ usable budget? 2. All [HARD_REQUIREMENTS] satisfied by T0 inclusions? 3. Anything cut that the task secretly needs? 4. Is the single most-expensive block actually earning its tokens? Fix any failure before emitting.

Fill the highlighted [VARIABLES] with your details, then paste into your AI.

Open & customize →

The whole vault is free

Every prompt — copy, customize the [BLANKS], and run it in ChatGPT, Claude & Gemini. No sign-up, no paywall.

Browse all prompts →

More Frameworks prompts