By kawaz
Block direct `git push` / `jj git push` and steer Claude Code toward `just push` so repo-defined checks/tests/version gates run.
English | 日本語
Claude Code plugin: a PreToolUse(Bash) hook that blocks Claude from running
git push / jj git push directly, and steers it through the repo's task
runner (just push) so check / test / translation-pair / version-bump gates
actually fire.
This is a personal-workflow plugin for kawaz. It pins the push entrypoint to
just pushand assumes the kawaz/*personal-docs-structureconvention (justfile +bump-semver vcssubcommands). It is not a general-purpose plugin for everyone.
In kawaz/* repos the push recipe in justfile chains a list of gates
(push: ensure-clean ci check-translations check-version-bumped).
When Claude Code calls git push from the Bash tool it sidesteps every one
of those gates and ships a commit.
The previous mitigation was a per-repo pre-push-check.sh copied into
.claude/hooks/. That copy-paste mitigation drifted over time (slightly
different regex per repo, missing hooks in newer repos, etc.). This plugin
moves the guard to the user-global plugin layer so it can't be forgotten.
claude plugin marketplace add kawaz/claude-push-guard
claude plugin install push-guard@push-guard
This registers a PreToolUse(Bash) hook that runs hooks/push-guard.sh
before every Bash command.
claude plugin marketplace update push-guard
claude plugin update push-guard@push-guard
This refreshes the cache; run /reload-plugins (or restart) to apply it to a
running session. On the machine you just push from, the push recipe calls
on-success-release to run both commands automatically (no CI here, so it runs
right after push).
| Pattern | Result |
|---|---|
git push ... / jj git push ... at the start of a line or right after && / ; / || / | | blocked (exit 2) |
just push | pass |
gh pr create / gh release create and other non-push git/gh commands | pass |
git push appearing inside a commit-message string or heredoc | pass (no false positive) |
On block, the hook writes to stderr (1) the recommended command (just push)
and (2) where to learn the justfile layout if a repo doesn't have one yet
(the personal-docs-structure skill, or the canonical kawaz/bump-semver
justfile).
just pushkawaz/* standardizes on justfile + bump-semver vcs subcommands (the
canonical implementation lives in kawaz/bump-semver). just push fans out
to:
bump-semver vcs push — jj / git auto-dispatchlint / test / validate / ci depscheck-translations — *-ja.md ↔ *.md pair gatecheck-version-bumped — bump-forgotten detection on bump-trigger-pathsensure-clean — working-tree clean checkThe justfile layout is documented in the personal-docs-structure skill and
the canonical kawaz/bump-semver justfile.
A guideline that says "don't git push directly" gets buried in context.
Claude has been observed reasoning "I'll just push, the tests can run
separately." Blocking it in PreToolUse turns the rule from "be careful"
into "can't."
matcher: Bash)git push / jj git push only at the command position
(start of line or right after a shell separator). The regex is
intentionally simple ((^|&&|;|\|\|?)\s*...) and does not parse the
shell grammar — eval, bash -c "...", and assembled-from-variables
forms are not detected. This is a footgun guard, not a sandboxjust push. Other wrappers are simply
not blocked; the hook isn't an allowlistMIT. See LICENSE.
Executes bash commands
Hook triggers when Bash tool is used
Own this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimOwn this plugin?
Verify ownership to unlock analytics, metadata editing, and a verified badge. GitHub access is read-only (username + org membership).
Sign in to claimBased on adoption, maintenance, documentation, and repository signals. Not a security audit or endorsement.
npx claudepluginhub kawaz/claude-push-guard --plugin push-guardjj (Jujutsu VCS) support: git misuse prevention, daily operation guide, and expert agent
Analyze Claude Code session files (.jsonl) to view timeline, file operations, and version diffs
TODO: plugin description
Suggests using UV instead of pip/pipx/venv commands in Bash tool calls
自律的なタスク生成・消化ループを回す Claude Code プラグイン
Complete collection of battle-tested Claude Code configs from an Anthropic hackathon winner - agents, skills, hooks, and rules evolved over 10+ months of intensive daily use
20 SEO/GEO skills and 5 commands on one shared contract for keyword research, content creation, technical audits, schema markup, monitoring, quality gates, entity truth, and campaign memory.
Comprehensive SEO analysis plugin for Claude Code. 25 sub-skills (21 core + 1 orchestrator + 1 framework + 2 extension mirrors) and 18 sub-agents cover technical SEO, content quality, schema, sitemaps, Core Web Vitals, local SEO, backlinks, AI/GEO, ecommerce, hreflang, SXO, clustering, drift monitoring, and Google APIs. Includes optional MCP extensions, SPA-aware rendering, portability, and hardened SSRF/DNS-rebinding safe fetchers.
Modern R development skills for Claude Code - tidyverse patterns, rlang metaprogramming, Bayesian inference, performance optimization, and more