cherry-pick-by-patch

cherry-pick-by-patch is a command for Claude Code from wangke19/gemini-ai-helpers. It costs 13 tokens per session (353 once invoked), scanned A, a copy of cherry-pick-by-patch, Apache-2.0.

A Git workflow that applies a commit to the current branch by turning its changes into a patch, then creates a commit with the original message.

In plain words
What is it for?
Use it to copy one existing commit into another branch when you know its commit hash.
Why use it?
It provides an alternative when the usual cherry-pick command is unsuitable or unavailable.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: positional $N argument.

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/wangke19/gemini-ai-helpers/cherry-pick-by-patch
Clone the repo
git clone --depth 1 https://github.com/wangke19/gemini-ai-helpers

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 cherry-pick-by-patch

README.md
[![agentmods](https://agentmods.dev/badge/commands/wangke19/gemini-ai-helpers/cherry-pick-by-patch.svg)](https://agentmods.dev/commands/wangke19/gemini-ai-helpers/cherry-pick-by-patch)
Your own site
<a href="https://agentmods.dev/commands/wangke19/gemini-ai-helpers/cherry-pick-by-patch"><img src="https://agentmods.dev/badge/commands/wangke19/gemini-ai-helpers/cherry-pick-by-patch.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 353 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 100% copy Near-identical to another mod 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.00013 $0.00353
Opus 5 $0.00006 $0.00177
Sonnet 5 $0.00003 $0.00071
Haiku 4.5 $0.00001 $0.00035

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

Security

Grade A, and why

cherry-pick-by-patch 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.

Origin

This is a copy

100% identical to cherry-pick-by-patch — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

extensions/git/commands/cherry-pick-by-patch.md · 51 lines

What it actually says

Name

git:cherry-pick-by-patch

Synopsis

/git:cherry-pick-by-patch commit_hash

Description

The /git-cherry-pick-by-patch commit_hash command cherry-picks commit with hash commit_hash into current branch. Rather then doing git cherry-pick commit_hash, the command streams the output of git show commit_hash to patch -p1 --no-backup-if-mismatch, and then commit changes with commit message from commit_hash commit.

Implementation

Pre-requisites

The commit with hash commit_hash must exist. To verify that use:

git show commit_hash

and check if exit code is zero.

Fail, if there is no commit_hash in the current repository checkout.

Cherry-pick commit_hash into current branch

  1. Execute command
    git show commit_hash | patch -p1 --no-backup-if-mismatch
    

and check if exit code is zero. Fail if exit code is not zero.

  1. Find files removed from local checkout by the patch command and execute git rm for them.

  2. Find files added or modified by the patch command and execute git add for them.

  3. Commit changes by git commit command and use commit title and description from commit_hash commit.

Arguments

  • $1 (required): Commit hash (e.g., 902409c0) of commit to cherry-pick.
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 · 51 lines · 13 tokens per session scan A b9f8cc4a254f

Subscribe to this mod's changes

cherry-pick-by-patch is a command published in the GitHub repository wangke19/gemini-ai-helpers (2 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 13 tokens to every session and 353 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to cherry-pick-by-patch, differing in 0 lines, and is treated as a copy.