AI Skill StudioAI Skill Studio
Skill Library
Presets:

Target Standard & File Format

AI Agent Rules & Skills
Context Shields & Privacy (Ignore Files)
Integrations & Machine Documentation
AI Governance & Multi-Agent Planning Suite

.claudeignore Shield

Define boundary exclusions for Claude Code CLI to guard credentials and reduce prompt bloat:

Full Protection
Tokens Saved / Turn
~190k tokens
Secret Leak Guards
2 Active Guards
Shield Categories
8 of 8 Enabled

Indexing Boundary Categories

Toggle specific categories to mask secrets and exclude heavy artifacts:

Custom Rules & Negate Exceptions

Append repo-specific file globs or re-include allowed files with negation patterns (!path):

Backend · Claude Code (via permissions.deny)

Django 6 & Ninja / DRF .claudeignore

A .claudeignore for Django 6 & Ninja / DRF: the paths Claude Code should stay out of, with matching permissions.deny rules.

Path
.claudeignore
Loads
Pattern list
Format
gitignore syntax
Used by
Claude Code (via permissions.deny)
All .claudeignore presets and how .claudeignore works

What this file tells the agent

Claude Code reads files while it works. This .claudeignore keeps the list of Django 6 & Ninja / DRF paths it should stay out of (build output, large binaries, logs and secrets). Copy the sensitive ones into permissions.deny in .claude/settings.json, which Claude Code enforces.

  • Use asynchronous ORM operations (aget(), acreate(), afirst()) inside async def view handlers.
  • Prevent N+1 query catastrophes: always apply select_related() for ForeignKey/OneToOne and prefetch_related() for ManyToMany/reverse relationships.
  • Enforce Django Ninja schemas or DRF serializers with explicit field typing; never return raw unvalidated model instances.
  • Never alter existing committed migration files; generate new sequential migrations via python manage.py makemigrations.
  • Use GeneratedField for computed database columns rather than redundant model save() recalculations.

Code to avoid, and what to write instead

The rule steers the agent away from the left and toward the right.

avoid
# Discouraged: Synchronous blocking query inside async context & N+1 queries
@router.get("/articles/{article_id}")
async def get_article(request, article_id: int):
    article = Article.objects.get(id=article_id)  # Synchronous blocking call!
    return {"id": article.id, "title": article.title, "author": article.author.username}  # N+1 DB hit!
write instead
from ninja import Router, Schema
from django.shortcuts import aget_object_or_404
from .models import Article

router = Router()

class ArticleOut(Schema):
    id: int
    title: str
    author_name: str

@router.get("/articles/{article_id}", response=ArticleOut)
async def get_article(request, article_id: int):
    # Asynchronous fetch with joined relationship preventing N+1
    article = await Article.objects.select_related("author").aget(id=article_id)
    return {
        "id": article.id,
        "title": article.title,
        "author_name": article.author.username,
    }

Install it in one command

  1. 01

    Go to your project root

    The file goes at .claudeignore, relative to the root.

  2. 02

    Download the file

    Run the command on the right. It downloads this preset and writes the file.

  3. 03

    Make sure it gets used

    Claude Code does not enforce .claudeignore by itself. Copy the sensitive paths into permissions.deny in .claude/settings.json, which it does enforce.

$ curl -fsSL "https://www.devscratchpad.tech/api/raw/claudeignore/python-django" -o ".claudeignore"

writes .claudeignore

path

.claudeignore

To write the file from your own code instead, use Read your code or Convert Legacy Rules in the editor above.

Questions

Does Claude Code honor .claudeignore?
Not by itself. Claude Code enforces permission rules, so copy the sensitive paths into permissions.deny in .claude/settings.json, for example Read(./.env). Keep .claudeignore in the repository root as the reviewable list.
What should I put in .claudeignore?
Exclude large build caches, minified bundles, lockfiles, and environment files containing sensitive credentials.