PromptBase
Upgrade
Close icon
General
Home
Marketplace
Create
Hire
Login
Chat
Sell
Explore

Skill Details

Runtime
(claude-4-8-opus)
Example user message
[userMessage]: /prompt-token-optimizer optimize this prompt for tokens, conservative style, must still classify into the exact same five categories and keep the JSON output shape, runs ~40k times/day in a support inbox triage pipeline: You are a helpful, professional, and friendly customer support assistant. Your job and your role is to act as a customer support assistant who reads incoming customer support emails. You should read each email carefully and thoroughly. After reading the email carefully, you must classify the email. The classification you produce must be one of exactly five categories, and the five categories are: BILLING, TECHNICAL, ACCOUNT, FEEDBACK, OTHER. Please make sure you only ever use one of these five categories and never invent a new category that is not in this list of five categories. When you classify the email, please also extract the customer's sentiment. The sentiment must be one of: positive, neutral, negative. Do not use any other sentiment value besides positive, n
Example agent response
I'll optimize this with the prompt-token-optimizer skill.Read the prompt-token-optimizer skillRead the prompt-token-optimizer skillRead the prompt-token-optimizer skillDoneStage 1 — Segmentation #SegmentS1"You are a helpful, professional, and friendly customer support assistant. Your job and your role is to act as a customer support assistant who reads incoming customer support emails."S2"You should read each email carefully and thoroughly. After reading the email carefully, you must classify the email."S3"The classification you produce must be one of exactly five categories, and the five categories are: BILLING, TECHNICAL, ACCOUNT, FEEDBACK, OTHER. Please make sure you only ever use one of these five categories and never invent a new category that is not in this list of five categories."S4"When you classify the email, please also extract the customer's sentiment. The sentiment must be one of: positive, neutral, negative. Do not use any other sentiment value besides positive, neutral, or negative."S5"You should also write a short one-sentence summary of the email. The summary should be short and concise and should be only one sentence long, no more than one sentence."S6"Please output your answer as JSON. The JSON should have three keys: 'category', 'sentiment', and 'summary'. Make sure the JSON is valid JSON. Do not add any extra text before or after the JSON. Only output the JSON and nothing else. Remember to be accurate and careful." Stage 2 — Token Table Token counts are rough word-based estimates (~words × 0.75), not exact tokenizer measurements. SegmentTypeApprox. tokensNotesS1Redundant~26Role stated twice ("your job and your role… act as a customer support assistant"); triple adjective stack.S2Redundant~17"carefully" repeated; "read the email" implied by task.S3Directive~42Core taxonomy. Category list essential; the "never invent" sentence restates the "exactly five" constraint.S4Directive~28Enum essential; second sentence restates first.S5Directive~25"one sentence" stated three ways.S6Directive/Structural~46JSON shape essential; "valid JSON / no extra text / only output JSON" overlap; "be accurate and careful" is filler. Stage 3 — Top Redundancy Flags S1 — Role is defined twice in one breath plus a three-adjective stack that has no effect on classification output. S5 — The single constraint "one sentence" is expressed three separate times. S6 — "Valid JSON," "no extra text before/after," and "only output JSON" are three phrasings of one no-prose rule, plus a meaningless "be accurate and careful" closer. Stage 4–5 — Strategy Selected: Semantic Compression (with light Protocol Abstraction for the output spec). Signals driving this choice: the prompt has no multi-step or layered procedure to decompose (rules out Hierarchical) and is short enough that a full tag-protocol rewrite would add scaffolding tokens rather than save them. The waste is almost entirely restated single instructions (S1, S2, S4, S5, S6) — the exact target of semantic compression. The one structural element, the JSON contract, benefits from terse protocol-style abstraction (a literal shape instead of prose describing keys). Given your conservative-style request, I kept every enum value, the JSON key names, and the one-sentence rule verbatim, and avoided aggressive tag wrapping. Stage 6 — Optimized Prompt You are a customer support assistant. Classify each incoming email and respond with JSON only — no text before or after. category: one of BILLING, TECHNICAL, ACCOUNT, FEEDBACK, OTHER (use only these) sentiment: one of positive, neutral, negative (use only these) summary: one sentence describing the email Output: {"category": "...", "sentiment": "...", "summary": "..."} Stage 7 — Reduction Metrics MetricValueOriginal word count~227Optimized word count~62Word reduction(227 − 62) / 227 = 72.7%Token estimate, original227 × 0.75 ≈ 170Token estimate, optimized62 × 0.75 ≈ 47Token estimate reduction(170 − 47) / 170 = 72.4% Stage 8 — Preservation Validation RequirementPreservedExactly five categories, identical namesYesNo invented categoriesYes — "use only these"Sentiment enum (positive/neutral/negative)YesOne-sentence summaryYesJSON output, three keys with identical namesYes — literal shape shownNo prose before/after JSONYesSame JSON output shapeYes No original instructions are absent or weakened. Dropped items were all pure restatements or non-behavioral filler ("helpful, professional, friendly," "carefully and thoroughly," "be accurate and careful"). Stage 9 — Diff Table ChangeOriginalOptimizedMergedDouble role definition + 3 adjectives (S1)"You are a customer support assistant."Removed"read each email carefully and thoroughly" (S2)implied by "Classify each incoming email"Merged"exactly five categories" + "never invent a new category" (S3)"(use only these)"MergedSentiment enum + "do not use any other" (S4)"(use only these)"Merged"short / concise / one sentence / no more than one" (S5)"one sentence describing the email"Merged"valid JSON / no extra text / only output JSON" (S6)"respond with JSON only — no text before or after"Removed"Remember to be accurate and careful."dropped (non-behavioral)RestructuredProse listing of three keysliteral JSON skeleton Stage 10 — Cost Formula (original tokens − optimized tokens) × price per token = (≈170 − ≈47) × [price per token] = ≈123 × [price per token] saved per run. At ~40,000 runs/day: ≈123 × 40,000 = ≈4,920,000 input tokens saved/day (prompt overhead only; per-email body tokens are unchanged). Multiply by your model's input price per token for the daily figure. Stage 11 — Rollout Recommendation No behavior-changing simplifications — every constraint and enum is preserved, so output shape is identical. Given this is a high-volume pipeline (~40k/day) where a subtle classification drift would be costly, I recommend gradual rollout: shadow-run the optimized prompt against ~500 recent emails, diff the category/sentiment outputs against the current prompt, and promote once they match. The compression itself is conservative, but validating on your real distribution before full cutover is cheap insurance at this volume. Skill: prompt-token-optimizer · SKILL.md ≈ 900 tokens · /mnt/skills/user/prompt-token-optimizer/SKILL.md
🟧 Claude Skill

Token Optimizer Cut Llm Costs

Add to Cart
Instant accessInstant access
Usage rightsCommercial use
Money-back guaranteeMoney‑back
By purchasing this skill, you agree to our terms of service
CLAUDE-4-8-OPUS
Tested icon
Guide icon
Free credits icon
Stop overpaying per run. This skill audits a verbose prompt, picks a named compression strategy, rewrites it, then proves instruction-by-instruction that quality survived — with an honest cost formula you plug your own token price into
...more
Added 1 day ago
Report
Browse Marketplace