grant-push

A command that records short-lived human consent for running git push on protected branches. Git push sends local commits to a remote repository.

In plain words
What is it for?
For granting temporary push permission after reviewing the planned changes, with the approval recorded in the project's state files.
Why use it?
It prevents the agent from pushing to protected branches unless a person has recently approved it.

Command for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/friedbotstudio/baseline/grant-push
Clone the repo
git clone --depth 1 https://github.com/friedbotstudio/baseline

Made for: Claude Code.

Per session 27 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 667 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00027 $0.00667
Opus 5 $0.00014 $0.00333
Sonnet 5 $0.00005 $0.00133
Haiku 4.5 $0.00003 $0.00067

Measured 2d ago against content hash ede000e21619, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

grant-push 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 2d 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/grant-push.md · 22 lines

What it actually says

Write a consent token to .claude/state/push_consent so the Git Commit Guard hook allows the next git push on a protected branch. The token is the current UNIX epoch timestamp on line 1; any optional note goes on line 2.

How this works structurally: when the user typed /grant-push, the consent_gate_grant UserPromptSubmit hook ran before this body was passed to Claude and wrote a short-lived consent marker at .claude/state/.push_consent_grant. The git_commit_guard PreToolUse hook (Write matcher) reads that marker and allows Claude to write the consent file because the marker is fresh. Claude cannot forge the marker — that's what makes the gate structural. The Bash-matcher leg of the same guard then enforces the consent token on the actual git push invocation, but only when the current branch matches project.json → git.protected_branches.

State-write discipline (binding — see .claude/CONSTITUTION.md §2 "State-write discipline"). The consent token at .claude/state/push_consent is a Tier 1 consent artifact: it SHALL be written with the Write tool only. You SHALL NOT write it via Bash (no >/>> redirect, heredoc, tee, cp, or sed -i) — destructive_cmd_guard blocks Bash writes to consent paths, and the git_commit_guard Write matcher validates the marker only on the Write tool. Use Bash solely for the precheck (git rev-parse) and the epoch (date +%s).

Steps:

  1. Git-repo precheck. Run git rev-parse --is-inside-work-tree 2>/dev/null. If the exit status is non-zero, this project is not a git repository: refuse to write the consent token and tell the user "Not a git repository — /grant-push is inapplicable. Push has no meaning outside a git repo." Stop here.
  2. Run date +%s to get the current epoch.
  3. Write the consent token with the Write tool, overwriting any prior token: the epoch on line 1 (and the optional note $ARGUMENTS on line 2 if non-empty) to .claude/state/push_consent. Do not use a Bash redirect or tee — that path is guard-blocked.
  4. Confirm to the user: "Push consent granted at , valid for 300s (until <HH:MM:SS local>). The next git push on a protected branch will be allowed. Pushes on branches NOT in project.json → git.protected_branches do not require this consent."

Do not run git push yourself in this command. The user asks explicitly when they want a push; this command only opens the window.

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. 2d ago First seen · 22 lines · 27 tokens per session scan A ede000e21619

Subscribe to this mod's changes

grant-push is a command published in the GitHub repository friedbotstudio/baseline (11 stars, last pushed 6d ago), licensed Apache-2.0. It adds 27 tokens to every session and 667 once invoked, about $0.0001 per session on Opus 5. 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.