Token Usage
Tokens are the units AI models use to process text. Understanding tokens helps you optimize costs.
What Are Tokens?
Tokens are pieces of words:
"Hello"= 1 token"Hello, world!"= 3 tokens"implementation"= 1 token"implementations"= 2 tokens
Rule of thumb: 1 token ≈ 4 characters or ¾ of a word.
What Consumes Tokens
Input Tokens (sent to AI)
- Ticket title and description
- Code context (relevant files)
- Conversation history
- Agent system prompt
- Organization context
Output Tokens (generated by AI)
- Clarifying questions
- Implementation plans
- Generated code
- PR descriptions
- Comment responses
Typical Usage
| Task | Input Tokens | Output Tokens |
|---|---|---|
| Simple clarification | 2,000 | 500 |
| Small feature | 10,000 | 3,000 |
| Medium feature | 25,000 | 8,000 |
| Complex feature | 50,000+ | 15,000+ |
| PR feedback response | 5,000 | 1,000 |
Reducing Token Usage
Write Concise Tickets
❌ Verbose (more tokens):
"I would like you to please add a feature that allows
users to upload their profile pictures to the system..."
✅ Concise (fewer tokens):
"Add user avatar upload: JPG/PNG, max 5MB, store in S3"
Keep Context Focused
Only include relevant information in your agent context:
❌ Too much:
[Entire architecture document, all coding standards,
company history, team bios...]
✅ Focused:
- Stack: NestJS, Drizzle, PostgreSQL
- Pattern: Repository for DB, DTOs for API
- Testing: Jest, required for new endpoints
Use Appropriate Models
| Task | Recommended Model |
|---|---|
| Quick questions | Haiku |
| Standard features | Sonnet |
| Complex refactoring | Opus |
Haiku is ~10× cheaper than Sonnet for simple tasks.
Break Up Large Features
Instead of one massive ticket, create smaller focused tickets:
❌ One large ticket:
"Build complete user management system"
✅ Multiple focused tickets:
1. "Add user CRUD endpoints"
2. "Add user avatar upload"
3. "Add user role management"
4. "Add user invitation flow"
Monitoring Usage
Dashboard
View token usage in Settings → Usage:
- Daily/weekly/monthly breakdowns
- Per-agent consumption
- Per-project consumption
Per-Run Details
Each agent run shows:
- Input tokens used
- Output tokens generated
- Total cost
- Model used
Cost Estimation
Before running a large task, estimate tokens:
- Count characters in your ticket + context
- Divide by 4 for approximate input tokens
- Estimate output as 20-50% of input
- Apply your tier multiplier
