Set up fast file suggestions for Claude Code using ripgrep, jq, and fzf. Use this skill when users want to improve file autocomplete performance or add custom file suggestion behavior.
/plugin marketplace add RBozydar/rbw-claude-code/plugin install core@rbw-claude-codeThis skill inherits all available tools. When active, it can use any tool Claude has access to.
scripts/file-suggestion.shThis skill helps you configure Claude Code's file suggestion feature with a custom script that uses ripgrep, jq, and fzf for fast fuzzy file matching.
Install these tools before setup:
# Ubuntu/Debian
sudo apt install ripgrep jq fzf
# macOS
brew install ripgrep jq fzf
# Arch Linux
sudo pacman -S ripgrep jq fzf
Create the file suggestion script at ~/.claude/file-suggestion.sh:
#!/bin/bash
# Custom file suggestion script for Claude Code
# Uses rg + fzf for fuzzy matching and symlink support
# Parse JSON input to get query
QUERY=$(jq -r '.query // ""')
# Use project dir from env, fallback to pwd
PROJECT_DIR="${CLAUDE_PROJECT_DIR:-.}"
# cd into project dir so rg outputs relative paths
cd "$PROJECT_DIR" || exit 1
{
# Main search - respects .gitignore, includes hidden files, follows symlinks
rg --files --follow --hidden . 2>/dev/null
# Additional paths - include even if gitignored (uncomment and customize)
# [ -e .notes ] && rg --files --follow --hidden --no-ignore-vcs .notes 2>/dev/null
} | sort -u | fzf --filter "$QUERY" | head -15
chmod +x ~/.claude/file-suggestion.sh
Add this to your ~/.claude/settings.json:
{
"fileSuggestion": {
"type": "command",
"command": "~/.claude/file-suggestion.sh"
}
}
The script:
query field from Claude Coderg --files) to list files fast, respecting .gitignore--follow flag--hidden flagfzf --filterUncomment and customize the additional paths section:
# Include .notes directory even if gitignored
[ -e .notes ] && rg --files --follow --hidden --no-ignore-vcs .notes 2>/dev/null
# Include vendor directory
[ -e vendor ] && rg --files --follow --hidden --no-ignore-vcs vendor 2>/dev/null
Add ripgrep glob patterns to exclude files:
rg --files --follow --hidden \
--glob '!*.min.js' \
--glob '!*.map' \
--glob '!node_modules' \
. 2>/dev/null
Modify the head -15 to return more or fewer results:
# Return top 25 matches
... | head -25
Ensure the path in settings.json matches your script location and uses ~ or absolute path.
Check that:
which rgwhich fzfwhich jqls -la ~/.claude/file-suggestion.shIf you have a large repo:
.gitignore excludes node_modules, dist, etc.--glob '!pattern' exclusions for large directoriesA ready-to-use template is available at:
${CLAUDE_PLUGIN_ROOT}/skills/file-suggestion/scripts/file-suggestion.sh
Copy it to your ~/.claude/ directory and customize as needed.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.