python-samples-fastapi-restful: Command for Claude Code

.claude/commands/pre-commit.md

pre-commit is a command for Claude Code from nanotaboada/python-samples-fastapi-restful. It costs 0 tokens per session (377 once invoked), scanned A, original, MIT.

A pre-commit checklist for a Python project that checks repository status, formatting, tests, coverage, Docker builds, and optional code review.

In plain words
What is it for?
Use it before committing changes to run the required checks, update the changelog, inspect review findings, and report skipped checks such as unavailable Docker or CodeRabbit.
Why use it?
It catches unformatted code, failing tests, insufficient test coverage, and other issues before a commit is proposed. It also checks whether the branch needs rebasing first.

Command for Claude Code

Written for Claude Code: installed under .claude/.

This is nanotaboada/python-samples-fastapi-restful's own configuration. It tells Claude Code how to work on python-samples-fastapi-restful itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything python-samples-fastapi-restful configures →

Reuse

Borrowing it

Nothing to install: this file belongs to nanotaboada/python-samples-fastapi-restful. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/nanotaboada/python-samples-fastapi-restful/master/.claude/commands/pre-commit.md
Clone the repo
git clone --depth 1 https://github.com/nanotaboada/python-samples-fastapi-restful

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pre-commit

README.md
[![agentmods](https://agentmods.dev/badge/commands/nanotaboada/python-samples-fastapi-restful/pre-commit/github.svg)](https://agentmods.dev/commands/nanotaboada/python-samples-fastapi-restful/pre-commit)
Your own site
<a href="https://agentmods.dev/commands/nanotaboada/python-samples-fastapi-restful/pre-commit"><img src="https://agentmods.dev/badge/commands/nanotaboada/python-samples-fastapi-restful/pre-commit/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pre-commit

Your own site · 80×15
<a href="https://agentmods.dev/commands/nanotaboada/python-samples-fastapi-restful/pre-commit"><img src="https://agentmods.dev/badge/commands/nanotaboada/python-samples-fastapi-restful/pre-commit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 377 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.00377
Opus 5.5 $0.00000 $0.00151
Sonnet 5.5 $0.00000 $0.00075
Haiku 4.5 $0.00000 $0.00038

Measured 2mo ago against content hash 66cc7aea62de, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pre-commit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/pre-commit.md · 21 lines

What it actually says

Pre-commit checklist

Before running the checklist, run git fetch origin. If the current branch is behind origin/master, stop and rebase before proceeding.

Run the pre-commit checklist for this project:

  1. Update CHANGELOG.md [Unreleased] section — add an entry under the appropriate subsection (Added / Changed / Fixed / Removed) describing the changes made, referencing the issue number.
  2. Run uv run flake8 . — must pass.
  3. Run uv run black --check . — must pass (run uv run black . to auto-fix).
  4. Run uv run pytest --cov=./ --cov-report=term --cov-fail-under=80 — all tests must pass, coverage must be ≥80%.
  5. If Docker is running, run docker compose build — must succeed with no errors. Skip this step with a note if Docker Desktop is not running.
  6. If coderabbit CLI is installed, run coderabbit review --type uncommitted --prompt-only:
    • If actionable/serious findings are reported, stop and address them before proposing the commit.
    • If only nitpick-level findings, report them and continue to the commit proposal.
    • If coderabbit is not installed, skip this step with a note.

Run steps 1–5, report the results clearly, then run step 6 (CodeRabbit review) if available, then propose a branch name and commit message for my approval using the format type(scope): description (#issue) (max 80 chars; types: feat fix chore docs test refactor ci perf). Do not create the branch or commit until I explicitly confirm.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2mo ago First seen · 21 lines · 0 tokens per session scan A 66cc7aea62de

Subscribe to this mod's changes

pre-commit is a command published in the GitHub repository nanotaboada/python-samples-fastapi-restful (141 stars, last pushed 4d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 377 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

pre-commit compared with commands from other repositories

pre-commit next to 6 commands from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
pre-commitnanotaboada/python-samples-fastapi-restfulCommand1414d agoMITA0Claude Code
reviewvstorm-co/full-stack-ai-agent-templateCommand2.0k7d agoMITA6Claude Code
deployNickRomanek/clawbridgeCommand2319d agoApache-2.0A0Claude Code
speckit.taskstoissuesSpillwaveSolutions/agent-brainCommand1191mo agoMITA21Claude Code
addsheep-programmer/AIForgeCommand34mo agononeA9Claude Code
checklistgithub/spec-kitCommand148kyesterdayMITA13Claude Code
clarifygithub/spec-kitCommand148kyesterdayMITA27Claude Code