| .claude | ||
| .claudeignore | ||
| .gitignore | ||
| CLAUDE.md | ||
| README.md | ||
claude-files
A general-purpose Claude Code configuration template. Drop these files into any project to keep Claude focused, fast, and away from sensitive data.
What's included
| File | Purpose |
|---|---|
CLAUDE.md |
Project instructions Claude reads on every session — commands, architecture, conventions |
.claudeignore |
Tells Claude Code which files to skip when reading/indexing the project |
.claude/settings.json |
Hard permission denials — Claude cannot read these files even if asked |
These two layers work together: .claudeignore reduces noise and improves performance; settings.json enforces hard security boundaries that cannot be overridden by prompts.
Note:
.claudeignoreis widely used in the community and respected by Claude Code in practice, but it is not officially documented by Anthropic. It may change or stop working without notice. Thesettings.jsondeny rules are the only officially supported mechanism for blocking file access.
Why both files?
.claudeignoreis a context filter. It keeps build artifacts, caches, and IDE files out of Claude's working set so responses stay relevant and fast. Think of it like.gitignorefor Claude..claude/settings.jsonis an access control list. Even if a file slips past.claudeignore, thesedenyrules prevent Claude from reading it at all. Covers credentials, keys, cloud config, and secret files.
What's protected
- Environment files (
.env,.env.*,*.env,.envrc) - Private keys and certificates (
.pem,.key,.p12,.pfx, SSH keys) - Cloud credentials (
.aws/,.azure/,.config/gcloud/) - Package registry auth (
.npmrc,.netrc,.pypirc) - Docker credentials (
~/.docker/config.json) - Terraform state (
terraform.tfstate*) - Secret-named files and directories (
secrets/,*secret*.yml, etc.)
What's excluded from context (bloat)
node_modules/,dist/,build/,out/- Python environments and caches (
__pycache__/,.venv/,.pytest_cache/, etc.) - JS/TS framework artifacts (
.next/,.nuxt/,.svelte-kit/,.turbo/) - IDE folders (
.idea/,.vscode/) - OS noise (
.DS_Store,Thumbs.db) - Test coverage reports
Usage
New project
# Clone or download this repo, then copy the files into your project root
cp .claudeignore /path/to/your/project/
cp -r .claude /path/to/your/project/
Use as a GitHub template
Click "Use this template" on the repository page to create a new repo with these files already in place.
Extend for your stack
Add project-specific entries to .claudeignore as needed. For example:
# Go
**/vendor/**
# Rust
**/target/**
# Java / Kotlin
**/.gradle/**
**/build/**
For additional permission rules, add entries to the deny array in .claude/settings.json following the same glob pattern format.