docs/customization/clineignore.mdx
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:
You can still reference ignored files explicitly using @ mentions. If you type @/node_modules/some-package/index.js, Cline will read that specific file even though node_modules/ is in your .clineignore. The ignore rules control automatic loading, not explicit access.
.clineignore early in your project. It's easier to start with broad exclusions and narrow them than to debug why context is bloated later..clineignore. The difference is often dramatic..clineignore. See Multi-Root Workspaces for details.