gtr is a command-line tool that manages Git worktrees, which let developers keep multiple branches checked out in separate directories at the same time. It automates worktree creation, branch setup, configuration copying, dependency installation, and workspace preparation for reviews, coding agents, and parallel development. The catalogue contains instructions for using gtr.
Borrowing it
Nothing to install: this file belongs to coderabbitai/git-worktree-runner. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/coderabbitai/git-worktree-runner/main/.github/instructions/lib.instructions.mdgit clone --depth 1 https://github.com/coderabbitai/git-worktree-runnerWrote 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/instructions/coderabbitai/git-worktree-runner/lib)<a href="https://agentmods.dev/instructions/coderabbitai/git-worktree-runner/lib"><img src="https://agentmods.dev/badge/instructions/coderabbitai/git-worktree-runner/lib/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/instructions/coderabbitai/git-worktree-runner/lib"><img src="https://agentmods.dev/badge/instructions/coderabbitai/git-worktree-runner/lib.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.00652 | $0.00652 |
| Opus 5.5 | $0.00261 | $0.00261 |
| Sonnet 5.5 | $0.00130 | $0.00130 |
| Haiku 4.5 | $0.00065 | $0.00065 |
Grade A, and why
git-worktree-runner lib.instructions.md 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 yesterday.
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 — 32 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Lib Instructions
Modifying Core (lib/*.sh)
- Maintain backwards compatibility with existing configs
- Quote all paths: Support spaces in directory names
- Use
log_error/log_infofromlib/ui.shfor user messages - Git version fallbacks: See
get_current_branch()inlib/core.sh(Git 2.22+branch --show-current, falling back torev-parse --abbrev-ref HEAD) - Regenerate completions after touching
_EDITOR_REGISTRY,_AI_REGISTRY, or_CFG_KEY_MAP:./scripts/generate-completions.sh(CI runs--check)
Key Functions & Responsibilities
resolve_base_dir: config/env/default selection; warn if inside repo & not ignored.resolve_target: ID1, then exact registered branch, then literal registered folder alias; returns TSV.create_worktree: decides remote/local/new; respects--force+--namesafety.cfg_default: precedence local git config →.gtrconfig→ global/system git config →GTR_*env var → fallback (do not reorder).cfg_default_trusted_fileuses the same order but ignores.gtrconfigvalues untilgit gtr trustapproves them.sanitize_branch_name: branch name → folder name; the only place that logic lives.lib/hooks.shdispatchers:run_hooksevaluates each hook in its own subshell and serves postRemove directly;run_hooks_inis the same after acdinto the target worktree (postCreate, preRemove);run_hooks_exportevaluates postCd hooks directly rather than in a nested subshell, so their exports reach the tool launched beside them;lib/launch.shandlib/commands/ai.sheach call it inside a( cd "$worktree" ... )block that also launches the AI tool, which is what keeps those exports out of the main script. The editor paths (_auto_launch_editor,_open_editor,cmd_editor) run no postCd hooks at all. Thegtr cdfunctions generated byinitevaluate postCd hooks themselves. Every path skips untrusted.gtrconfighooks.cfg_get_all: merge multi-value keys; preserves order; deduplicates.
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.
- yesterday Changed · +3 tokens per session f9d06e792def
- 1mo ago Changed · +3 lines · +307 tokens per session 42720818cf9b
- 2mo ago First seen · 29 lines · 342 tokens per session scan A c083bf7b2eaf
git-worktree-runner lib.instructions.md is an instructions file published in the GitHub repository coderabbitai/git-worktree-runner (1,808 stars, last pushed yesterday), licensed Apache-2.0. It adds 652 tokens to every session, about $0.0026 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.
git-worktree-runner lib.instructions.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| git-worktree-runner lib.instructions.mdcoderabbitai/git-worktree-runner | Instructions file | 1.8k | yesterday | Apache-2.0 | A | 652 | GitHub Copilot |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 5,516 | GitHub Copilot |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | today | MIT | A | 4,680 | Codex, OpenCode |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | today | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |