Regex Pattern Guide for Claude Helper

Overview

This guide explains how to use regex patterns to exclude files and folders from being uploaded to Claude AI. The extension matches these patterns against the full file paths.

How to Add Patterns

  1. Open the extension settings
  2. Go to the "Exclude by Regex Pattern" section
  3. Enter one pattern per line in the textarea
  4. Click "Add Regex Pattern"

⚠️ Important: Add each pattern on a new line. Do not paste multiple patterns in one line.

Common Use Cases and Patterns

1. Exclude Common Directories

node_modules/     # Excludes node_modules folder and its contents

\.git # Excludes .git folder and its contents

dist # Excludes dist folder and its contents

build # Excludes build folder and its contents

coverage # Excludes coverage folder and its contents

2. Exclude Configuration Files

package-lock\.json$      # Excludes package-lock.json

\.env$ # Excludes .env files

\.config\.(js|ts)$ # Excludes .config.js and .config.ts files

3. Exclude Build/Compiled Files

\.min\.js$              # Excludes minified JavaScript files

\.(map|bundle)\.js$ # Excludes source maps and bundled files

4. Exclude Temporary and System Files

\.DS_Store$     # Excludes macOS system files

desktop\.ini$ # Excludes Windows system files

\.tmp$ # Excludes temporary files

~$ # Excludes backup files (ending with ~)

Pattern Matching Rules

Basic Rules

  • Patterns are case-sensitive
  • Patterns match anywhere in the path unless anchored
  • Use ^ to match the start of the path
  • Use $ to match the end of the path

Special Characters

  • . matches any character (use \. to match a literal dot)
  • * matches zero or more characters
  • ? matches exactly one character
  • | means OR (e.g., (js|ts) matches "js" or "ts")
  • ^ matches the start of the path
  • $ matches the end of the path

Examples with Explanations

^test/          # Matches paths starting with "test/"

\.test\.js$ # Matches files ending with .test.js

(spec|test)\.js # Matches both spec.js and test.js files

^\.. # Matches any hidden file/folder (starting with .)
Back to Home