Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/BeautyyuYanli/codex-apply-patchnpx agentmods add skills/beautyyuyanli/codex-apply-patch/codex-apply-patchWrote 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.
[](https://agentmods.dev/skills/beautyyuyanli/codex-apply-patch/codex-apply-patch)<a href="https://agentmods.dev/skills/beautyyuyanli/codex-apply-patch/codex-apply-patch"><img src="https://agentmods.dev/badge/skills/beautyyuyanli/codex-apply-patch/codex-apply-patch/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.
<a href="https://agentmods.dev/skills/beautyyuyanli/codex-apply-patch/codex-apply-patch"><img src="https://agentmods.dev/badge/skills/beautyyuyanli/codex-apply-patch/codex-apply-patch.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00026 | $0.02452 |
| Opus 5.5 | $0.00010 | $0.00981 |
| Sonnet 5.5 | $0.00005 | $0.00490 |
| Haiku 4.5 | $0.00003 | $0.00245 |
Grade A, and why
apply-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 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.
How it starts
The opening of the file, as written. The whole thing — 361 lines — stays where its author put it; the contents beside it link to each section on GitHub.
apply_patch Tool Instructions
Use apply_patch to create, update, move, rename, or delete text files through a structured, reviewable patch.
Tool contract
- Input type:
FREEFORM. - Pass exactly one raw patch string.
- Do not wrap the patch in JSON.
- Do not wrap the patch in Markdown fences.
- Do not include commentary before or after the patch.
- Do not invoke
apply_patchin parallel with another tool. - Use LF (
\n) line endings in the patch input.
A patch must begin with *** Begin Patch and end with *** End Patch.
Formal grammar
The following grammar uses Lark syntax and assumes a contextual lexer. Whitespace is significant and must not be globally ignored.
start: begin_patch operation+ end_patch
begin_patch: "*** Begin Patch" LF
end_patch: "*** End Patch" LF?
?operation: add_file
| delete_file
| update_file
// Create a non-empty text file.
// Every content line, including an empty content line, begins with "+".
add_file: "*** Add File: " path LF add_line+
add_line: "+" line_text LF
// Delete an existing file.
// A delete operation has no body.
delete_file: "*** Delete File: " path LF
// Update an existing file, move it, or do both.
// An update must contain a move clause, a change block, or both.
update_file: "*** Update File: " path LF update_body
?update_body: move_clause change_block?
| change_block
// Move or rename the updated file.
move_clause: "*** Move to: " path LF
// Apply one or more contextual or changed lines.
// The optional EOF marker must be the final item in the block.
change_block: change_item+ eof_marker?
?change_item: section_header
| change_line
// A section header is a locator and is not written to the file.
section_header: "@@" LF
| "@@ " nonempty_text LF
// " " means context, "-" means deletion, and "+" means insertion.
change_line: CHANGE_PREFIX line_text LF
// Assert that the preceding change is anchored at the end of the file.
eof_marker: "*** End of File" LF
path: nonempty_text
line_text: NONEMPTY_TEXT?
nonempty_text: NONEMPTY_TEXT
CHANGE_PREFIX: "+" | "-" | " "
NONEMPTY_TEXT: /[^\r\n]+/
LF: "\n"
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.
- 2mo ago First seen · 361 lines · 26 tokens per session scan A c67dae643839
apply-patch is a skill published in the GitHub repository BeautyyuYanli/codex-apply-patch (57 stars, last pushed yesterday), licensed Apache-2.0. It adds 26 tokens to every session and 2,452 once invoked, about $0.0001 per session on Opus 5.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.
apply-patch compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| apply-patchBeautyyuYanli/codex-apply-patch | Skill | 57 | yesterday | Apache-2.0 | A | 26 | Claude Code, Codex |
| imagegenopenai/codex | Skill | 134k | today | Apache-2.0 | A | 113 | Codex |
| local-ai-agentsmicrosoft/ai-agents-for-beginners | Skill | 79k | 2d ago | MIT | A | 200 | Claude Code, Codex |
| playwright-climicrosoft/playwright | Skill | 100k | today | Apache-2.0 | A | 19 | Claude Code |
| browser-automationopenclaw/openclaw | Skill | 394k | today | MIT | A | 36 | Claude Code |
| systematic-debuggingobra/superpowers | Skill | 315k | 6d ago | MIT | A | 21 | Claude Code |
| next-cache-components-adoptionvercel/next.js | Skill | 143k | yesterday | MIT | A | 95 | Claude Code |