🌟 Created by SenaiVerse Claude Code Agent System for Expo/React Native Development
Your complete reference for solving common issues and understanding the Claude Code Agent System
- 🚨 Critical Issues & Fixes
⚠️ Common Problems- ❓ Frequently Asked Questions
- 🛠️ Tool Reference Guide
- 📱 Expo/React Native Specific
- 💡 Best Practices by Scenario
- 🔍 Debugging Agent Issues
- ⚡ Performance Optimization
- 🎯 Quick Solutions Index
Symptoms:
Error: Agent 'design-token-guardian' not found
Unable to invoke @design-token-guardian
Root Causes & Fixes:
| Cause | How to Verify | Fix |
|---|---|---|
| Agent not installed | ls ~/.claude/agents/ |
Run install-agents.ps1 |
| Wrong agent name | Check exact name in file | Use @design-token-guardian (not @design-guardian) |
| File in wrong location | Check path | Move to ~/.claude/agents/tier-1-daily/ |
| YAML frontmatter error | Open .md file | Verify name: matches exactly |
Step-by-Step Fix:
# 1. Verify agents directory exists
ls ~/.claude/agents/
# 2. Check specific agent file
cat ~/.claude/agents/tier-1-daily/design-token-guardian.md
# 3. Verify YAML frontmatter
# Should see:
# ---
# name: design-token-guardian
# description: ...
# ---
# 4. If missing, re-run installer
cd ~/claude-code-expo-system/scripts
.\install-agents.ps1Symptoms:
PS> claude
claude : The term 'claude' is not recognized...Root Cause: Claude Code not installed or not in PATH
Fix:
# Option 1: Install Claude Code globally
npm install -g @anthropic-ai/claude-code
# Option 2: Verify installation
where.exe claude
# Option 3: If installed but not in PATH, add to PATH
# Windows: Add npm global folder to PATH
# Find npm global folder:
npm config get prefix
# Example: C:\Users\Senai\AppData\Roaming\npm
# Add to PATH in System Environment VariablesVerification:
claude --version
# Should output: 2.0.5 (or your version)Symptoms:
.\install-agents.ps1 : File cannot be loaded because running scripts is disabled...Fix:
# Run PowerShell as Administrator
# Then run:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
# Verify:
Get-ExecutionPolicy
# Should show: RemoteSigned
# Now retry installation
.\install-agents.ps1Symptoms:
- You ask about accessibility but @a11y-enforcer doesn't trigger
- Manual invocation works but automatic doesn't
Root Causes & Fixes:
| Issue | Fix |
|---|---|
| Description too vague | Make description: more specific in YAML |
| Context unclear | Add project-specific keywords to description |
| CLAUDE.md missing | Copy template to project root |
| Wrong working directory | Run claude from project root |
Example Fix:
# ❌ Too vague - won't auto-invoke
---
name: a11y-enforcer
description: Checks accessibility
---
# ✅ Specific - will auto-invoke
---
name: a11y-enforcer
description: Validates WCAG 2.2 accessibility compliance, checks for missing accessibilityLabel, accessibilityRole in React Native components, validates touch targets and color contrast
---Manual Invocation Workaround:
User: @a11y-enforcer check my components
Symptoms:
- Hook configured but doesn't run
- No validation happening before writes
Diagnosis:
# 1. Check ~/.claude/settings.json exists
cat ~/.claude/settings.json
# 2. Verify hook configuration
# Should have:
{
"hooks": {
"PreToolUse": [...]
}
}
# 3. Check hook script exists
ls ~/.claude/hooks/validate-a11y.jsCommon Issues:
| Problem | Solution |
|---|---|
| Hook script doesn't exist | Create the script file |
| Hook script not executable | chmod +x script.js (Linux/Mac) |
| Windows path issues | Use forward slashes: node ~/.claude/hooks/script.js |
| Hook crashes | Add error handling to script |
| Hook timeout (>60s) | Optimize script performance |
Test Hook Manually:
# Test hook script directly
node ~/.claude/hooks/validate-a11y.js < test-input.jsonSymptoms:
User: /review src/Button.tsx
Error: Command not recognized
Fixes:
# 1. Verify commands installed
ls ~/.claude/commands/
# 2. Check command file exists
cat ~/.claude/commands/review.md
# 3. Verify YAML frontmatter
# Should have:
# ---
# name: review
# description: ...
# ---
# 4. Restart Claude Code
# Exit and re-run: claudePossible Causes:
-
Wrong agent invoked
- Fix: Be explicit with @agent-name
-
Missing project context
- Fix: Ensure CLAUDE.md exists in project root
- Verify CLAUDE.md has correct tech stack info
-
Agent using wrong model
- Fix: Check
model:in agent YAML - Simple tasks:
model: sonnetormodel: haiku - Complex reasoning:
model: opus
- Fix: Check
-
Insufficient file context
- Fix: Reference specific files with @filepath
Example:
# ❌ Vague
User: Check the design system
# ✅ Specific
User: @design-token-guardian check src/screens/HomeScreen.tsx for hardcoded colors and spacing
Diagnosis:
| Symptom | Likely Cause | Fix |
|---|---|---|
| All agents slow | Model issue | Use model: haiku for simple tasks |
| Specific agent slow | Too many tools | Restrict tools in YAML |
| First invocation slow | Context loading | Normal - subsequent faster |
| Reading large files | File size | Use Grep instead of Read for large files |
Optimization:
# ❌ Too many tools (slower)
---
tools: Read, Write, Edit, Grep, Glob, Bash, Task, WebFetch
model: opus
---
# ✅ Only needed tools (faster)
---
tools: Read, Grep
model: sonnet
---Prevention Strategies:
-
Use Plan Mode (if available in your Claude Code version)
User: Plan mode: Refactor the auth system → Claude shows plan first, you approve -
Review before accepting
- Always read agent's proposed changes
- Use
/reviewbefore applying
-
Version control
# Before major changes git add . git commit -m "Before agent refactoring"
-
Test incrementally
- Don't run 5 agents at once
- Test each change individually
Q: Do I need all 20 agents?
A: No! Start with the 5 essential agents:
- @grand-architect (complex features)
- @design-token-guardian (visual consistency)
- @a11y-enforcer (accessibility - required for App Stores)
- @test-generator (quality)
- @performance-enforcer (speed)
Create additional agents only when you have specific needs.
Q: Will agents slow down my development?
A: No - they speed it up!
Real data from production usage:
- Initial learning: 2-3 days
- After that: 50% faster feature development
- Code review time: 80% reduction
- Bug fix time: 60% reduction
The ROI is positive within the first week.
Q: Can agents break my code?
A: Agents can make changes, but you can prevent issues:
Safety measures:
- ✅ Use version control (git)
- ✅ Review changes before accepting
- ✅ Test after each change
- ✅ Use hooks to block bad changes
- ✅ Start with read-only agents
Read-only agents (safe to use always):
- @performance-prophet (analysis only)
- @security-specialist (audit only)
- Any agent when you manually review output
Q: Should I choose Project-scoped or Global installation?
A: It depends on your use case:
Choose Project-scoped if:
- ✅ Working with a team (agents shared via git)
- ✅ Want different agent versions per project
- ✅ Need project-specific customizations
- ✅ Want automatic team sync
Choose Global if:
- ✅ Personal projects only
- ✅ Want same agents across all projects
- ✅ Install once, use everywhere
- ✅ Simpler setup
Pro tip: The installer asks you interactively! Just run .\install-agents.ps1 and choose.
Q: How does the interactive installer work?
A: When you run .\install-agents.ps1 without parameters:
Step 1: Menu appears:
1️⃣ Project-Scoped (team sync via git)
2️⃣ Global (personal use everywhere)
Step 2: You type 1 or 2 and press Enter
Step 3 (if Project):
- Scans current directory for
package.json - Shows results: "✅ PROJECT DETECTED" or "❌ ERROR: NO PROJECT FOUND"
- If found: Asks "Proceed? (Y/N)"
Step 4: Installs to the correct location
Skip prompts: Use -Scope project or -Scope global parameters
Q: How much does this cost?
A: Claude Code costs $20/month (Claude Pro or API usage).
This agent system is FREE - it's just configuration files.
ROI calculation:
- Cost: $20/month
- Time saved: ~80 hours/month
- Value: $4,000+ (at $50/hr developer rate)
- Net benefit: $3,980/month
Q: Can my team share these agents?
A: Yes! Two approaches:
Project-level (recommended for teams):
# Agents in project repo
your-project/
.claude/
agents/
commands/
CLAUDE.md
# Team members clone and useUser-level (personal setup):
# Each developer installs to ~/.claude/
# Good for personal preferencesSee Team Collaboration section.
Q: What's the difference between agents and slash commands?
Agents = AI assistants with specialized knowledge
- Invoked:
@agent-nameor automatically - Have their own context window
- Can use tools (Read, Write, etc.)
- Example:
@security-specialist
Slash Commands = Workflows that orchestrate multiple agents
- Invoked:
/command-name - Run a sequence of steps
- Can call multiple agents
- Example:
/reviewcalls design-token-guardian + a11y-enforcer + security-specialist
When to use:
- Single task → Agent
- Multi-step workflow → Slash command
Q: Can I use this with Expo Go or only development builds?
A: Works with both!
Expo Go (managed workflow):
- All agents work perfectly
- Focus on JS/TS code analysis
- Some native checks won't apply
Development Builds (custom native code):
- Full functionality
- Native module analysis
- Platform-specific checks work
The agents work at the code level, not runtime.
Q: Do agents work offline?
A: Partially.
Works offline:
- Reading local files
- Code analysis
- Pattern matching
Requires internet:
- WebFetch (documentation lookup)
- Model API calls (Claude AI)
Tip: Cache commonly-used docs locally for faster access.
Q: Can I use different AI models per agent?
A: Yes! Set in YAML frontmatter:
---
model: haiku # Fast, cheap, good for simple tasks
model: sonnet # Balanced, most common
model: opus # Smartest, for complex reasoning
---Recommendations:
- Simple checks → Haiku
- Most agents → Sonnet
- Grand Architect, Performance Prophet → Opus
Q: What if an agent suggests something I disagree with?
A: You're in control!
-
Reject the suggestion
- Don't apply the changes
- Agents can't force changes
-
Ask for alternatives
User: @security-specialist suggested X, but I prefer Y. Can you explain the tradeoffs? -
Customize the agent
- Edit agent's system prompt
- Add your team's preferences
-
Override with hooks
- Create validation hooks
- Block patterns you don't want
Q: What's a typical workflow for implementing a new feature?
A: Recommended workflow:
Step 1: Planning
User: I need @grand-architect to plan implementing [feature]
→ Grand Architect breaks down into phases
Step 2: Architecture Review
User: @security-specialist review the approach
User: @performance-prophet predict performance impact
Step 3: Implementation
User: /feature Implement [feature]
→ Multi-agent workflow executes
Step 4: Quality Assurance
User: /test src/new-feature/
User: /review src/new-feature/
Step 5: Final Checks
User: @a11y-enforcer audit
User: @performance-enforcer check bundle size
Time: Complex feature that used to take 3 days → 1.5 days
Q: Should I run agents before every commit?
A: Use hooks for automation:
// ~/.claude/settings.json
{
"hooks": {
"PreToolUse": [
{
"matcher": "Write",
"hooks": [
{"command": "validate-a11y.js"},
{"command": "check-design-tokens.js"}
]
}
]
}
}Or use git pre-commit hooks:
# .git/hooks/pre-commit
#!/bin/sh
claude --batch "/review staged-files"This ensures every commit is validated automatically.
Q: How do I know which agent to use for my problem?
A: Decision tree:
Is it a complex multi-phase feature?
├─ YES → @grand-architect
└─ NO ↓
Is it about visual design?
├─ YES → @design-token-guardian
└─ NO ↓
Is it about accessibility?
├─ YES → @a11y-enforcer
└─ NO ↓
Is it about security/auth/data?
├─ YES → @security-specialist
└─ NO ↓
Is it about performance?
├─ YES → @performance-prophet or @performance-enforcer
└─ NO ↓
Is it about testing?
├─ YES → @test-generator or @test-architect
└─ NO ↓
Not sure? → Use /review for comprehensive check
Or use Grand Architect to decide:
User: I need to [task]. Which agents should I use?
@grand-architect: Based on your task, I recommend...
| Tool | Purpose | Example Use Case | Performance |
|---|---|---|---|
| Read | Read file contents | Analyzing code structure | ⚡ Fast |
| Write | Create new files | Generating tests | ⚡ Fast |
| Edit | Modify existing files | Fixing hardcoded values | ⚡ Fast |
| Grep | Search file contents | Finding all console.log | ⚡⚡ Very Fast |
| Glob | Find files by pattern | Finding all *.test.tsx | ⚡⚡ Very Fast |
| Bash | Run shell commands | npm test, bundle analysis | 🐢 Varies |
| Task | Launch sub-agents | Grand Architect delegation | 🐢 Slow |
| WebFetch | Fetch documentation | Latest React Native docs | 🐢 Slow |
Task: Find and fix all hardcoded colors
tools: Grep, Read, Edit
# Grep to find, Read to verify, Edit to fixTask: Generate comprehensive tests
tools: Read, Write, Bash
# Read component, Write test, Bash to run testTask: Security audit
tools: Read, Grep, Glob, Bash
# Glob finds files, Grep finds patterns, Read for analysis, Bash for security toolsTask: Orchestrate complex feature
tools: Task, Read, Grep, Glob
# Task to delegate, others for analysisSolution Workflow:
1. @cross-platform-enforcer analyze the differences
2. @security-specialist check for platform-specific vulnerabilities
3. @memory-detective check for Android-specific memory leaks
Common causes detected:
overScrollModeconflicts with gesture handler- Missing Android-specific permissions
- Platform-specific API differences
Solution Workflow:
1. @bundle-assassin analyze current size
→ Identifies: lodash fully imported (547KB)
2. Apply fixes:
- Tree-shake imports
- Lazy load screens
- Optimize images
3. @performance-enforcer verify budget met
Typical savings: 30-50% reduction
Solution Workflow:
1. @a11y-enforcer audit entire app
→ Finds: 47 missing accessibilityLabel props
2. Auto-fix available:
- Adds missing props
- Fixes touch targets
- Corrects color contrast
3. Verification:
- Run VoiceOver (iOS) test
- Run TalkBack (Android) test
Result: Passes App Store review
Solution Workflow:
1. @journey-cartographer map complete login flow
→ Discovers: Token expires during OAuth callback
2. @security-specialist audit auth flow
→ Finds: Missing token refresh logic
3. @test-generator create E2E tests
→ Covers: Network timeout, background/foreground, token expiry
4. Implementation with @refactor-surgeon
→ Zero-breaking changes guaranteed
# Agent: deployment-orchestrator (create custom)
---
name: deployment-orchestrator
description: Automates EAS build and submit workflow
tools: Bash
---
You run EAS build and submit commands:
1. Run tests: npm test
2. Build: eas build --platform all --profile production
3. Submit: eas submit --platform all
4. Monitor: Check Sentry for crashesAgents understand Expo Router:
// @design-token-guardian knows this pattern
import { Stack } from 'expo-router';
// @a11y-enforcer validates navigation accessibility
<Stack.Screen
name="home"
options={{
title: "Home", // Accessible title
headerAccessibilityLabel: "Home screen header"
}}
/>✅ DO:
1. @grand-architect plan the feature first
2. @security-specialist review approach (if sensitive)
3. Use /feature command for implementation
4. Run /test after implementation
5. Run /review before PR
❌ DON'T:
- Jump straight to coding without planning
- Skip security review for auth/payment features
- Forget cross-platform testing
Time saved: 40% faster implementation
✅ DO:
1. Use /review command (runs 5 agents in parallel)
2. Check all CRITICAL issues
3. Consider WARNINGS based on priority
4. Apply auto-fixes when available
❌ DON'T:
- Review without running agents first
- Ignore accessibility warnings
- Skip performance checks
Time saved: 80% faster reviews
✅ DO:
1. @journey-cartographer map the user flow
2. @memory-detective check for leaks
3. @security-specialist if data-related
4. @test-generator create regression test
❌ DON'T:
- Guess at the problem
- Fix without adding tests
- Deploy without verification
Time saved: 60% faster bug resolution
✅ DO:
1. @a11y-enforcer full app audit
2. @security-specialist security review
3. @performance-enforcer check all budgets
4. @cross-platform-enforcer iOS/Android parity
5. @test-generator ensure critical path coverage
❌ DON'T:
- Submit without accessibility check
- Ignore performance budgets
- Skip cross-platform testing
Rejection rate: Reduced by 90%
✅ DO:
1. @debt-quantifier measure current debt
2. @grand-architect plan refactoring phases
3. @refactor-surgeon execute with rollback strategy
4. @test-generator create safety net
5. Validate after each phase
❌ DON'T:
- Refactor without tests
- Make all changes at once
- Skip rollback planning
Success rate: 100% (with zero-breaking strategy)
Debug steps:
-
Check agent's context
User: What files do you have access to? Agent: [Lists files] -
Verify CLAUDE.md is loaded
User: What tech stack is this project using? Agent: [Should mention Expo, React Native from CLAUDE.md] -
Check agent's system prompt
cat ~/.claude/agents/tier-1-daily/a11y-enforcer.md # Review the system prompt
-
Provide more context
# Instead of: User: Check accessibility # Try: User: @a11y-enforcer audit src/screens/LoginScreen.tsx for WCAG 2.2 AA compliance
Possible causes:
| Cause | Solution |
|---|---|
| Reading too many files | Use Grep instead of Read for large scans |
| Complex operation | Break into smaller tasks |
| Network fetch slow | Cache docs locally |
| Model timeout | Switch to faster model (haiku) |
Example fix:
# ❌ Slow - reads 100 files
tools: Read, Glob
# ✅ Fast - searches with pattern
tools: GrepScenario: Two agents give opposite advice
Resolution:
User: @design-token-guardian and @performance-enforcer disagree. Design says use theme.colors.primary, Performance says hardcode for speed. Which is correct?
@grand-architect: Design system consistency > micro-optimization. Use theme.colors.primary. The performance difference is negligible (<1ms), but inconsistency creates maintenance debt.
Rule of thumb: Ask Grand Architect to resolve conflicts.
# ❌ Overkill (slow)
name: simple-lint-check
model: opus
# ✅ Right-sized (fast)
name: simple-lint-check
model: haiku# ❌ All tools (slower)
tools: Read, Write, Edit, Grep, Glob, Bash, Task, WebFetch
# ✅ Only needed (faster)
tools: Grep, Read# ❌ Too generic - requires more processing
description: Helps with code
# ✅ Specific - faster matching
description: Checks React Native components for missing accessibilityLabel props# ❌ Slow - reads all files
@agent: Read all files in src/ and find console.log
# ✅ Fast - searches with pattern
@agent: Grep for "console.log" in src/**/*.tsxRun agents in parallel when possible:
# ❌ Sequential (slow - 60 seconds total)
1. @design-token-guardian (20s)
2. @a11y-enforcer (20s)
3. @performance-enforcer (20s)
# ✅ Parallel (fast - 20 seconds total)
/review command runs all 3 simultaneously
| Problem | Quick Fix | Reference |
|---|---|---|
| Agent not found | Run install-agents.ps1 |
Critical Issues |
| Permission denied | Set-ExecutionPolicy RemoteSigned |
Critical Issues |
| Slow responses | Use model: haiku |
Performance |
| Wrong suggestions | Add CLAUDE.md context | Common Problems |
| Hooks not running | Check ~/.claude/settings.json | Critical Issues |
| Bundle too large | Use @bundle-assassin | Expo/RN Specific |
| Accessibility rejection | Use @a11y-enforcer | Expo/RN Specific |
| Production bugs | Use @journey-cartographer | Best Practices |
| Phase | Recommended Agents | Command |
|---|---|---|
| Planning | @grand-architect, @impact-analyzer | Manual invoke |
| Implementation | /feature command | /feature [description] |
| Testing | @test-generator | /test [file] |
| Review | All quality agents | /review [file] |
| Security | @security-specialist | Manual invoke |
| Optimization | @performance-prophet, @bundle-assassin | Manual invoke |
| Deployment | @cross-platform-enforcer | Manual invoke |
| Error Message | Meaning | Fix |
|---|---|---|
| "Agent not found" | Not installed | Reinstall |
| "Permission denied" | Windows security | Set-ExecutionPolicy |
| "Command not recognized" | Slash command issue | Check ~/.claude/commands/ |
| "Tool not allowed" | Tool restriction | Update tools: in YAML |
| "Timeout" | Operation too slow | Use faster model or tools |
| "Invalid YAML" | Frontmatter syntax error | Check YAML formatting |
Before asking for help, try these:
- Read START-HERE.md
- Check this troubleshooting guide
- Verify installation:
claude --version - Check agent files exist:
ls ~/.claude/agents/ - Review COMPLETE-GUIDE.md for detailed examples
- Try manual invocation:
@agent-name - Check CLAUDE.md exists in project
- Restart Claude Code
-
Check official docs:
-
Review agent configuration:
cat ~/.claude/agents/[agent-name].md -
Test in isolation:
User: @agent-name --help # Or just invoke with simple test -
Verify environment:
node --version # Should be 18+ npm --version claude --version # Should be 2.0.0+
1. START-HERE.md (5 min)
↓
2. This guide (Troubleshooting - 15 min)
↓
3. COMPLETE-GUIDE.md (Full reference - 60 min)
↓
4. Create custom agents (Practice)
- Claude Code Official Docs: https://docs.claude.com/en/docs/claude-code
- Expo Documentation: https://docs.expo.dev
- React Native Docs: https://reactnative.dev
- WCAG Guidelines: https://www.w3.org/WAI/WCAG22/quickref/
- OWASP Mobile Top 10: https://owasp.org/www-project-mobile-top-10/
You're using the system correctly if:
✅ Agents auto-invoke for relevant tasks ✅ /review catches issues before you do ✅ @test-generator creates meaningful tests ✅ Bundle size stays under budget ✅ Accessibility compliance is automatic ✅ Code reviews take <10 minutes ✅ Refactoring is safe and fast ✅ Security issues caught early
Red flags that something's wrong:
❌ Agents never auto-invoke ❌ Constant "agent not found" errors ❌ Agents give irrelevant suggestions ❌ Every operation times out ❌ Hooks never run ❌ Manual invocation always needed
-
If everything works: Move to COMPLETE-GUIDE.md for advanced workflows
-
If still having issues: Check Quick Solutions Index
-
Ready to customize: See AGENTS-REFERENCE.md
-
Want to contribute: Create your own agents and share!
Remember: The agents are tools to augment your development, not replace your judgment. You're always in control! 🎯
Version: 1.2.0 Last Updated: 2025-10-05 For: Claude Code v2.0.5 + Windows + Expo/React Native
© 2025 SenaiVerse | Claude Code Agent System v1.2.0 | Built for React Native Mobile Excellence