Using credits efficiently
Credits are the currency that powers AI-assisted development. Understanding how they’re consumed and how to optimize their use will help you work more efficiently and keep costs predictable.
How credits are consumed
Section titled “How credits are consumed”Credit consumption is primarily driven by two factors:
- Context size — The amount of information the AI must process, including conversation history, attached files, and code references
- Model cost — Different AI models have different pricing tiers based on their capabilities
Each request consumes credits based on the formula: input tokens × model rate + output tokens × model rate. This means that larger contexts (more conversation history, more attached files) and more expensive models will consume more credits per interaction.
Common credit consumption patterns
Section titled “Common credit consumption patterns”Credit usage typically spikes in these scenarios:
- Long conversation threads — Each new message in a thread includes all previous context, so threads become progressively more expensive
- High-end models on routine tasks — Using advanced models for simple changes wastes credits
- Broad, unfocused requests — Vague prompts often require multiple clarification rounds
- Repeated trial-and-error — Running the same failed request multiple times without adjusting your approach
- Large file attachments — Adding entire large files as context when only specific sections are relevant
Highest-impact optimizations
Section titled “Highest-impact optimizations”These strategies deliver the most significant credit savings with minimal effort.
Start fresh threads strategically
Section titled “Start fresh threads strategically”Long threads accumulate context exponentially. A 20-message thread might include 100,000+ tokens of history, meaning each new prompt costs significantly more than it would in a fresh thread.
The cost multiplier effect:
- Message 1 in a thread: 1x context cost
- Message 10 in a thread: ~5-10x context cost
- Message 20 in a thread: ~15-25x context cost
Beyond cost, long threads also reduce AI effectiveness because the model must reconcile potentially conflicting requirements from earlier in the conversation.
When to start a new thread
Section titled “When to start a new thread”Start a new thread when:
- Topic shifts — Moving from authentication work to styling work
- Phase changes — Completing bug fixes and starting feature development
- Context becomes stale — Earlier decisions have been superseded
- Thread exceeds 15-20 messages — Even if still on-topic, the context cost becomes significant
- You’re getting confused responses — The AI may be trying to honor outdated requirements
How to transition effectively
Section titled “How to transition effectively”The key is creating a clean handoff that preserves essential context without bringing forward unnecessary history:
- Write a concise summary of the current state, decisions made, and what needs to happen next
- Start a new thread and paste the summary as the opening message
- Include only relevant context — Attach specific files or code sections needed for the next phase
Summary template:
## Context Summary
**Goal:** [What we're trying to accomplish]
**Current State:** [What's been completed, what exists now]
**Key Decisions:** [Important architectural or technical choices made]
**Next Steps:** [Specific tasks to complete]
**Relevant Files:** [List only files that will be actively modified]Example summary:
## Context Summary
**Goal:** Implement user profile editing feature
**Current State:**- Profile viewing is complete (ProfileScreen.tsx)- API endpoints exist for GET /profile and PATCH /profile- Form validation library (react-hook-form) is configured
**Key Decisions:**- Using optimistic updates for better UX- Profile images stored in S3, not database- Validation happens client-side and server-side
**Next Steps:**- Add edit mode toggle to ProfileScreen- Implement form submission with error handling- Add image upload component
**Relevant Files:**- src/screens/ProfileScreen.tsx- src/api/profile.tsThis approach typically reduces context size by 70-90% compared to continuing a long thread.
Match models to task complexity
Section titled “Match models to task complexity”Model selection is the single biggest lever for controlling credit consumption. Advanced models can cost 5-10x more per token than basic models, so using the right model for each task is critical.
Model selection framework
Section titled “Model selection framework”| Task Complexity | Use This Model | Example Tasks |
|---|---|---|
| Trivial | Cheapest available | Copy edits, comment updates, simple CSS tweaks, renaming variables |
| Simple | Fast/basic model | Styling adjustments, layout changes, adding console logs, minor bug fixes in isolated functions |
| Moderate | Mid-tier model | Component creation, API integration, form handling, state management, test writing |
| Complex | Advanced model | Architecture decisions, multi-file refactors, complex algorithm implementation, debugging subtle race conditions |
| High-stakes | Most capable model | Security-critical code, data migrations, payment processing, authentication systems |
Cost-benefit analysis
Section titled “Cost-benefit analysis”Consider a simple styling change that takes 3 interactions to complete:
- With expensive model: 3 requests × 2,000 tokens × 10 credits/token = 60,000 credits
- With basic model: 3 requests × 2,000 tokens × 1 credit/token = 6,000 credits
That’s a 10x difference for a task where model capability doesn’t materially affect quality.
When to upgrade mid-task
Section titled “When to upgrade mid-task”Start with a cheaper model and upgrade if you encounter:
- Multiple failed attempts with simple models
- Requests for complex reasoning or system design
- Need for deep codebase understanding across many files
- Subtle bugs requiring inference across multiple interaction points
Configure sensible defaults
Section titled “Configure sensible defaults”Your default model determines what gets used for most interactions, so setting it wisely prevents accidental waste.
Where to configure: Settings → Agent Config → Default Agent
Recommended approach:
- Set your default to a mid-tier model that handles most common tasks well
- Manually select cheaper models for trivial work
- Manually select premium models for complex or high-risk work
This configuration prevents the most common waste pattern: accidentally using premium models for routine work because you forgot to change the selection.
Thread management strategies
Section titled “Thread management strategies”Effective thread management keeps context lean and conversations focused.
One thread per logical unit of work
Section titled “One thread per logical unit of work”Organize threads by feature, component, or problem domain rather than having one mega-thread for all work.
Good thread organization:
✓ Thread: User authentication setup
✓ Thread: Profile screen styling
✓ Thread: Push notification integration
✓ Thread: API error handling refactor
Poor thread organization:
✗ Thread: Monday work
✗ Thread: Fix all bugs
✗ Thread: App improvements
Splitting threads by work phase
Section titled “Splitting threads by work phase”Even within a single feature, consider splitting threads by phase:
Thread 1: Design - Architecture planning for notification system
Thread 2: Implementation - Build notification infrastructure
Thread 3: Integration - Connect notifications to user actions
Thread 4: Testing - Debug notification delivery issues
This prevents the planning discussion from bloating the context during implementation.
When to continue vs. restart
Section titled “When to continue vs. restart”Continue the current thread when:
- You’re iterating on the immediate output (fixing a bug the AI just introduced)
- Making minor adjustments to what was just generated
- The total thread length is still under 10 messages
Start a new thread when:
- The subtask is complete and you’re moving to the next one
- You need to change models (better to start fresh than switch mid-thread)
- The AI seems confused about what you want
- You’ve had 3+ failed attempts and need to reset the approach
Crafting efficient prompts
Section titled “Crafting efficient prompts”Better prompts reduce back-and-forth, which directly reduces credit consumption.
Specificity reduces ambiguity
Section titled “Specificity reduces ambiguity”Vague prompts lead to clarifying questions and multiple attempts. Specific prompts get results on the first try.
Vague prompts (high credit cost):
❌ “Fix the button”
❌ “Update the styling”
❌ “Make the form better”
❌ “This isn’t working”
Specific prompts (low credit cost):
✓ “Change the ‘Submit’ button in LoginForm.tsx to use primary color (#2563eb) and increase padding to 12px”
✓ “Update ProfileHeader.tsx to match the design: avatar should be 80px, name text should be 18px semibold, bio text should be 14px gray”
✓ “Add client-side email validation to RegistrationForm.tsx using the same validator pattern as LoginForm.tsx”
✓ “The PaymentButton onClick handler throws ‘undefined is not a function’ when clicking after selecting credit card as payment method”
Provide structural context
Section titled “Provide structural context”Help the AI understand constraints and requirements upfront.
Minimal prompt:
Add error handling to the API calls
Context-rich prompt:
Add error handling to the user profile API calls in src/api/profile.ts:
- Catch network errors and show toast notification
- Handle 401 by redirecting to login
- Handle 403 by showing “insufficient permissions” modal
- Use the existing ErrorBoundary pattern from src/api/auth.ts
The context-rich version includes:
- Location (which file)
- Requirements (what errors to handle, how to handle them)
- Constraints (reuse existing patterns)
This eliminates clarification rounds.
Scope requests precisely
Section titled “Scope requests precisely”Large, multi-part requests increase cognitive load for the AI and increase the chance of partial success requiring follow-up.
Too broad:
❌ “Refactor the entire app to use TypeScript”
❌ “Improve performance”
❌ “Update all components to match new design”
Well-scoped:
✓ “Convert src/components/ProfileCard.tsx from JavaScript to TypeScript, adding proper type definitions for props”
✓ “Optimize the ProductList component rendering by adding React.memo and useMemo for the filtered products calculation”
✓ “Update Button.tsx to match the new design system: rounded corners (8px), new color palette (primary: #2563eb), consistent padding (12px 24px)”
If the full change is large, break it into a sequence of scoped requests in separate threads.
Reference specific code locations
Section titled “Reference specific code locations”Rather than attaching entire files, reference specific functions, components, or line ranges.
Inefficient:
[Attaches 500-line file]
“Fix the bug in this file”
Efficient:
“In UserService.ts, the
updateProfilemethod (lines 45-67) doesn’t handle the case where email is unchanged but already exists for another user. Add a check to skip uniqueness validation if email hasn’t changed.”
Use @ mentions to reference specific files, and describe the location within the file for surgical precision.
Handle trivial changes manually
Section titled “Handle trivial changes manually”For extremely simple changes where you know exactly what to do, doing it manually is often faster and cheaper than explaining it to the AI.
Consider manual edits for:
- Changing a color hex code
- Adjusting padding/margin by a few pixels
- Fixing typos in strings
- Reordering imports
- Adding a console.log for debugging
Use AI for:
- Changes where you’re unsure of the approach
- Updates that touch multiple related locations
- Refactoring that requires understanding logic flow
- Implementing patterns you’re unfamiliar with
When you need to know where or how to make a change, use Chat mode to ask for guidance, then implement it yourself. This is often cheaper than Agent mode end-to-end execution.
Iterative refinement strategy
Section titled “Iterative refinement strategy”When requests fail or produce incorrect results, don’t repeat the same request. Adjust your approach:
Failed request checklist:
- Clarify requirements — Add more specific details about expected behavior
- Narrow scope — Focus on the specific failing piece
- Add constraints — Specify what should NOT change
- Provide examples — Show what correct output looks like
- Change models — Try a more capable model if the task is complex
- Start fresh — Begin a new thread if context is corrupted
Example progression:
Attempt 1: “Add form validation”
→ Result: Generic validation that doesn’t match requirementsAttempt 2: “Add form validation to LoginForm.tsx:
- Email must be valid email format
- Password must be at least 8 characters
- Show errors below each field, not in a modal
- Use the same error styling as RegistrationForm.tsx”
→ Result: Success
Debugging efficiently
Section titled “Debugging efficiently”Debugging can be a credit sink if not approached systematically.
Add instrumentation proactively
Section titled “Add instrumentation proactively”Rather than multiple rounds of “try this,” “try that,” invest in adding logging and error handling that provides diagnostic information.
Credit-expensive approach:
❌ “Why isn’t this working?”
❌ “Try adding a console.log here”
❌ “Maybe check if this value is undefined”
❌ “Add another log there”
[5-10 messages of trial and error]
Credit-efficient approach:
✓ “Add comprehensive error handling and logging to the payment processing flow:
- Log inputs at function entry
- Log each state transition
- Catch and log all errors with context
- Add validation checks with descriptive error messages”
[Get detailed diagnostics in one go]
The investment in instrumentation pays off by reducing guesswork.
Provide complete error information
Section titled “Provide complete error information”When reporting bugs, include everything needed to diagnose:
Incomplete bug report:
❌ “The app crashes when I click the button”
Complete bug report:
✓ “The PaymentButton in CheckoutScreen.tsx crashes when clicked AFTER selecting ‘Credit Card’ option. Error: ‘Cannot read property ‘process’ of undefined’ in PaymentService.ts line 34. Stack trace shows it’s happening in handlePayment callback. This started after adding Stripe integration in commit abc123.”
Include:
- What you did (exact steps to reproduce)
- What happened (specific error message, stack trace)
- Context (when did it start, what changed recently)
- Environment (if relevant: device, browser, etc.)
Use rollback strategically
Section titled “Use rollback strategically”If a change breaks things and debugging is taking multiple attempts, rolling back can be faster and free.
When to roll back:
- After 3+ failed debugging attempts
- When the change introduced multiple new issues
- When you’re no longer confident about the current state
- When starting over would be simpler than fixing forward
When to debug forward:
- The fix is obvious from the error
- You’re close to a solution
- Rolling back would lose significant work
- The issue exists in code that wasn’t just changed
Rollback is free and instant—use it as a reset button when debugging becomes inefficient.
Reproduce issues in isolation
Section titled “Reproduce issues in isolation”If debugging a complex feature, try to isolate the issue in a minimal reproduction.
Expensive:
[Entire app as context]
“Debug why checkout flow breaks”
Efficient:
“Create a minimal test case for the PaymentService.process method that reproduces the ‘undefined’ error when called with a credit card token”
Isolated reproductions reduce context size and make root cause identification faster.
Preview & build credit awareness
Section titled “Preview & build credit awareness”When working with preview environments, metro bundlers, or sandboxes, be aware that certain patterns can cause unexpected credit consumption:
Credits may be consumed when:
- Agent automatically retries failing tasks
- Preview errors trigger repeated fix attempts
- Metro/sandbox logs are reprocessed in multiple requests
- Build failures cause iterative debugging loops
Best practices:
Refresh/restart preview manually if broken
- If the preview is in a broken state, manually restart it rather than asking the AI to “fix it again”
- This prevents the AI from reprocessing large log files repeatedly
Start new thread if logs are stale
- Build logs and error output accumulate as context
- If you’ve made several attempts and logs are outdated, start a fresh thread with just the current error
- Include only the relevant error section, not the entire build log
Avoid repeated “fix again” loops in same thread
- Instead of: “fix it” → “still broken, fix it” → “fix it again” → “try again”
- Do this: analyze the specific error, adjust your approach, start fresh if needed
- After 2-3 failed attempts, either rollback or start a new thread with better diagnostics
Example of efficient preview debugging:
❌ Bad approach:
[Long thread with build logs]
“The preview is broken"
"Try again"
"Fix the error"
"Still not working”
[Repeated log reprocessing, high credit cost]✓ Good approach:
[New thread]
“Preview fails with: ‘Module not found: Error: Can’t resolve ’./UserProfile’ in src/screens/Home.tsx line 12’. The file exists at src/components/UserProfile.tsx. Update the import path.”
[Specific error, clear fix, resolved in 1-2 messages]
Advanced optimization techniques
Section titled “Advanced optimization techniques”Selective context attachment
Section titled “Selective context attachment”Only attach files that will be directly modified or referenced. Avoid attaching entire folders or “just in case” files.
Ask yourself:
- Will this file be edited in this request?
- Does the AI need to see this exact code to understand the request?
- Could I describe the relevant pattern instead of showing the file?
Example:
Instead of attaching AuthContext.tsx to show the authentication pattern, write: “Use the same authentication pattern as AuthContext.tsx (token storage, refresh logic, error boundaries).”
Use mode selection wisely
Section titled “Use mode selection wisely”Different modes have different context costs:
- Chat mode — Lowest cost, read-only, good for questions and guidance
- Agent mode — Higher cost, can make changes, best for implementation
- Debug mode — Specialized for systematic debugging
Use Chat mode for:
- Asking how to approach a problem
- Getting guidance on where to make changes
- Understanding existing code
- Quick questions
Use Agent mode for:
- Implementing features
- Refactoring code
- Making multi-step changes
Batch related changes
Section titled “Batch related changes”If you have multiple small, related changes, batch them into a single request rather than making separate requests.
Inefficient (3 separate requests):
❌ “Change button color to blue”
❌ “Update button text to ‘Submit’”
❌ “Add loading spinner to button”
Efficient (1 request):
✓ “Update the submit button in LoginForm.tsx:
- Change background color to blue (#2563eb)
- Update text from ‘Login’ to ‘Submit’
- Add loading spinner that shows when isLoading prop is true”
This reduces overhead from repeated context loading.
Monitor your usage patterns
Section titled “Monitor your usage patterns”Pay attention to when your credit consumption spikes:
- Which types of requests consume the most credits?
- Which threads grow longest?
- When do you find yourself in extended debugging sessions?
Identifying patterns helps you adjust behavior in high-cost areas.
Quick reference: Credit-saving checklist
Section titled “Quick reference: Credit-saving checklist”Before each request, consider:
- Is this thread getting long? (>10 messages → consider starting fresh)
- Am I using the right model for this task complexity?
- Is my request specific and well-scoped?
- Have I provided enough context to avoid clarification rounds?
- Am I attaching only necessary files?
- Could I do this trivial change manually faster?
- If this is a retry, have I adjusted my approach?
Following these practices will typically reduce credit consumption by 50-70% compared to unoptimized usage while also improving result quality and reducing frustration.
Summary
Section titled “Summary”Efficient credit usage comes down to three core principles:
- Keep context lean — Start fresh threads, attach only necessary files, summarize rather than carry forward everything
- Match models to tasks — Use cheaper models for simple work, reserve premium models for complex challenges
- Write precise prompts — Specific, scoped requests with clear requirements reduce back-and-forth
The goal isn’t to minimize credit usage at all costs—it’s to get maximum value from each credit spent. Sometimes using a premium model or including extra context is the right choice. The key is making those choices consciously rather than accidentally.