Template for senior Python projects with Claude Code configured deterministically. Implements the three-layer system: advisory (CLAUDE.md + rules), deterministic (hooks), and on-demand (skills + commands + agents).
Quick way (1 command):
gh repo create my-new-project --template DrLux/claude-code-template --private --clone
cd my-new-projectFrom GitHub: click "Use this template" on github.com/DrLux/claude-code-template, then clone the created repo.
Both methods create a repo with a clean history, without template commits.
After creation:
# 1. Customize CLAUDE.md with your project's stack and invariants
# (replace all placeholders [PROJECT NAME], [e.g. FastAPI], etc.)
# 2. Initialize the project context
touch .claudememory # will be populated by /memory-update
touch CLAUDE.local.md # personal notes and PR feedback — never commit
# 3. First session: generate the architectural map
/architectOnce per machine (global developer identity):
cp templates/global-memory.md ~/.claude/memory.md
# Edit ~/.claude/memory.md to match your profile# 1. Clone the template into the new project directory
git clone https://github.com/DrLux/claude-code-template.git my-project
cd my-project
# 2. Remove the template history and initialize your repo
rm -rf .git
git init
# 3. Customize CLAUDE.md with your project's stack and invariants
# (replace all placeholders [PROJECT NAME], [e.g. FastAPI], etc.)
# 4. Copy the global developer identity (once per machine)
cp templates/global-memory.md ~/.claude/memory.md
# Edit ~/.claude/memory.md to match your profile
# 5. Initialize the project context
touch .claudememory # will be populated by /memory-update
touch CLAUDE.local.md # personal notes and PR feedback — never commit
# 6. First session: generate the architectural map
/architect.
├── .claude/
│ ├── settings.json — hook configuration
│ ├── hooks/ — deterministic scripts (linting, tests, security)
│ ├── skills/ — commands with side effects (commit)
│ ├── commands/ — on-demand commands (architect, pythonic, docstrings)
│ ├── rules/ — thematic rules loaded automatically
│ └── agents/ — specialized subprocesses (reviewer, test-writer)
├── templates/
│ └── global-memory.md — template for ~/.claude/memory.md (global, do not commit)
├── CLAUDE.md — project manifest (committed, shared with team)
├── CLAUDE.local.md — personal notes (gitignored)
├── ARCHITECT.md — architectural map (generated by /architect)
└── .claudememory — dynamic project state (gitignored)
| Layer | Files | Behavior |
|---|---|---|
| Advisory | CLAUDE.md, .claude/rules/ |
Claude reads and interprets |
| Deterministic | .claude/hooks/ |
Executed automatically, non-bypassable |
| On-demand | .claude/skills/, .claude/commands/ |
Activated only on explicit invocation |
| Skill/Command | Function |
|---|---|
/commit |
Assisted commit with human confirmation (never pushes) |
/architect |
Rescans the repo and regenerates ARCHITECT.md (auto-triggers on ExitPlanMode) |
/pythonic |
Idiomatic Python 3.10+ refactoring |
/docstrings |
Adds Google-style docstrings to public APIs |
/memory-update |
Updates .claudememory with the session state |
| Hook | Trigger | Action |
|---|---|---|
SessionStart |
Session start | Loads .claudememory + git log |
PreToolUse |
Every Bash command | Blocks destructive patterns |
PostToolUse |
.py file write |
ruff --fix + mypy |
PostToolBatch |
End of write batch | cross-file mypy |
ExitPlanMode |
Plan approval | Auto-runs /architect to update architecture map |
Stop |
Session end | pytest + ARCHITECT.md update |
Copy templates/global-memory.md to ~/.claude/memory.md and customize:
- Seniority Contract: adapt to your level and domain
- Technical Philosophy: reflects your preferences
- Toolchain Standard: modify if you use different stacks
Last updated: 01/06/2026