hermit-agent: Command for Claude Code

.claude/commands/code-push-hermit.md

code-push-hermit is a command for Claude Code from cafitac/hermit-agent. It costs 0 tokens per session (1,309 once invoked), scanned A, original, MIT.

A command that prepares code changes, creates a Git commit, pushes it, and can update a pull request’s description, while delegating the Git work to Hermit.

In plain words
What is it for?
Use it to commit and push changes from a working branch, and optionally update a pull request when the GitHub command-line tool is authenticated.
Why use it?
It removes repetitive commit-and-push steps and checks for unsafe branches or likely credential files before proceeding.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: reads .claude/ paths; mentions subagents.

This is cafitac/hermit-agent's own configuration. It tells Claude Code how to work on hermit-agent 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 hermit-agent configures →

Reuse

Borrowing it

Nothing to install: this file belongs to cafitac/hermit-agent. 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/cafitac/hermit-agent/main/.claude/commands/code-push-hermit.md
Clone the repo
git clone --depth 1 https://github.com/cafitac/hermit-agent

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 code-push-hermit

README.md
[![agentmods](https://agentmods.dev/badge/commands/cafitac/hermit-agent/code-push-hermit/github.svg)](https://agentmods.dev/commands/cafitac/hermit-agent/code-push-hermit)
Your own site
<a href="https://agentmods.dev/commands/cafitac/hermit-agent/code-push-hermit"><img src="https://agentmods.dev/badge/commands/cafitac/hermit-agent/code-push-hermit/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 code-push-hermit

Your own site · 80×15
<a href="https://agentmods.dev/commands/cafitac/hermit-agent/code-push-hermit"><img src="https://agentmods.dev/badge/commands/cafitac/hermit-agent/code-push-hermit.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 1,309 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.01309
Opus 5.5 $0.00000 $0.00524
Sonnet 5.5 $0.00000 $0.00262
Haiku 4.5 $0.00000 $0.00131

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

Security

Grade A, and why

code-push-hermit 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/code-push-hermit.md · 155 lines

How it starts

The opening of the file, as written. The whole thing — 155 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/code-push-hermit — Claude writes the PR prose, Hermit does the git work

Commit-and-push are the textbook grunt-work target: short, mechanical, deterministic, and unrelated to reasoning. This skill keeps the deciding parts in Claude and delegates the git commands to Hermit.

Arguments

$ARGUMENTS — PR number (required for the PR description update step; the commit+push works without it).

  • --model <model_name> — executor model override.

Prerequisites

  • Clean or stageable working tree with actual changes.
  • Hermit gateway + MCP server running.
  • gh CLI authenticated if you want the PR-description step.

Workflow

Step 1 — pre-flight (Claude)

  • git status --porcelain in the worktree — confirm changes exist.
  • Refuse if the branch is main or develop.
  • Scan staged and unstaged files for sensitive names (.env, *.pem, *.key, credentials*). If any are present, report and stop — ask the user whether to add them to .gitignore.
  • Read the last few commits to learn the project's message style (length, prefix conventions, language).

Step 2 — lock

mkdir -p .hermit
cat > .hermit/active-task.lock <<EOF
{
  "task_id": "<filled-after-run_task>",
  "started_at": "$(date -Iseconds)",
  "skill": "code-push-hermit",
  "pr": "$ARGUMENTS",
  "cwd": "<worktree_path>"
}
EOF

Step 3 — delegate commit + push to Hermit

mcp__hermit__run_task(cwd=<worktree>, background=true, model=<--model or "">)

You are Hermit. Commit and push the pending changes in this worktree
for PR #<PR-number>.

Context:
- Branch: <branch>
- PR title: <title>
- Changed files (already reviewed by Claude and confirmed in scope):
  <file list>

Rules:
1. Safety:
   - Refuse if the branch is main or develop.
   - Never stage .env, *.pem, *.key, credentials*.
   - Use `git -C <worktree> ...` (no `cd && git ...`).
2. Match the project's commit-message style — read
   `git log --oneline -5`. Prefix convention, length, language.
3. Split the changes into logical commits if they span multiple
   concerns (e.g. refactor + feat).
4. Per commit:
   - `git add` only the relevant files (never `-A` / `.`).
   - One conventional-prefix message (fix/feat/refactor/chore/test).
   - Do NOT add Co-Authored-By or AI attribution lines.
5. Push: `git push`, or `git push -u origin <branch>` if the branch
   has no upstream yet.

Return: commit list (short hash + message), push result, anything
skipped with a reason.

Do NOT:
- Edit the PR description — Claude does that.
- Create commits for files outside the current PR diff.
- Update external ticket systems.

Obey HERMIT.md, .hermit/rules/, and .claude/rules/.

Read the full file on GitHub · 155 lines

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 · 155 lines · 0 tokens per session scan A 4104be120758

Subscribe to this mod's changes

code-push-hermit is a command published in the GitHub repository cafitac/hermit-agent (4 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,309 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-31.