Basic Token Saving Strategies
Why it matters
| Token type | What you're charged for | Relative cost |
|---|---|---|
| Input | System prompt + history + your message + files | 1× baseline |
| Output | Every token the model generates in response | 3–5× input |
| Model Tier | Example | Input (per 1M) | Output (per 1M) |
|---|---|---|---|
| Budget | Claude Haiku, mini models | up to $0.25 | up to $2.00 |
| Mid-range | GPT-5 / Claude Sonnet | up to $3.00 | up to $15 |
| Premium | Claude Opus | up to $5.00 | up to $25 |
Choose model wisely
Different AI models are good at different kinds of work.
If you use the right model for the right task, you can save a lot of money without losing much quality.
1. Premium models: planning and architecture
These models are best when the task requires deep reasoning, tradeoffs, or big-picture thinking.
- System design
- Architecture decisions
- Technical planning
Example: “Design the architecture for a SaaS project management app that supports real-time collaboration, role-based permissions, and multi-tenant scaling. Explain the tradeoffs between microservices and a modular monolith.”
2. Mid-range models: implementation
These models are usually the best balance of speed, cost, and coding quality.
- Writing features
- Generating APIs
- Refactoring
- Unit tests
Example: “Build a REST API endpoint in Node.js and Express for creating tasks. Include validation, error handling, and PostgreSQL integration using Prisma.”
3. Budget models: cleanup and repetitive work
Cheap models are often enough for structured, low-reasoning tasks.
- Formatting
- Summaries
- Documentation cleanup
- Simple transformations
Example: “Rewrite these release notes into a short, professional changelog for customers. Keep it under 150 words and use bullet points.”
Example
Feature: Add profile picture upload to an app
Premium model prompt: “Design the best approach for secure profile picture uploads, including validation, storage, and edge cases.”
Mid-range prompt: “Create the React upload component and Express API endpoint for profile picture uploads.”
Budget model prompt: “Update the project wiki with setup instructions and document the new profile picture upload feature for developers and QA.”
Reduce input tokens
Every token you send is re-sent on each follow-up message.
| Strategy | How to apply | Why it works |
|---|---|---|
| Start fresh conversations often | Keep threads to 15–20 turns max | Stops history from compounding |
| Separate planning from execution | Write plans to .md files, then open a new session to build | Keeps planning context out of every implementation turn |
| Convert docs before feeding them in | Convert PDFs, HTML, spreadsheets to markdown first | Raw formats carry formatting overhead |
Keep AGENTS.md lean | Project structure + key commands only | This file loads on every single turn |
Reduce output tokens
Output is the expensive side. Give the model clear boundaries on what to produce.
| Technique | How to prompt it | Effect |
|---|---|---|
| Specify format and length | "Answer in 3 bullet points" / "Use under 100 words" | Model stops generating early |
| Request diffs, not full rewrites | "Show only changed lines" / "Return minimal diff" | Avoids re-outputting unchanged code |
| Ask for the decision, not the reasoning | "Just give the fix, no explanation" | Reduces reasoning tokens |
| Batch related questions | Ask multiple related questions in one prompt | Fewer back-and-forth turns |
| Use inline edits/completions | No prompt but manual writing for small parts of code | It is cheaper than prompt |
Manage context during a session
Keep your context window between 40–60% for optimal performance. Use /context to check current usage.
| Strategy | When to Use | How to Do It |
|---|---|---|
| Intentional Discard | Task is complete and next task needs different context | /clear or /new to start fresh |
| Intentional Compact | Need to keep progress but reduce noise | /compact or ask agent to summarize progress to a file |
| Task decomposition | Task is too broad for current context window | Break into subtasks; consider sub-agents for independent work |
| Sub-Agents | Specific research or task that doesn't need full context | Use Agent tool to run task in isolated context window |
Example: Compacting mid-session
When context fills with logs and tool outputs but you need to preserve progress:
Write everything we did so far to progress.md: the goal, our approach,
steps completed, and current blocker. Keep it under 100 lines.Then use /compact to compress the conversation or use a personalized skill.
For the full list of session management commands and shortcuts, see the Claude Code keybindings and Copilot CLI keybindings references.