Skip to content

Instantly share code, notes, and snippets.

@vedovato
Forked from cicorias/README.md
Created February 16, 2026 17:44
Show Gist options
  • Select an option

  • Save vedovato/82579339c5d59676f3ddd5f39e1f1d43 to your computer and use it in GitHub Desktop.

Select an option

Save vedovato/82579339c5d59676f3ddd5f39e1f1d43 to your computer and use it in GitHub Desktop.
claude file search tool - quick guide to improve and make faster your Claude Code file suggestion

quick guide to improve and make faster your Claude Code file suggestion

from https://x.com/thayto_dev/status/2009401734213554494?s=43

before all you have to install ripgrep, jq, fzf

Add this to your ~/.claude/settings.json

"fileSuggestion": {
    "type": "command",
    "command": "~/.claude/file-suggestion.sh"
  },

create this file ~/.claude/file-suggestion.sh then add this:

#!/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

then in your terminal:

chmod +x ~/.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
"fileSuggestion": {
"type": "command",
"command": "~/.claude/file-suggestion.sh"
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment