generating-patches

generating-patches is a skill for Claude Code, Codex from oaustegard/claude-skills. It costs 43 tokens per session (817 once invoked), scanned A, original, MIT.

A procedure for exporting code changes as a Git patch, which is a file containing edits that can be applied to another copy of a project. It is intended for modified or uploaded codebases.

In plain words
What is it for?
It checks Git status, creates a baseline commit when needed, and produces a patch containing staged, unstaged, or committed changes.
Why use it?
It lets someone transfer changes back to a local repository without manually copying each edited file.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It checks Git status, creates a baseline commit when needed, and produces a patch containing staged, unstaged, or committed changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/oaustegard/claude-skills/generating-patches
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.

Any agent
npx skills add oaustegard/claude-skills --skill generating-patches
Clone the repo
git clone --depth 1 https://github.com/oaustegard/claude-skills

Made for: Claude Code, Codex.

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 generating-patches

README.md
[![agentmods](https://agentmods.dev/badge/skills/oaustegard/claude-skills/generating-patches/github.svg)](https://agentmods.dev/skills/oaustegard/claude-skills/generating-patches)
Your own site
<a href="https://agentmods.dev/skills/oaustegard/claude-skills/generating-patches"><img src="https://agentmods.dev/badge/skills/oaustegard/claude-skills/generating-patches/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 generating-patches

Your own site · 80×15
<a href="https://agentmods.dev/skills/oaustegard/claude-skills/generating-patches"><img src="https://agentmods.dev/badge/skills/oaustegard/claude-skills/generating-patches.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 43 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 817 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00043 $0.00817
Opus 5 $0.00022 $0.00409
Sonnet 5 $0.00009 $0.00163
Haiku 4.5 $0.00004 $0.00082

Measured 12d ago against content hash eacbb2757339, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade A, and why

generating-patches 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 12d 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.

generating-patches/SKILL.md · 130 lines

How it starts

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

Generating Patches

Generate portable git patch files from codebase modifications, enabling users to apply Claude's edits to their local repositories.

When to Use

Activate after modifying files in an uploaded codebase when the user needs to transfer changes back to their local environment. Typical workflow: user uploads zip → Claude edits files → this skill exports changes as a patch.

Prerequisites

Verify git is available and the working directory is a git repository (or can be initialized as one):

git status 2>/dev/null || git init

If working with an uploaded codebase that lacks git history, initialize and create a baseline commit before making edits:

git init
git add -A
git commit -m "Baseline: original uploaded state"

Generating the Patch

After completing edits, generate a unified diff:

# For uncommitted changes (working tree modifications)
git diff > /mnt/user-data/outputs/changes.patch

# If changes are staged but not committed
git diff --cached > /mnt/user-data/outputs/changes.patch

# For both staged and unstaged
git diff HEAD > /mnt/user-data/outputs/changes.patch

For committed changes (preserves commit messages and metadata):

# All commits since baseline
git format-patch --stdout baseline..HEAD > /mnt/user-data/outputs/changes.patch

# Or specify number of commits
git format-patch --stdout -n 3 > /mnt/user-data/outputs/changes.patch

Handling Edge Cases

Binary files: Git diff excludes binaries by default. Warn the user if binary files were modified:

git diff --name-only --diff-filter=M | xargs file | grep -v "ASCII\|UTF-8\|empty"

Large patches: For extensive changes, consider splitting by directory or file type:

git diff -- "*.py" > /mnt/user-data/outputs/python-changes.patch
git diff -- src/ > /mnt/user-data/outputs/src-changes.patch

No changes detected: Verify files were actually modified. Common issues:

  • Edits made to copies outside the git tree
  • Files not tracked by git (need git add first)

Read the full file on GitHub · 130 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 130 lines · 43 tokens per session scan A eacbb2757339

Subscribe to this mod's changes

generating-patches is a skill published in the GitHub repository oaustegard/claude-skills (148 stars, last pushed 2d ago), licensed MIT. It adds 43 tokens to every session and 817 once invoked, about $0.0002 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.

Related

Other skills, from other repositories

address-pr-review

Look at the pull request review comments and address any issues raised.

mnapoli/skill-address-pr-review · 17 tokens

git-workflow

A guide for handling Git repository work safely, including status checks, branches, commits, pushes, pull requests, and rebasing. Git is a version-control system that records code changes and coordinates work between developers.

laolaoshiren/claude-code-skills-zh · 73 tokens

history-portability

Import Claude Code or Codex history and move complete CCAM datasets between machines. Use when rescanning provider history, importing a copied directory, uploading JSONL or archives, exporting a backup, restoring it idempotently, or verifying that tokens, workflows, runs, rules, and pricing survived.

hoangsonww/Claude-Code-Agent-Monitor · 63 tokens

reply-to-pr-threads

Draft, confirm, and post replies to GitHub PR review threads. Handles per-category reply formatting, re-fetches thread resolution state so auto-resolved threads are skipped, and posts via GraphQL. Use when the user asks to "reply to PR threads", "post PR thread replies", or "draft PR reply messages".

tobihagemann/turbo · 71 tokens

suede-play-release

Suede Labs Google Play delivery skill: ship an Android release end to end from the agent interface, without opening the Play Console. Set up credentials, upload an AAB, promote between tracks, stage or complete a rollout, push per-locale release notes, and prove against the Play Developer API what is actually live.…

JasonColapietro/suede-creator-skills · 200 tokens

create-changelog

Create a CHANGELOG.md following keepachangelog.com conventions with version history backfilled from GitHub releases or git tags. Use when the user asks to "create a changelog", "add a changelog", "initialize changelog", "start a changelog", "set up changelog", "generate changelog", or "backfill changelog".

tobihagemann/turbo · 75 tokens