Cursor engineer shares a prompt for making your agent harness token-efficient
_AustinCalvert_ · x · 2026-09-25
A Cursor team member published a reusable prompt distilled from their internal learnings for systematically optimizing LLM agent harness token costs, covering system prompts, tool definitions, request assembly, context caching, compaction, and retrieval.
Key points:
- Optimize the price-weighted token cost per completed task, not per request: every turn resends the prefix, so shrinking each request while adding turns can cost more.
- Weight tokens by billing type — output, uncached input, and cached input are priced very differently.
- Recommended order: map the harness and measure a baseline, rank the opportunities, then apply the highest-leverage changes, with no measurable drop in task quality.
More from coding & agent
- MCP's biggest win isn't smarter AI — it's replacing 9 point-to-point integrations with one protocol — WirelessLife · 2026-09-25
- Snorkel AI commits $3M to Open Benchmarks Grants funding agentic AI evaluations — typewriters · 2026-09-25
- Multi-Agent Coding Setups Are Mostly a Coordination Tax, Finds One-Month Experiment — Alive_Apartment6856 · 2026-09-25
- FrontierSmith lands NeurIPS spotlight: AI-synthesized coding data beats expert curation — AccBalanced · 2026-09-25
- AI Tooling Finds 8 Long-Standing Memory Leaks in libuv, 9 Fix PRs Filed — steipete · 2026-09-25
- Stack Overflow for Agents turns 3 months old: new ChatGPT plugin and privacy upgrades — pchandrasekar · 2026-09-25