docs/customization/clineignore.mdx
.clineignore filters what Cline loads automatically, but it is not a security or access-control boundary — ignored files can still be read via explicit @ mentions or shell commands. We're moving away from it as a supported feature.
</Warning>
While .clineignore is being phased out, you can get a stronger, enforced restriction on file reads and edits with the Block Ignored File Access Cline plugin example. Unlike .clineignore, it uses a beforeTool runtime hook to actively block tool calls: when read_files, editor, or apply_patch targets a file ignored by your workspace's .gitignore file.
Install it into your project with:
cline plugin install https://github.com/cline/cline/blob/main/sdk/examples/plugins/gitignore-read-files-guard.ts --cwd .
See Plugins for installation details and scopes. </Note>
The .clineignore file tells Cline which files and directories to skip when analyzing your codebase. It works like .gitignore: create a file named .clineignore in your project root, add patterns for files you want excluded, and Cline will ignore them.
Without a .clineignore, Cline may load your entire project into context, including dependencies, build artifacts, and generated files. This wastes tokens, increases costs, and can push useful context out of the window.
Adding a .clineignore can cut your starting context from 200k+ tokens to under 50k. That means faster responses, lower costs, and the ability to use smaller, cheaper models effectively.
Create a file named .clineignore in your project root:
# Dependencies
node_modules/
**/node_modules/
# Build outputs
/build/
/dist/
/.next/
/out/
# Testing artifacts
/coverage/
# Environment variables
.env
.env.*
# Large data files
*.csv
*.xlsx
*.sqlite
# Generated/minified code
*.min.js
*.map
.clineignore uses the same pattern syntax as .gitignore:
| Pattern | Matches |
|---|---|
node_modules/ | The node_modules directory |
**/node_modules/ | node_modules at any depth |
*.csv | All CSV files |
/build/ | The build directory at the project root only |
*.env.* | Files like .env.local, .env.production |
!important.csv | Exception: do not ignore this file |
Lines starting with # are comments. Blank lines are ignored.
Start with these categories and adjust for your project:
Almost always exclude:
node_modules/, vendor/, .venv/)dist/, build/, .next/, out/)coverage/)package-lock.json, yarn.lock)Exclude if present:
.csv, .xlsx, .sqlite, .parquet).env, .env.local)Keep accessible:
tsconfig.json, package.json)When Cline scans your project to build context, it checks each file path against your .clineignore patterns. Matching files are excluded from:
As noted above, explicit @ mentions still bypass these rules — for example, @/node_modules/some-package/index.js reads that file even though node_modules/ is ignored. Ignore rules control automatic loading, not explicit access.
.clineignore. The difference is often dramatic..clineignore. See Multi-Root Workspaces for details.