1. Leverage Prompt Caching for Repeated Tasks
Prompt caching is one of the most effective ways to reduce costs and latency. When you send the same context repeatedly, Claude caches it and processes only the new parts, significantly reducing token usage.
- Reuse large context: If you frequently analyze the same codebase or document, keep it in your context instead of re-submitting it
- Session continuity: Use
/resumeto pick up previous sessions without losing cached context - Batch similar tasks: Group similar questions to maximize cache hits and minimize redundant processing
- MCP servers: Configure persistent MCP servers to maintain context across multiple prompts
2. Choose the Right Model for Your Task
Claude Code gives you multiple model options, each optimized for different use cases. Selecting the right model directly impacts both speed and cost:
Fast Mode (⚡ Recommended for Quick Tasks)
- Enable with
/fast on - Uses faster inference with optimized latency
- Perfect for simple code generation, formatting, and quick questions
- Reduces response time by 40-60% for straightforward tasks
Balanced Mode (Default)
- Best for general development tasks
- Good balance between speed and output quality
- Use for code reviews, debugging, and architecture decisions
High Effort (For Complex Work)
- Use for deep analysis, complex refactoring, or critical decisions
- Slower response but superior output quality
- Worth the wait for important architectural changes
/effort based on task complexity. Start with fast mode for exploration, then switch to high effort for final implementation.3. Optimize Token Usage
Tokens directly affect both speed and cost. Minimizing unnecessary tokens improves performance across the board:
- Clear context strategically: Use
/clearwhen you're starting a new task to avoid processing irrelevant conversation history - Use compact mode: Run
/compact [focus]to compress your conversation while keeping relevant context - Provide precise instructions: Clear, concise prompts require fewer tokens to process than vague or rambling requests
- Avoid unnecessary file includes: Only mention files you actually need in your conversation
- Use file mentions efficiently: Reference files with
@filesyntax instead of pasting entire contents when possible
⌃O) to identify where tokens are being consumed. This helps you refine your workflow for efficiency.4. Parallel Execution and Background Tasks
Don't let lengthy operations block your workflow. Claude Code supports parallel execution to maximize efficiency:
- Background tasks: Use
⌃Bto run time-consuming operations in the background while you continue working - Finish all agents: Press
⌃F ×2to complete all background agents at once instead of waiting for individual completions - Task list: Toggle
⌃Tto view all running tasks and their status - Scheduling: Use
/scheduleto run tasks on a recurring basis automatically
5. Optimize for Network Latency
While you can't control network speed, you can optimize how you interact with Claude Code:
- Batch requests: Group multiple questions into single prompts to reduce API calls
- Use fast mode for connectivity issues: If you have unstable internet, fast mode has better resilience
- Work offline when possible: Many Claude Code operations (file editing, local bash commands) don't require network access
- Cache aggressively: Stay in long sessions to maximize cached context and reduce round-trip times
6. Monitor and Debug Performance
Understanding where time is spent helps you optimize effectively:
- Verbose output: Toggle
⌃O(Mac) orCtrl+O(Windows) to see detailed timing information - Check session info: Use
/infoto see current model, memory usage, and session statistics - Monitor agent performance: Track background agent timing to identify bottlenecks
- Review cache metrics: Pay attention to how much context is being cached vs. re-processed
7. Best Practices Checklist
- ✅ Stay in sessions longer to maximize caching benefits
- ✅ Use fast mode (
/fast on) for simple, routine tasks - ✅ Batch related questions into single prompts
- ✅ Use
/compactbefore starting new major sections of work - ✅ Run tests and builds in background with
⌃B - ✅ Clear conversation history when switching contexts with
/clear - ✅ Monitor performance with verbose output
⌃O - ✅ Choose the right effort level for each task