← CLAUDE.md
Claude Code CLAUDE.md template Free

Python Project Free Claude Code CLAUDE.md template, copy & paste

A CLAUDE.md for a Python service: uv or pip commands, pytest, typing and linting rules, and what not to touch.

WHEN TO USE IT

When Claude keeps reaching for the wrong tool — pip instead of uv, unittest instead of pytest — in a Python codebase.

Lives in ./CLAUDE.md for the project, ~/.claude/CLAUDE.md for you, CLAUDE.local.md for private notes.
Checked

Formats change. If a field stops working, check it against Anthropic's documentation.

CLAUDE.md

The single most useful line is the test command. Claude will run whatever it guesses otherwise.

# [Project name]

[One sentence: what this service does.]

## Commands
- Install: `uv sync`
- Run: `uv run python -m [package]`
- Test: `uv run pytest -q` — run the relevant tests after every change
- Lint and format: `uv run ruff check --fix . && uv run ruff format .`
- Types: `uv run mypy src`

## Layout
- `src/[package]/` — application code
- `tests/` — pytest; fixtures in `tests/conftest.py`

## Conventions
- Python 3.12, type hints on every public function
- pytest style: plain `assert`, fixtures over setup methods
- Use `pathlib`, not `os.path`
- Log with the module logger (`logging.getLogger(__name__)`), never print

## Do not
- Use pip directly — dependencies go through `uv add`
- Commit `.env` or anything in `data/`
- Change a public function's signature without updating its callers
Pull in other docs with @

@path imports another file into the memory. Paths are relative to the importing file; inside backticks or code blocks they are NOT imported.

## More
- Architecture: @docs/architecture.md
- Release process: @docs/releasing.md

MORE CLAUDE.MD

The authority

Anthropic's documentation for CLAUDE.md

This template is a starting point. Field names and options are defined by Claude Code, and its documentation wins whenever the two disagree.

Read the docs ↗

https://code.claude.com/docs/en/memory

New drops, every week

Free tools & Claude templates, landing regularly.

We keep shipping new free tools, code recipes and Claude Code templates. Follow @freeyantra on Instagram or join the newsletter so you never miss one.

Follow @freeyantra

or get them by email

Double opt-in. Unsubscribe any time. Privacy