| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Python hooks for Claude Code for projects using:
The hooks ensure that the quality tools are automatically used:
Each time a file is edited:
When Claude is ready to stop:
Note: We defer all quality checks until Claude stops to avoid changing files while Claude is working. Changing files during editing would spoil Claude's edits and force it to reread files. Quality checks only run when at least one Python file has been edited during the session.
uv add python-claudeThis package provides hooks that can be used with Claude Code's hook system.
Add hooks to your Claude Code settings.json:
{
"hooks": {
"SessionStart": [
{
"hooks": [
{
"type": "command",
"command": "uv run python-claude session start"
},
{
"type": "command",
"command": "uv run python-claude git status"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "uv run python-claude ruff format"
},
{
"type": "command",
"command": "uv run python-claude ruff check"
},
{
"type": "command",
"command": "uv run python-claude mypy"
},
{
"type": "command",
"command": "uv run python-claude pytest"
}
]
}
],
"PostToolUse": [
{
"matcher": "Write|Edit",
"hooks": [
{
"type": "command",
"command": "uv run python-claude edited"
}
]
}
]
}
}You can temporarily disable quality checks when needed. This is useful when:
The easiest way is to use the provided slash commands in Claude Code:
Each command will show whether the check is now enabled or disabled.
You can also use the CLI directly:
uv run python-claude toggle pytest
uv run python-claude toggle mypy
uv run python-claude toggle ruffThe toggle state persists across Claude Code sessions, stored in .claude/quality-checks.json (which is gitignored). All checks are enabled by default.
uv sync
uv run pytest
uv run ruff check
uv run mypy src| Back | FazBrowse Home | New Git URL |