agents-start-gitworktree

agents-start-gitworktree is a command for Claude Code from gpt-cmdr/ras-commander. It costs 0 tokens per session (871 once invoked), scanned A, original, MIT.

A command that creates and registers a separate Git worktree for isolated agent work, using a new branch and a purpose-based name.

In plain words
What is it for?
Use it when starting a new feature or other agent task that should have its own branch and working folder.
Why use it?
It prepares a tracked workspace for a new task without mixing that task with the current branch.

Command for Claude Code

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/gpt-cmdr/ras-commander/agents-start-gitworktree
Clone the repo
git clone --depth 1 https://github.com/gpt-cmdr/ras-commander

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 agents-start-gitworktree

README.md
[![agentmods](https://agentmods.dev/badge/commands/gpt-cmdr/ras-commander/agents-start-gitworktree.svg)](https://agentmods.dev/commands/gpt-cmdr/ras-commander/agents-start-gitworktree)
Your own site
<a href="https://agentmods.dev/commands/gpt-cmdr/ras-commander/agents-start-gitworktree"><img src="https://agentmods.dev/badge/commands/gpt-cmdr/ras-commander/agents-start-gitworktree.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 871 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.00000 $0.00871
Opus 5 $0.00000 $0.00436
Sonnet 5 $0.00000 $0.00174
Haiku 4.5 $0.00000 $0.00087

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

Security

Grade A, and why

agents-start-gitworktree 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 3d 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.

.claude/commands/agents-start-gitworktree.md · 121 lines

How it starts

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

You are starting a new git worktree for isolated agent work. This command creates a worktree, registers it in the tracking system, and ensures you can identify your workspace even after context resets.

Your Task

1. Gather Information

First, determine the worktree purpose by asking the user OR inferring from context:

  • If user provided a purpose: Use it directly
  • If no purpose given: Ask "What is the purpose/feature for this worktree?"

Generate a branch name from the purpose:

  • Format: agent/{purpose-slug} (e.g., agent/hdf-refactoring, agent/usgs-validation)
  • Use lowercase, hyphens instead of spaces

2. Create the Worktree

# Get current repo root
REPO_ROOT=$(git rev-parse --show-toplevel)
PROJECT_NAME=$(basename "$REPO_ROOT")

# Create worktrees directory if needed (use sibling directory pattern)
WORKTREE_BASE="${REPO_ROOT}/../${PROJECT_NAME}-worktrees"
mkdir -p "$WORKTREE_BASE"

# Create worktree with new branch
BRANCH_NAME="agent/{purpose-slug}"
WORKTREE_PATH="$WORKTREE_BASE/$BRANCH_NAME"
git worktree add -b "$BRANCH_NAME" "$WORKTREE_PATH"

3. Register in Tracking System

Update agent_tasks/git_worktree_status.md by adding an entry:

### {Branch Name}
- **Path**: {full worktree path}
- **Created**: {YYYY-MM-DD HH:MM}
- **Purpose**: {description of work being done}
- **Status**: active
- **Agent Session**: {brief identifier if available, or "new session"}
- **Notes**: {any relevant context}

4. Sideload Shared Folders (Windows)

Create junctions so the worktree can access shared development materials:

cd {WORKTREE_PATH}
mklink /J agent_tasks {REPO_ROOT}\agent_tasks
mklink /J feature_dev_notes {REPO_ROOT}\feature_dev_notes 2>nul
mklink /J planning_docs {REPO_ROOT}\planning_docs 2>nul

Or on Git Bash/WSL:

cd {WORKTREE_PATH}
ln -s {REPO_ROOT}/agent_tasks agent_tasks
ln -s {REPO_ROOT}/feature_dev_notes feature_dev_notes 2>/dev/null
ln -s {REPO_ROOT}/planning_docs planning_docs 2>/dev/null

Read the full file on GitHub · 121 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. 3d ago First seen · 121 lines · 0 tokens per session scan A 6e477a7f7be0

Subscribe to this mod's changes

agents-start-gitworktree is a command published in the GitHub repository gpt-cmdr/ras-commander (78 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 871 tokens. 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.