code-commit

A guided workflow for preparing changes in a Git repository, a project folder tracked with version control. It formats files, stages selected changes, suggests a commit message, and can commit and push after approval.

In plain words
What is it for?
Reviewing changed files, running formatters and checks, staging changes safely, creating commits, and pushing them to the repository's remote.
Why use it?
It reduces the risk of committing unintended files or sending changes to the remote repository without review. The final commit and upload require the user's approval.

Command

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/d-padmanabhan/agent-engineering-handbook/code-commit
Clone the repo
git clone --depth 1 https://github.com/d-padmanabhan/agent-engineering-handbook
Per session 22 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,266 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.00022 $0.01266
Opus 5 $0.00011 $0.00633
Sonnet 5 $0.00004 $0.00253
Haiku 4.5 $0.00002 $0.00127

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

Security

Grade A, and why

code-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 yesterday.

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.

commands/code-commit.md · 199 lines

How it starts

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

CODE COMMIT MODE ACTIVATED

You are running the /code-commit workflow to prepare a clean commit and push it to origin.

[!IMPORTANT] This workflow includes remote writes (git push) and is HITL gated. Do not commit or push until the user explicitly approves.


Step 0: Repo safety and context

If you are not sure which repo you are in, STOP and ask the user to confirm.

Collect context:

  • Repo root: git rev-parse --show-toplevel
  • Current branch: git branch --show-current
  • Current HEAD: git rev-parse HEAD
  • Remote: git remote -v

Step 1: Review all changes

Review working tree and index:

  • git status
  • git diff
  • git diff --cached

List changed files explicitly (for safe staging later):

  • git status --porcelain=v1
  • Derive the exact file list from porcelain output (do not guess)

Step 2: Format and clean up (language-aware)

Detect the project language/framework based on modified files and run the appropriate formatter/linter. If a tool is not installed or a project file is missing, report the reason and continue with the closest substitute.

Bash

  • shfmt -w -i 2 -ci -sr -bn <changed_shell_files>
  • shellcheck <changed_shell_files>

GitHub Actions

If workflows exist, run:

  • actionlint .github/workflows/*.yaml .github/workflows/*.yml

Terraform

  • terraform fmt -recursive
  • terraform validate
  • tflint

Python

Run (as applicable in this repo):

  • isort <changed_python_files>
  • ty <changed_python_files> (or mypy <changed_python_files>)
  • pylint <changed_python_files> (aim for ≥ 9.5)
  • ruff format <changed_python_files>
  • ruff check <changed_python_files> --fix
  • black <changed_python_files> (if used in repo)
  • tox (if applicable / configured)

[!NOTE] If you change behavior while fixing docstrings, call it out in the summary.

Go

  • gofmt -w -s <changed_go_files>
  • go vet ./...
  • staticcheck ./...
  • golangci-lint run ./...
  • govulncheck ./...

Read the full file on GitHub · 199 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. yesterday First seen · 199 lines · 22 tokens per session scan A a99faa4de032

Subscribe to this mod's changes

code-commit is a command published in the GitHub repository d-padmanabhan/agent-engineering-handbook (15 stars, last pushed 2d ago), licensed MIT. It adds 22 tokens to every session and 1,266 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.