Claude Prompt Optimization: Cut 9.5% Tokens on Filler Phrases
Models like Claude Sonnet waste up to 11% of output tokens on opening pleasantries, meta-comments, and closing niceties. Testing on 500 prompts showed how three lines in the system prompt slashed this waste without losing any response value.
Analysis revealed 11.3% 'filler' in responses: the model kicked off with "Sure!" or "Great question!", added think-aloud explanations, and wrapped up with "Hope that helps." For backend integrations with JSON parsing, that's pure overhead.
Measurement Methodology
We gathered 500 typical tasks: ticket classification, field extraction from docs, email summaries, policy-based replies. Setup: claude-sonnet-4-5, temperature=0.2, standard system prompt.
A Python script with regex parsed outputs:
FILLER_PATTERNS = [
r"^(Sure|Absolutely|Of course|Okay)[,!.]",
r"^(Great|Great question|Excellent)[!.]",
r"^(Happy to|Glad to)",
r"^(Let's|Allow me)",
r"(Hope this (helps|will help)")",
r"(If you have (any )?(more )?questions)",
r"(Let me know if)",
]
Manual review of 50 responses confirmed 94% accuracy. The rest is undercounting.
Filler breakdown:
- Opening phrases ("Sure!", "Great!") — 28%
- Meta-comments ("let me think…") — 34%
- Closing phrases ("hope that helps") — 22%
- Question rephrasing — 16%
Manual cleanup of 100 responses preserved core meaning.
System Prompt Optimization
Original prompt:
You are an assistant for processing [DOMAIN]. Respond precisely,
basing answers only on provided context. If no data — say so honestly.
Added:
Response format:
- No intros, question praise, or "here's what I'll do" explanations.
- No closers like "hope that helps."
- Straight to the point. Lists first if needed. Numbers first if needed.
Rerun on 500 prompts: filler dropped to 1.8%. Token savings: 9.5%.
Cost example:
| Queries/Day | Avg Response (Tokens) | Monthly Savings ($) |
|--------------|-----------------------|---------------------|
| 2000 | 400 | ~50 |
| 20000 | 400 | ~500 |
Real project: $55/month saved. Plus shorter context in follow-ups.
Limitations and Rollbacks
Not for every use case:
- Customer chat: Stripped politeness felt rude. Satisfaction dipped — reverted.
- Tool-use chains: Model mixed up tools without plan meta-description. Reverted for reliability.
Tip: Use in machine-facing tasks (JSON, API). Keep in user-facing chats.
Key Takeaways
- 11.3% tokens on filler in baseline Claude Sonnet.
- 9.5% savings with three prompt lines.
- Regex catches 94% junk.
- Safe for response essence, risky in tool chains and UX chats.
- Next: Clean input tokens from user preambles.
— Editorial Team
No comments yet.