Tips & Tricks
import { Aside, Card, CardGrid } from ‘@astrojs/starlight/components’;
Pro Tips from 16 Phases
Section titled “Pro Tips from 16 Phases”Phase 1-3: Foundation & Security
Section titled “Phase 1-3: Foundation & Security”Phase 4-6: Prompting & Context Mastery
Section titled “Phase 4-6: Prompting & Context Mastery”Phase 7-8: Auto Coding & Meta-Debugging
Section titled “Phase 7-8: Auto Coding & Meta-Debugging”Phase 9-12: Legacy Code & Automation
Section titled “Phase 9-12: Legacy Code & Automation”Phase 13-16: Optimization & Mastery
Section titled “Phase 13-16: Optimization & Mastery”Token Management
Section titled “Token Management”6 Token-Saving Techniques
Section titled “6 Token-Saving Techniques”| # | Technique | How | Savings |
|---|---|---|---|
| 1 | Selective reading | Ask for signatures/types first, full files later | -60% |
| 2 | Filtered output | Use head -20, tail -50, grep -A 5 | -80% |
| 3 | Strategic /compact | Compact at 30%, 60%, 80% markers | Resets to ~50% |
| 4 | Prompt brevity | ”Fix bug in saveUser” not a 500-word essay | -50% |
| 5 | File chunking | ”Read lines 1-100 of X” for large files | Read only needed parts |
| 6 | Avoid re-reads | Ask “Do you still have auth.ts in context?” | -100% duplicate cost |
Cost Awareness Habits
Section titled “Cost Awareness Habits”# Check cost every 20-30 minutes/cost
# Sample output:# Input: 45,231 tokens ($0.14)# Output: 12,847 tokens ($0.19)# Total: 58,078 tokens ($0.33)
# If context > 60%, compact proactively/compactHandling Large Projects
Section titled “Handling Large Projects”Large Android/KMP projects (100K+ lines) require special strategies to stay within context limits.
The 3-Layer Reading Strategy
Section titled “The 3-Layer Reading Strategy”Layer 1: Structure (The Map)├── "Show me the project directory structure"├── "What are the main modules?"└── "Where are the entry points?"
Layer 2: Patterns (The Routes)├── "What architecture pattern is used?"├── "Show me the dependency graph between modules"└── "How does data flow from API to UI?"
Layer 3: Details (The Streets)├── "Read src/auth/LoginViewModel.kt"├── "Trace the payment flow from button click to API call"└── "What happens when the token expires?"Mobile/Android-Specific Tips
Section titled “Mobile/Android-Specific Tips”Batch Processing for Large Refactoring
Section titled “Batch Processing for Large Refactoring”Phase 1: Map (1 session)"Identify all files using deprecated API X"
Phase 2: Plan (1 session)"Create a migration plan — which files first, which have dependencies"
Phase 3: Execute (N sessions, batched)"Migrate files 1-10 from the plan. Test after each file."/compact"Migrate files 11-20..."Combining Claude with n8n & External Tools
Section titled “Combining Claude with n8n & External Tools”Integration Patterns
Section titled “Integration Patterns”| Pattern | Use Case | Example |
|---|---|---|
| Sequential Pipeline | Multi-step transformation | Email → Extract data → Generate report |
| Fan-Out/Fan-In | Parallel independent tasks | Analyze 10 PRs simultaneously |
| Classification Router | Different handling per type | Bug vs feature vs question triage |
| Human-in-the-Loop | Need approval | Code review with human sign-off |
| Batch Processing | Many items | Process 200+ customer reviews |
n8n + Claude Code Setup Tips
Section titled “n8n + Claude Code Setup Tips”Real-World n8n Workflows
Section titled “Real-World n8n Workflows”- Marketing agency: 50+ daily email briefs auto-processed — 2 hours reduced to 5 minutes
- Customer reviews: 200+ reviews analyzed with batch + sequential + router — 4 hours to 30 minutes
- Code deployment: PR merged → auto-generate changelog → notify Slack → update docs
Troubleshooting AI Hallucinations
Section titled “Troubleshooting AI Hallucinations”Red Flags Checklist
Section titled “Red Flags Checklist”Watch for these signs that Claude may be hallucinating:
| Red Flag | Example | What to Do |
|---|---|---|
| Generic descriptive names | awesome-validator, fast-json-loader | Verify package exists: npm view <name> |
| No source links provided | ”Use the X library” with no URL | Ask: “Link me to the GitHub repo” |
| Version number claims | ”Added in v3.2.1” | Check official changelog |
| Suspiciously perfect match | Exactly the API you need, no trade-offs | Too good? Verify independently |
| Mixed syntax styles | React class + hooks in same component | Ask Claude to pick one approach |
| Confident but wrong | ”This is the standard way to…” | Confidence does not equal accuracy |
Verification Commands
Section titled “Verification Commands”| What to Verify | Command | Source |
|---|---|---|
| npm package exists | npm view <package> | npmjs.com |
| Python package exists | pip show <package> | pypi.org |
| CLI flag exists | command --help | Official docs |
| File path exists | ls -la <path> | Your system |
| API endpoint works | curl -I <url> | Live server |
The Intervention Escalation Ladder
Section titled “The Intervention Escalation Ladder”When Claude gets stuck in a loop or produces incorrect output:
| Step | Action | Prompt |
|---|---|---|
| 1. Redirect | Change approach | ”Stop. Try a completely different approach.” |
| 2. Inform | Provide missing context | ”You might be missing: the API returns XML, not JSON.” |
| 3. Decompose | Break into smaller parts | ”Forget the full solution. Just solve the auth part first.” |
| 4. Refresh | Clear stale context | /compact |
| 5. Reset | Start fresh | /clear |
| 6. Human | Take over | You write the code manually |
Common Hallucination Scenarios
Section titled “Common Hallucination Scenarios”Adding Verification to CLAUDE.md
Section titled “Adding Verification to CLAUDE.md”Add this section to your CLAUDE.md to reduce hallucinations:
## Verification Rules- NEVER suggest packages without confirming they exist on npm/pypi- ALWAYS provide GitHub or docs URLs for third-party libraries- If unsure about an API, say "needs verification" instead of guessing- When suggesting version-specific features, cite the changelog