Skip to content
agentboards

Context & limits · Practical AI guide

How to reduce AI token waste without losing useful context

Send relevant evidence and ask for a bounded result.

By AgentBoards · Published · Editorial guidance with an illustrative example; no product benchmark or guaranteed outcome.

Start with duplicated work. Repeated logs, entire repositories and lengthy restatements can make a request larger without improving the answer. Keep the evidence needed for correctness, retrieve additional details when the task calls for them, and ask for a specific output. Compare the resulting work on the same task before deciding a shorter prompt or different model is better.

Start with these three steps

  1. Remove duplicate logs and unrelated documents.
  2. Request targeted retrieval or specific file sections.
  3. Try a less costly option on a representative task and compare quality.

Illustrative example

Make the request concrete

A failing build produced a long log. Most lines repeat the same dependency warning; the useful error identifies an incompatible import in one file.

Investigate this build failure using the exact command, runtime version, first relevant error and surrounding stack trace below. Start with the file named in the error and the package configuration. Return a likely cause, supporting evidence, the smallest proposed change and one check. Ask for a specific missing section if needed; do not repeat the log.

What to check afterward

  • The shortened input retains the actual error, relevant environment and the command that failed.
  • The proposed change is supported by the cited code or configuration, and the original build is rerun.
  • Compare recorded usage and the quality of the result across similar runs; a shorter message alone does not establish a lower bill.

A prompt you can adapt

Replace the [brackets] with your task and use only information appropriate for your tool.

Solve [task] using these relevant inputs: [inputs]. Return [specific output] within [length]. If information is missing, identify exactly what you need instead of guessing. Avoid repeating the source material.

Watch for this failure

Cutting the evidence needed for accuracy just to shorten the prompt.

Do not remove the evidence that changes the answer. If the agent starts guessing versions or inventing files, give it targeted access to those facts. Provider billing can include output, cached input, tools and other charges, so inspect the actual usage record instead of estimating savings from prompt length alone.

You’re done when: The result meets the same quality bar with less repeated material.

Further reading

These sources explain related practices. The example and prompt above are AgentBoards editorial material, not provider tests or endorsements.

↑↓ navigate · Enter open · Esc close546 agents + guides