git-worktree-runner lib.instructions.md

Project instructions for the shell library of a Git worktree runner. A Git worktree is a separate working directory connected to the same repository, useful for handling branches side by side.

In plain words
What is it for?
Use them when modifying library shell files, configuration lookup, worktree creation, directory scanning, or Git-version compatibility.
Why use it?
They help agents change shared shell code without breaking configuration precedence, path handling, command compatibility, or existing command interfaces.

Instructions file for GitHub Copilot

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 instructions/coderabbitai/git-worktree-runner/lib
Clone the repo
git clone --depth 1 https://github.com/coderabbitai/git-worktree-runner

Made for: GitHub Copilot.

Per session 342 This file is loaded in full into every session.
When invoked 342 The same file — it is already loaded in full.
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.00342 $0.00342
Opus 5 $0.00171 $0.00171
Sonnet 5 $0.00068 $0.00068
Haiku 4.5 $0.00034 $0.00034

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

Security

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.

.github/instructions/lib.instructions.md · 29 lines

What it actually says

Lib Instructions

Modifying Core (lib/*.sh)

  • Maintain backwards compatibility with existing configs
  • Quote all paths: Support spaces in directory names
  • Use log_error / log_info from lib/ui.sh for user messages
  • Git version fallbacks: Check lib/core.sh:97-100 for example (Git 2.22+ --show-current vs older rev-parse)

Key Functions & Responsibilities

  • resolve_base_dir: config/env/default selection; warn if inside repo & not ignored.
  • resolve_target: ID 1 + branch/current + sanitized path scan; returns TSV.
  • create_worktree: decides remote/local/new; respects --force + --name safety.
  • cfg_default: precedence local→global→system→env→fallback (do not reorder).
  • cfg_get_all: merge multi-value keys; preserves order; deduplicates.

Change Guidelines

  • Preserve adapter contracts; do not rename exported functions used by command handlers in lib/commands/.
  • Add new config keys with gtr.<name> prefix; avoid collisions.
  • For performance-sensitive loops (e.g. directory scans) prefer built-ins (find, grep) with minimal subshells.
  • Any new Git command: add fallback for older versions or guard with detection.
  • Manual test after changes (subset): new, open, ai, rm, list --porcelain, config set/get/unset, go 1, hooks run once.
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. yesterday First seen · 29 lines · 342 tokens per session scan A c083bf7b2eaf

Subscribe to this mod's changes

git-worktree-runner lib.instructions.md is an instructions file published in the GitHub repository coderabbitai/git-worktree-runner (1,754 stars, last pushed 4d ago), licensed Apache-2.0. It adds 342 tokens to every session, about $0.0017 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-30.