# 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.
## Commands
- **Test:** `mocha --require test/support/env --reporter spec --check-leaks test/ test/acceptance/`
- **Lint:** `eslint .`
## Critical Constraints
- **Core modules:** Hub files (most depended on): index.js (imported by 15 files); lib/utils.js (imported by 7 files). Changes here have the widest blast radius.
## Project Structure
- `test/` — Tests
- `lib/` — Library code
## Core Modules (by structural importance)
- `lib/utils.js`
- `lib/express.js`
- `lib/response.js`
- `lib/request.js`
- `lib/application.js`
## Conventions & Patterns
- **Testing:** Tests live in a separate test/ directory, mirroring src/ structure. New tests go there, not next to source files.
- **Dominant patterns:** Tests use Mocha. Test utilities in: test/fixtures/user.tmpl.
## 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