using-git-worktrees-codex

using-git-worktrees-codex is a skill for Claude Code, Codex from mzored/superpowers-cc-to-codex. It costs 38 tokens per session (1,229 once invoked), scanned A, original, MIT.

A workflow for creating isolated Git worktrees, which are separate working directories connected to the same repository. It chooses a safe location, checks repository rules, and verifies that the directory will not be accidentally committed.

In plain words
What is it for?
Use it before implementing a feature or plan when you need a separate branch and working directory, especially while keeping the main workspace untouched.
Why use it?
It lets feature work proceed without switching the current branch or mixing unfinished changes with other work. The safety checks reduce the chance of creating worktrees in an unsuitable or unignored location.

Skill for Claude CodeCodex

Part of the superpowers-cc-to-codex plugin — 15 skills, 2 commands 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/mzored/superpowers-cc-to-codex/using-git-worktrees-codex
Any agent
npx skills add mzored/superpowers-cc-to-codex --skill using-git-worktrees-codex
Clone the repo
git clone --depth 1 https://github.com/mzored/superpowers-cc-to-codex

Made for: Claude Code, Codex.

Or install superpowers-cc-to-codex, the plugin that ships this one along with the rest of its 15 skills, 2 commands.

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 using-git-worktrees-codex

README.md
[![agentmods](https://agentmods.dev/badge/skills/mzored/superpowers-cc-to-codex/using-git-worktrees-codex.svg)](https://agentmods.dev/skills/mzored/superpowers-cc-to-codex/using-git-worktrees-codex)
Your own site
<a href="https://agentmods.dev/skills/mzored/superpowers-cc-to-codex/using-git-worktrees-codex"><img src="https://agentmods.dev/badge/skills/mzored/superpowers-cc-to-codex/using-git-worktrees-codex.svg" alt="Measured on agentmods" height="20"></a>
Per session 38 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,229 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.00038 $0.01229
Opus 5 $0.00019 $0.00615
Sonnet 5 $0.00008 $0.00246
Haiku 4.5 $0.00004 $0.00123

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

Security

Grade A, and why

using-git-worktrees-codex 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 4d 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.

skills/using-git-worktrees-codex/SKILL.md · 198 lines

How it starts

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

Using Git Worktrees

Overview

Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.

Core principle: Systematic directory selection + safety verification = reliable isolation.

Announce at start: "I'm using the using-git-worktrees skill to set up an isolated workspace."

Directory Selection Process

Follow this priority order:

1. Check Existing Directories

# Check in priority order
ls -d .worktrees 2>/dev/null     # Preferred (hidden)
ls -d worktrees 2>/dev/null      # Alternative

If found: Use that directory. If both exist, .worktrees wins.

2. Check CLAUDE.md

grep -i "worktree.*director" CLAUDE.md 2>/dev/null

If preference specified: Use it without asking.

3. Ask User

If no directory exists and no CLAUDE.md preference:

No worktree directory found. Where should I create worktrees?

1. .worktrees/ (project-local, hidden)
2. ~/.config/superpowers/worktrees/<project-name>/ (global location)

Which would you prefer?

Safety Verification

For Project-Local Directories (.worktrees or worktrees)

MUST verify directory is ignored before creating worktree:

# Check if directory is ignored (respects local, global, and system gitignore)
git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null

If NOT ignored:

Fix broken things immediately:

  1. Add appropriate line to .gitignore
  2. Commit the change
  3. Proceed with worktree creation

Why critical: Prevents accidentally committing worktree contents to repository.

For Global Directory (~/.config/superpowers/worktrees)

Read the full file on GitHub · 198 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. 4d ago First seen · 198 lines · 38 tokens per session scan A d1331dfd63ca

Subscribe to this mod's changes

using-git-worktrees-codex is a skill published in the GitHub repository mzored/superpowers-cc-to-codex (7 stars, last pushed 4mo ago), licensed MIT. It adds 38 tokens to every session and 1,229 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-31.

Related

Other skills, from other repositories

claude-code-session-broker

Use when running Arcgentic V2 in Claude Code and fixed Planner, Developer, and Auditor role sessions must be coordinated through a broker.

Arch1eSUN/Arcgentic · 35 tokens

arcgentic

Use when the user says Arcgentic, asks to use Arcgentic, or wants an idea taken through a complete plan → development → self-audit → external audit workflow in Codex.

Arch1eSUN/Arcgentic · 43 tokens

espalier-migrate

Migrate an existing harness/espalier install to the current Espalier version — auto-detects which of v0.1→v0.2, v0.3→v0.4, v0.4→v0.5, the v0.5.3 coder-agent patch, v0.5→v0.6 (Stage 1 grill), v0.6→v0.7 (read-only /espalier-ask lane), v0.7→v0.8 (requirements approval gate), the v0.8.1 impact-analysis agent patch, the…

Junhanliu-dev/espalier-engineering · 0 tokens

session-mode

Use when a project has not yet stored session mode, when a user asks for complete arcgentic workflow execution, or when role identity handoff prompts are needed.

Arch1eSUN/Arcgentic · 36 tokens

verify-gates

Runs the mechanical quality gates that the arcgentic state machine requires for state transitions. Invoked indirectly by transition.sh OR directly by orchestrator agent before declaring a state transition. Use when about to call transition.sh OR when manually verifying that a round artifact meets the gate criteria.…

Arch1eSUN/Arcgentic · 75 tokens

cross-session-handoff

Read, write, snapshot, and lock .arcgentic/state.yaml across planner, dev, audit, and optional test sessions.

Arch1eSUN/Arcgentic · 31 tokens