# Invoke Ignore

The `.invokeignore` file lets you control which files and folders the Agent can see and access. Use it to hide sensitive files, reduce noise, or keep the Agent focused on relevant code.

## How It Works

When you create a `.invokeignore` file in your project root, Invoke prevents the Agent from:

- **Reading** ignored files
- **Editing** ignored files
- **Searching** within ignored files
- **Listing** ignored files in directory scans
- **Mentioning** ignored files with `@`

```
.invokeignore in project root
        ↓
All Agent tools respect the patterns
        ↓
Ignored files are invisible to the Agent
```

The Agent treats `.invokeignore` and `.gitignore` the same way. Both files work together—patterns from both are combined.

## Creating a .invokeignore File

### Create the File

Create a file named `.invokeignore` in your project's root directory (same level as `package.json` or `Cargo.toml`).

### Add Patterns

Add one pattern per line. Use gitignore-style syntax.

```
# Sensitive files
.env
.env.local
secrets/

# Large generated files
coverage/
*.min.js

# Dependencies
vendor/
```

### Save

Save the file. Patterns take effect immediately—no restart needed.

## Pattern Syntax

`.invokeignore` uses the same syntax as `.gitignore`:

### Basic Patterns

| Pattern           | What It Ignores                          |
| ------------------| ---------------------------------------- |
| `file.txt`       | Exact file named `file.txt`             |
| `*.log`          | All files ending in `.log`              |
| `folder/`        | Directory named `folder` and all contents|
| `.env*`          | All files starting with `.env`          |

### Examples

#### Files
```
# Exact file matches
.DS_Store
Thumbs.db
.env
.env.local
credentials.json

# Extension matches
*.log
*.tmp
*.bak
*.swp
```

#### Directories
```
# Directories (end with /)
node_modules/
vendor/
dist/
build/
coverage/
.cache/
__pycache__/
```

#### Wildcards
```
# Prefix wildcards
*.min.js
*.min.css
*.bundle.js

# Suffix wildcards
.env*          # .env, .env.local, .env.production
test_*         # test_utils.py, test_helpers.py

# Multiple extensions
*.log
*.tmp
*.temp
```

### Comments

Lines starting with `#` are comments:
```
# This is a comment
.env

# Ignore all log files
*.log
```

## File Location

The `.invokeignore` file must be in your project root:
```
my-project/
├── .invokeignore    ✓ Correct location
├── .gitignore
├── package.json
├── src/
│   └── .invokeignore    ✗ Won't be detected
└── ...
```

Currently, `.invokeignore` only works at the project root level. Nested ignore files in subdirectories are not supported.
