Token usage isn’t just about cost—it’s about feedback loop speed and context window limits. This guide shows you how to get more done with fewer tokens through project optimization, smart model selection, and workflow patterns.Documentation Index
Fetch the complete documentation index at: https://factory-docs-auto-sync-jp-docs.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Using Factory App? These strategies apply to both CLI and Factory App. You can view your project’s readiness score in the Agent Readiness Dashboard.
Understanding Token Usage
Tokens are consumed in three main areas:- Too much exploration (unclear instructions)
- Multiple attempts (missing context or failing tests)
- Verbose output (no format constraints)
Project Setup for Efficiency
The biggest token savings come from project configuration that prevents wasted cycles.1. Fast, Reliable Tests
| Test Characteristic | Impact on Tokens |
|---|---|
| Fast tests (< 30s) | Droid verifies changes immediately |
| Slow tests (> 2min) | Droid may skip verification or waste context waiting |
| Flaky tests | False failures cause debugging cycles |
| No tests | Droid can’t verify changes, more back-and-forth |
2. Linting and Type Checking
When Droid can catch errors immediately, it fixes them in the same turn instead of waiting for you to report them.3. Clear Project Structure
Document your file organization so Droid doesn’t waste tokens exploring:Agent Readiness Checklist
The Agent Readiness Report evaluates your project against criteria that directly impact token efficiency.High-Impact Criteria
| Criterion | Token Impact | Why It Matters |
|---|---|---|
| Linter Configuration | 🟢 High | Catches errors immediately, no debugging cycles |
| Type Checker | 🟢 High | Prevents runtime errors, clearer code |
| Unit Tests Runnable | 🟢 High | Verification in same turn |
| AGENTS.md | 🟢 High | Context upfront, less exploration |
| Build Command Documentation | 🟡 Medium | No guessing, fewer failed attempts |
| Dependencies Pinned | 🟡 Medium | Reproducible builds |
| Pre-commit Hooks | 🟡 Medium | Automatic quality enforcement |
Model Selection Strategy
Different models have different cost multipliers and capabilities. Match the model to the task:Cost Multipliers
See Available Models for current model multipliers.Task-Based Model Selection
Reasoning Effort Impact
Higher reasoning = more “thinking” tokens but often fewer retries.| Reasoning | When to Use | Token Trade-off |
|---|---|---|
| Off/None | Simple, clear tasks | Lowest per-turn, may need more turns |
| Low | Standard implementation | Good balance |
| Medium | Complex logic, debugging | Higher per-turn, fewer retries |
| High | Architecture, analysis | Highest per-turn, best first-attempt |
Workflow Patterns for Efficiency
Pattern 1: Spec Mode for Complex Work
Use Specification Mode (Shift+Tab or /spec) to plan before implementing.
Without Spec Mode:
Pattern 2: IDE Plugin for Context
Without IDE plugin, Droid must read files to understand context:Pattern 3: Specific Over General
Expensive prompt:Pattern 4: Batch Similar Work
Expensive:Reducing Token Waste
Common Waste Patterns
| Pattern | Cause | Fix |
|---|---|---|
| Multiple exploration cycles | Unclear requirements | Be specific upfront |
| Repeated file reads | Missing IDE context | Install IDE plugin |
| Failed attempts | No tests/linting | Add validation tools |
| Verbose explanations | No format constraint | Ask for concise output |
| Wrong architecture | Missing context | Use Spec Mode |
Format Constraints
Ask for specific output formats to reduce verbosity:Monitoring Your Usage
Check Current Session Cost
Track Over Time
Review your usage patterns:- After each session, note the
/costoutput - Identify expensive sessions: What made them expensive?
- Refine approach: More context? Different model? Better prompts?
Usage Red Flags
Watch for these patterns:- 🚩 High read count: Droid is exploring too much (add AGENTS.md context)
- 🚩 Multiple grep/search calls: Unclear what to look for (be more specific)
- 🚩 Repeated similar edits: Failed attempts (check tests/linting)
- 🚩 Very long conversations: Scope creep (break into smaller tasks)
Quick Wins Checklist
Implement these for immediate token savings:- Install IDE plugin - Eliminates context-gathering tool calls
- Create AGENTS.md - Droid knows build/test commands upfront
- Configure linting - Errors caught immediately
- Fast test command - Verification in same turn
- Use Spec Mode - Prevents expensive false starts
- Be specific - Reduces exploration cycles
- Match model to task - Don’t use Opus for simple edits
Token Budget Guidelines
Rough guidelines for common tasks:| Task Type | Typical Token Range | Notes |
|---|---|---|
| Quick edit | 5k-15k | Simple, specific changes |
| Feature implementation | 30k-80k | With Spec Mode planning |
| Complex debugging | 50k-150k | May need multiple attempts |
| Architecture planning | 20k-50k | High-reasoning model |
| Code review | 30k-60k | Depends on PR size |
| Bulk refactoring | 50k-200k | Many files, use efficient model |
Summary: The Token-Efficient Workflow
Next Steps
Setup Checklist
Complete power user configuration
Readiness Report
Evaluate your project’s AI-readiness
