Context is AI's working memory. Managing it effectively is the core of Claude Code mastery.
As conversations grow, the context fills up and performance degrades. ykdojo addresses this with a HANDOFF.md technique.
HANDOFF.md workflow:
# 1. When the conversation uses 50k+ tokens
> "Check current usage with /context"
# 2. Request HANDOFF.md
> "Summarize the work so far in a HANDOFF.md file.
Write it so the next agent can continue by reading only this file.
Include what was tried, what worked, what didn't, and clear next steps."
# 3. Start a fresh session
> "/clear"
# 4. Load HANDOFF.md
> "@HANDOFF.md Read this file and continue the work"
Example HANDOFF.md:
# Project: Stripe Payment Integration
## Goal
Implement one-time payments using Stripe Checkout
## Completed
OK Installed Stripe SDK and configured API keys
OK Implemented `/api/create-checkout-session`
OK Success/cancel page routing
## Tried but failed
NO Webhook signature verification - cannot test locally
- Fix: use ngrok
## Current issues
- Webhook event handling incomplete
- Need to store payment history in DB
## Next steps
1. Expose local server with ngrok
2. Register webhook URL in Stripe dashboard
3. Implement `payment_intent.succeeded` handler
4. Save payment record to `payments` table
If you mix multiple tasks in one conversation, context gets polluted. ykdojo keeps 3-4 terminal tabs open and runs independent work in each.
Tab separation strategy:
| Tab | Purpose | Example |
|---|---|---|
| Tab 1 | main development | implement a new feature |
| Tab 2 | bug fixes | urgent hotfix |
| Tab 3 | research & experiments | test a new library |
| Tab 4 | DevOps & deployment | CI/CD debugging |
ykdojo's advice:
"Each tab is an independent brain. Don't mix tasks. If you work on auth in one tab and suddenly ask for UI design, Claude gets confused."
When you want to keep current context but try a different approach, use conversation cloning.
/clone
Clones the entire conversation into a new UUID.
Use cases:
/half-clone
Keeps the latter half of the conversation and discards the earlier half.
Installation (using ykdojo's dx plugin):
claude plugin marketplace add ykdojo/claude-code-tips
claude plugin install dx@ykdojo
/context is an X-ray into your context window.
Example output:
Context Usage: 87,432 / 200,000 tokens (43.7%)
Breakdown:
- System Prompt: 10,234 tokens (11.7%)
- MCP Servers: 15,678 tokens (18.0%)
- supabase-mcp: 8,234 tokens
- playwright-mcp: 4,123 tokens
- firecrawl-mcp: 3,321 tokens
- Memory Files (CLAUDE.md): 2,345 tokens (2.7%)
- Skills: 1,234 tokens (1.4%)
- Conversation History: 57,941 tokens (66.3%)
Optimization ideas:
/mcp/clear or HANDOFF.mdAdo's advice:
"In general, keeping fewer than 10 MCP servers and fewer than 80 active tools tends to be optimal."
When pointing Claude to a file in another directory, absolute paths reduce confusion vs relative paths.
# bad
> "Check ../../config/database.ts"
# good
> !realpath ../../config/database.ts
/Users/ykdojo/projects/myapp/config/database.ts
> "@/Users/ykdojo/projects/myapp/config/database.ts Check this file"