capture-isolated-patch

capture-isolated-patch is a skill for Claude Code, Codex from OutlineDriven/odin-claude-plugin. It costs 53 tokens per session (1,105 once invoked), scanned A, a copy of capture-isolated-patch, Apache-2.0.

A workflow that runs a declared command in a temporary Git worktree, a separate checkout of the same repository, and returns the resulting patch and exit code. The original working tree is left unchanged.

In plain words
What is it for?
Use it to run a code-generation or modification command in isolation and capture its changes without committing, merging, or pushing them.
Why use it?
You may need to test or generate a candidate change without disturbing current edits. This isolates the work and provides the result as a patch for inspection.

Skill for Claude CodeCodex

Written for Claude Code and Codex: shipped in a Claude Code plugin, but also agents/openai.yaml present.

Part of the odin-code-advanced plugin — 50 skills shipped together

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 skills/outlinedriven/odin-claude-plugin/capture-isolated-patch
Any agent
npx skills add OutlineDriven/odin-claude-plugin --skill capture-isolated-patch
Clone the repo
git clone --depth 1 https://github.com/OutlineDriven/odin-claude-plugin

Made for: Claude Code, Codex.

Or install odin-code-advanced, the plugin that ships this one along with the rest of its 50 skills.

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 capture-isolated-patch

README.md
[![agentmods](https://agentmods.dev/badge/skills/outlinedriven/odin-claude-plugin/capture-isolated-patch.svg)](https://agentmods.dev/skills/outlinedriven/odin-claude-plugin/capture-isolated-patch)
Your own site
<a href="https://agentmods.dev/skills/outlinedriven/odin-claude-plugin/capture-isolated-patch"><img src="https://agentmods.dev/badge/skills/outlinedriven/odin-claude-plugin/capture-isolated-patch.svg" alt="Measured on agentmods" height="20"></a>
Per session 53 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,105 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.00053 $0.01105
Opus 5 $0.00026 $0.00553
Sonnet 5 $0.00011 $0.00221
Haiku 4.5 $0.00005 $0.00111

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

Security

Grade A, and why

capture-isolated-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 capture-isolated-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.

plugins/odin-code-advanced/skills/capture-isolated-patch/SKILL.md · 42 lines

How it starts

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

Capture isolated patch

Contract

Field Bound contract
Trigger A candidate change must be produced without touching the working tree.
Authority Reversible local writes only: write to an ephemeral worktree and a temporary patch file under the worktree's parent temporary directory; never write to the original working tree. Rollback is git worktree remove --force <path>.
Side effect Creates an ephemeral worktree, runs the declared command inside it, and returns the exit code plus a binary-safe patch path. No commit, no push, no merge. The worktree is preserved on extraction failure.
Done Patch bytes are returned, or the failure is preserved for inspection; the original working tree is unchanged either way.

Inputs

  • command (required): the shell command that produces the candidate change. Run it inside the ephemeral worktree, with that worktree as its working directory.
  • base-ref (optional): the git ref the worktree is created from. Defaults to the current HEAD.
  • repo-path (optional): path to the repository. Defaults to the current working directory.

Procedure

  1. Require command. Accept optional base-ref (default: current HEAD) and optional repo-path (default: current working directory). Done when: the command is present and optional inputs are resolved to defaults or supplied values.
  2. Verify repo-path is a git work tree and base-ref resolves, both scoped to repo-path: git -C <repo-path> rev-parse --is-inside-work-tree and git -C <repo-path> rev-parse --verify <base-ref>. Stop and report the exact failing check before creating any worktree if either check fails. Done when: both checks pass, or the failing check is named and the run stops.
  3. Create an ephemeral worktree at a fresh temporary path with git -C <repo-path> worktree add --detach <tmp-path> <base-ref>. Record <tmp-path> as the worktree path. Done when: the worktree is created and its path is recorded, or the git error is reported.
  4. Run command inside the worktree with the worktree as its working directory. Capture stdout, stderr, and the exit code. Do not commit, push, or merge. Done when: the command returns with stdout, stderr, and exit code captured.
  5. After the command returns, stage untracked files so a newly created file is captured: run git -C <tmp-path> add -N . to mark them intent-to-add. Then compute the worktree diff against base-ref with git -C <tmp-path> diff --binary <base-ref> so binary file changes are representable. Write the diff to a patch file under the worktree's parent temporary directory. Done when: the binary-safe diff is written to a patch file, or the extraction failure is captured.
  6. If extraction succeeds, remove the ephemeral worktree with git worktree remove --force <tmp-path> and return the patch file path, the command exit code, and captured stdout/stderr. The patch was already written outside the worktree in step 5, so forcing the removal discards only the worktree's working files and loses nothing. Done when: the worktree is removed and the patch path, exit code, and output are returned.
  7. If extraction fails, preserve the worktree in place and return the worktree path, the command exit code, and the failure reason. Do not delete the worktree. Done when: the worktree is preserved and its path, exit code, and failure reason are returned.

Read the full file on GitHub · 42 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. 2d ago First seen · 42 lines · 53 tokens per session scan A 40084611ca69

Subscribe to this mod's changes

capture-isolated-patch is a skill published in the GitHub repository OutlineDriven/odin-claude-plugin (35 stars, last pushed yesterday), licensed Apache-2.0. It adds 53 tokens to every session and 1,105 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to capture-isolated-patch, differing in 0 lines, and is treated as a copy.

Related

Other skills, from other repositories

java-clean-arch

Reviews or implements Clean Architecture / Hexagonal Architecture (Ports & Adapters) and DDD tactical patterns for Java projects. Use when user asks to "apply clean architecture", "implement hexagonal architecture", "add ports and adapters", "apply DDD", "refactor to clean arch", "review architecture", or "add value…

ducpm2303/claude-java-plugins · 68 tokens

java-logging

Reviews Java logging for SLF4J best practices, MDC context, structured logging, and PII safety. Use when user asks to "review logging", "check my logs", "logging review", "is my logging correct", "MDC setup", or "check for PII in logs".

ducpm2303/claude-java-plugins · 60 tokens

java-security

Reviews or implements Spring Security configuration — JWT authentication, OAuth2, method-level security, CORS, and CSRF. Use when user asks to "add authentication", "secure this API", "implement JWT", "configure Spring Security", "add OAuth2 login", "protect endpoints", or "review security config".

ducpm2303/claude-java-plugins · 63 tokens

java-adr

Creates, lists, and manages Architecture Decision Records for Java projects. Use when user asks to "create an ADR", "document this decision", "write an architecture decision", "add ADR", "list decisions", "show ADRs", or "record this architectural choice".

ducpm2303/claude-java-plugins · 54 tokens

java-health

Runs a holistic code health check scoring Security, Tests, Performance and Quality with A-F grades. Use when user asks to "check health", "score this project", "health check", "how good is this code", "overall assessment", or "code quality score".

ducpm2303/claude-java-plugins · 54 tokens

java-test

Generates JUnit 5 and Mockito unit tests or Testcontainers integration tests, auto-detecting project setup. Use when user asks to "write tests", "generate tests", "add unit tests", "create test class", "test this service", or "write integration tests".

ducpm2303/claude-java-plugins · 57 tokens