apps/docs/docs/features/rooignore.md
The .rooignore file is a key feature for managing Roo Code's interaction with your project files. It allows you to specify files and directories that Roo should not access or modify, similar to how .gitignore works for Git.
.rooignore?.rooignore in the root directory of your VS Code workspace. List patterns in this file to tell Roo which files and directories to ignore..rooignore affects both Roo's tools and context mentions (like @directory attachments).Roo actively monitors the .rooignore file. Any changes you make are reloaded automatically, ensuring Roo always uses the most current rules. The .rooignore file itself is always implicitly ignored, so Roo cannot change its own access rules.
The syntax for .rooignore is identical to .gitignore. Here are common examples:
node_modules/: Ignores the entire node_modules directory.*.log: Ignores all files ending in .log.config/secrets.json: Ignores a specific file.!important.log: An exception; Roo will not ignore this specific file, even if a broader pattern like *.log exists.build/: Ignores the build directory.docs/**/*.md: Ignores all Markdown files in the docs directory and its subdirectories.For a comprehensive guide on syntax, refer to the official Git documentation on .gitignore.
.rooignore.rooignore rules are enforced across various Roo tools:
These tools directly check .rooignore before any file operation. If a file is ignored, the operation is blocked:
read_file: Will not read ignored files.write_to_file: Will not write to or create new ignored files.apply_diff: Will not apply diffs to ignored files.list_files Tool & @directory Attachments: When Roo lists files or when you use @directory attachments, ignored files are omitted or marked with a 🔒 symbol (see "User Experience" below). Both use identical filtering logic.@directory Attachments: Directory contents respect .rooignore patterns. Ignored files are filtered out or marked with [🔒] prefix depending on the showRooIgnoredFiles setting.execute_command Tool: This tool checks if a command (from a predefined list like cat or grep) targets an ignored file. If so, execution is blocked..rooignore rules apply only to files and directories within the current VS Code workspace root. Files outside this scope are not affected.execute_command Specificity: Protection for execute_command is limited to a predefined list of file-reading commands. Custom scripts or uncommon utilities might not be caught..rooignore is a powerful tool for controlling Roo's file access via its tools, but it does not create a system-level sandbox.@directory attachments, files ignored by .rooignore may be marked with a lock symbol (🔒), depending on the showRooIgnoredFiles setting (defaults to true)."Access to [file_path] is blocked by the .rooignore file settings. You must try to continue in the task without using this file, or ask the user to update the .rooignore file.".rooignore.This guide helps you understand the .rooignore feature, its capabilities, and its current limitations, so you can effectively manage Roo's interaction with your codebase.