file-suggestion
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.
Best use case
file-suggestion is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
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.
Teams using file-suggestion should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/file-suggestion/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How file-suggestion Compares
| Feature / Agent | file-suggestion | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
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.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# File Suggestion Setup
This 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.
## Prerequisites
Install these tools before setup:
```bash
# Ubuntu/Debian
sudo apt install ripgrep jq fzf
# macOS
brew install ripgrep jq fzf
# Arch Linux
sudo pacman -S ripgrep jq fzf
```
## Setup Steps
### 1. Create the Script
Create the file suggestion script at `~/.claude/file-suggestion.sh`:
```bash
#!/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
```
### 2. Make It Executable
```bash
chmod +x ~/.claude/file-suggestion.sh
```
### 3. Configure Claude Code
Add this to your `~/.claude/settings.json`:
```json
{
"fileSuggestion": {
"type": "command",
"command": "~/.claude/file-suggestion.sh"
}
}
```
## How It Works
The script:
1. **Receives JSON input** with a `query` field from Claude Code
2. **Uses ripgrep** (`rg --files`) to list files fast, respecting `.gitignore`
3. **Follows symlinks** with `--follow` flag
4. **Includes hidden files** with `--hidden` flag
5. **Fuzzy filters** results using `fzf --filter`
6. **Returns top 15 matches** sorted by relevance
## Customization
### Include Gitignored Paths
Uncomment and customize the additional paths section:
```bash
# 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
```
### Exclude Patterns
Add ripgrep glob patterns to exclude files:
```bash
rg --files --follow --hidden \
--glob '!*.min.js' \
--glob '!*.map' \
--glob '!node_modules' \
. 2>/dev/null
```
### Change Result Limit
Modify the `head -15` to return more or fewer results:
```bash
# Return top 25 matches
... | head -25
```
## Troubleshooting
### Script Not Found
Ensure the path in settings.json matches your script location and uses `~` or absolute path.
### No Results
Check that:
- ripgrep is installed: `which rg`
- fzf is installed: `which fzf`
- jq is installed: `which jq`
- Script is executable: `ls -la ~/.claude/file-suggestion.sh`
### Slow Performance
If you have a large repo:
- Ensure `.gitignore` excludes `node_modules`, `dist`, etc.
- Add explicit `--glob '!pattern'` exclusions for large directories
## Template Script
A ready-to-use template is available at:
```bash
${CLAUDE_PLUGIN_ROOT}/skills/file-suggestion/scripts/file-suggestion.sh
```
Copy it to your `~/.claude/` directory and customize as needed.Related Skills
file-path-traversal
This skill should be used when the user asks to "test for directory traversal", "exploit path traversal vulnerabilities", "read arbitrary files through web applications", "find LFI vu...
file-management-rules
Specifies file management guidelines, including including full file paths as comments, updating project structure in AI.MD, and maintaining package.json. This rule ensures organized and well-documente
file-archiver
创建和解压ZIP、TAR和GZIP压缩包,支持密码保护。
deepagents-filesystem
Using FilesystemMiddleware with virtual filesystems, backends (State, Store, Filesystem, Composite), and context management for Deep Agents.
authoring-excalidraw-files
Generate architecture diagrams as .excalidraw files. Use when the user asks to create architecture diagrams, system diagrams, visualize codebase structure, infrastructure diagrams, or generate excalidraw files.
add-new-file
Guide for adding new files to this codebase while respecting architectural principles including Separation of Concerns, Common Closure Principle, small composable functions (max 20 lines), and externalizing constants. Use when creating new modules, utilities, or any new source files in the project.
ai-file-analyzer
Analyze Adobe Illustrator (.ai) files to extract design information including text content, fonts, color palettes, vector paths, and generate high-resolution preview images. Use when analyzing logo files, design assets, or any Adobe Illustrator documents that need programmatic inspection.
waiverfile-automation
Automate Waiverfile tasks via Rube MCP (Composio). Always search tools first for current schemas.
routing-profiles
Change the Routing Solution routing profiles/vehicle types. To be used as part of customize-main skill
chatfiles
Coordinate multiple Claude agents via shared text files. Triggers on Chatfile, multi-agent, cross-machine coordination.
azure-storage-file-datalake-py
Azure Data Lake Storage Gen2 SDK for Python. Use for hierarchical file systems, big data analytics, and file/directory operations.
agentpmt-tool-file-management-d789ed
Use AgentPMT external API to run the File Management tool with wallet signatures, credits purchase, or credits earned from jobs.