# CLAUDE.md
This file provides guidance to Claude Code when working with this codebase.
Generated by [sourcebook](https://github.com/maroondlabs/sourcebook). Review and edit — the best context comes from human + machine together.
## Quick Reference
- **testing:** Tests use pytest. Test utilities in: tests/test_utils/fixtures/person.json.
## Commands
- **Test:** `grunt test --verbose`
## Critical Constraints
- **Core modules:** Hub files (most depended on): tests/staticfiles_tests/project/documents/cached/module_test.js (imported by 8 files). Changes here have the widest blast radius.
- **Circular dependencies:** Circular import chains detected: xregexp.js. Avoid adding to these cycles.
## Stack
Django
## Project Structure
- `tests/` — Tests
- `scripts/` — Build / utility scripts
- `docs/` — Documentation
## Core Modules (by structural importance)
- `django/contrib/admin/static/admin/js/vendor/xregexp/xregexp.js`
- `tests/staticfiles_tests/project/documents/cached/module_test.js`
- `tests/staticfiles_tests/project/documents/nested/js/nested.js`
- `globals.js`
- `eslint-recommended.js`
## Conventions & Patterns
- **Django:**
- Django project (settings: tests/staticfiles_tests/settings.py). Use `python manage.py` for management commands.
- After modifying models, run `python manage.py makemigrations && python manage.py migrate`.
- **Dominant patterns:**
- Tests use pytest. Test utilities in: tests/test_utils/fixtures/person.json.
- Database access uses Django ORM. Schema/models defined in tests/xor_lookups/models.py.
## Before Making Changes
- **Check file importance** before editing. Hub files (listed in Core Modules) affect many other files — changes here have the widest blast radius.
- **Follow existing patterns.** This project has established conventions (listed above). Match them instead of introducing new approaches.
- **Respect constraints.** Review the Critical Constraints section before making structural changes.
If the sourcebook MCP server is available (`sourcebook serve`), verify before acting:
- `get_blast_radius` — check what breaks if you edit a hub file
- `query_conventions` — confirm the right pattern before adding new code
- `get_pressing_questions` — get a briefing before editing an unfamiliar file
## What to Add Manually
The most valuable context is what only you know. Add:
- Architectural decisions and why they were made
- Past incidents that shaped current conventions
- Deprecated patterns to avoid in new code
- Domain-specific rules or terminology
- Environment setup beyond what .env.example shows