# Troubleshooting Guide Solutions to common problems with Claude Craft. --- ## Installation Issues ### "yq: command not found" **Problem:** The installation scripts require yq but it's not installed or the wrong version is installed. **Solution:** ```bash # Check current version (if any) which yq yq --version # Install correct version (Mike Farah's yq v4) # macOS brew install yq # Ubuntu/Debian sudo apt install yq # Or download binary directly sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/local/bin/yq sudo chmod +x /usr/local/bin/yq ``` **Note:** There are multiple tools named "yq". Claude Craft requires Mike Farah's version (v4+), not the Python version. --- ### "Permission denied" when running scripts **Problem:** Installation scripts are not executable. **Solution:** ```bash # Make all scripts executable chmod +x Dev/scripts/*.sh # Or use make make fix-permissions # Or run with bash directly bash Dev/scripts/install-symfony-rules.sh --lang=en ~/my-project ``` --- ### "Target directory does not exist" **Problem:** The target project directory doesn't exist. **Solution:** ```bash # Create the directory first mkdir -p ~/my-project # Then run installation make install-symfony TARGET=~/my-project ``` --- ### Installation completes but files are missing **Problem:** Some files weren't copied during installation. **Diagnosis:** ```bash # Check what was installed ls -la ~/my-project/.claude/ # Count files find ~/my-project/.claude -name "*.md" | wc -l ``` **Solution:** ```bash # Force reinstall make install-symfony TARGET=~/my-project OPTIONS="--force" # Or run with verbose output ./Dev/scripts/install-symfony-rules.sh --verbose ~/my-project ``` --- ### NPX cache issues **Problem:** NPX uses old cached version of Claude Craft. **Solution:** ```bash # Clear NPX cache npx clear-npx-cache # Or manually remove rm -rf ~/.npm/_npx # Then reinstall npx @the-bearded-bear/claude-craft install ~/my-project --tech=symfony ``` --- ## Claude Code Issues ### Commands not showing up **Problem:** Slash commands don't appear in Claude Code. **Diagnosis:** ```bash # Verify commands directory exists ls -la ~/my-project/.claude/commands/ # Check file format head -20 ~/my-project/.claude/commands/common/pre-commit-check.md ``` **Solutions:** 1. **Restart Claude Code session** ```bash # Exit and restart exit claude ``` 2. **Check YAML frontmatter is valid** ```yaml --- description: Brief description argument-hint: [arg2] --- ``` 3. **Verify file extension is `.md`** 4. **Check Claude Code version** ```bash claude --version # Requires Claude Code 2.1.97+ ``` --- ### Agents not responding **Problem:** @agent mentions don't trigger the agent behavior. **Diagnosis:** ```bash # Check agents directory ls -la ~/my-project/.claude/agents/ # Verify agent file format head -20 ~/my-project/.claude/agents/api-designer.md ``` **Solutions:** 1. **Use exact agent name** ``` # Correct @api-designer Help me design... # Incorrect @API-Designer Help me design... @apidesigner Help me design... ``` 2. **Check frontmatter format** ```yaml --- name: api-designer description: Expert in REST/GraphQL API design --- ``` --- ### Plan mode crash (v2.1.38) **Problem:** Claude Code crashes when entering plan mode. **Cause:** Project config in `~/.claude.json` is missing default fields. **Solution:** ```bash # Ensure ~/.claude.json has valid structure # Update Claude Code to v2.1.38+ npm update -g @anthropic-ai/claude-code ``` --- ### Heredoc "Bad substitution" errors **Problem:** Bash tool produces "Bad substitution" errors with JavaScript template literals like `${index + 1}` in heredocs. **Solution:** Update Claude Code to v2.1.38+ which fixes heredoc parsing for JS template literals. --- ### Tab key queues slash commands instead of autocompleting **Problem:** Pressing Tab queues slash commands instead of triggering autocomplete. **Solution:** Update Claude Code to v2.1.38+ which fixes Tab key behavior. --- ### Skills not loading **Problem:** Skills don't activate when triggered. **Diagnosis:** ```bash # Check skills directory ls -la ~/my-project/.claude/skills/ # Check context.yaml cat ~/my-project/.claude/context.yaml ``` **Solutions:** 1. **Rescan skills sans redémarrer la session (v2.1.157+)** ``` /reload-skills ``` Cette commande est distincte de `/reload-plugins` (qui recharge les MCP). À utiliser après tout ajout ou modification d'un fichier skill. 2. **Verify context.yaml format** ```yaml triggers: - pattern: "*.test.ts" skills: ["testing"] ``` 3. **Use explicit skill invocation** ``` /testing ``` 4. **Restart Claude Code if /reload-skills is not available** (Requires Claude Code v2.1.157+) ```bash exit claude ``` --- ### Stalled Stream Handling (v2.1.105+) **Problem:** Claude Code appears frozen with no response for 5+ minutes. **Solution:** Claude Code v2.1.105+ automatically detects stalled streams with a 5-minute timeout and automatic retry mechanism. **Manual recovery:** ```bash # Resume the stalled session claude --resume # Or use debug mode /debug ``` **Common causes:** - Network interruptions or unstable connections - API rate limiting - Large file operations (reading/writing very large files) - MCP server hangs or unresponsive external tools **Prevention:** - Keep Claude Code updated to v2.1.105+ - Monitor network stability during long operations - Break down large file operations into smaller chunks - Review MCP server logs if using external tools --- ### WebFetch Token Optimization (v2.1.105+) **Problem:** WebFetch consuming excessive tokens when fetching web pages. **Solution:** Claude Code v2.1.105+ automatically strips `