A step-by-step guide for developers who are new to Claude Code, modern Python tooling, or both.
Before using this template, you should be comfortable with:
- Opening a terminal (VS Code integrated terminal, Windows Terminal, macOS Terminal)
- Navigating directories (
cd,ls/dir) - Running commands and reading their output
- Understanding file paths
- What a repository is
git clone,git add,git commit,git push- What a branch is and how to create one (
git checkout -b) - What a pull request (PR) is -- you don't need to be an expert, but you should understand the concept
If git is new to you, work through Git - the simple guide first. It takes about 15 minutes.
- You need a GitHub account to use the template and its CI/CD workflows
- Install the GitHub CLI (
gh) -- the template's/donecommand uses it to create PRs and check CI status
- You can write and run a Python script
- You understand imports, functions, and classes at a basic level
- You don't need to know testing, type annotations, or packaging -- the template teaches these through practice
Check your version:
python --versionIf you need to install or upgrade: python.org/downloads
uv replaces pip, virtualenv, and poetry. It's fast and handles everything.
# macOS/Linux:
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"Verify: uv --version
npm install -g @anthropic-ai/claude-codeYou'll need an Anthropic API key or a Claude subscription. See Claude Code docs.
The template includes a devcontainer that sandboxes Claude Code for safety.
- Install VS Code
- Install Docker Desktop
- Install the Dev Containers extension
- Clone your project, open in VS Code, and click "Reopen in Container" when prompted
The devcontainer comes with Python, uv, ruff, git, and Claude Code pre-installed.
Go to stranma/claude-code-python-template and click "Use this template" > "Create a new repository". Clone it locally.
python setup_project.py --name my-first-project --namespace my_first_project --type singleThis renames all placeholder files to match your project name.
uv sync --all-packages --group devuv run pytest
uv run ruff check .
uv run pyrightAll three should pass with no errors.
claudeTry these to get a feel for the workflow:
> /sync
> "Add a function that calculates fibonacci numbers with tests"
> /done
Claude Code will write the code, write tests, and /done will validate, commit, and create a PR.
A file in your project root that tells Claude Code how to behave. It contains project rules, development commands, and workflow references. Think of it as a briefing document for your AI assistant. The template provides one pre-configured for the /sync -> /design -> /done workflow.
Agents are specialized Claude Code sub-processes that handle specific tasks (linting, testing, code review). They run automatically as part of the workflow. You don't invoke them directly -- /done orchestrates them.
Shell scripts that run before or after Claude Code actions. For example, the dangerous-actions-blocker hook prevents Claude from running rm -rf or leaking secrets. They run silently in the background.
Test-Driven Development: write the test first, then write the code to make it pass. The template enforces this order. It feels backwards at first, but it produces more reliable code because you're always building toward a defined expectation.
A Docker container configured for development. VS Code opens your project inside the container, so all tools are pre-installed and Claude Code runs in a sandbox. If something goes wrong, your host machine is unaffected.
- Read the Development Process to understand the full workflow
- Try the
/designcommand to plan a small feature before implementing it - Run
/security-auditto see how the security scanning works - Check Devcontainer Permissions if you want to adjust Claude Code's autonomy level