git-worktree-task

Rules for completing coding tasks in separate Git worktrees, which are isolated working directories connected to the same repository. They cover setup, project standards, implementation, checks, and delivery.

In plain words
What is it for?
Use them when starting a coding task that should run in its own branch and worktree, including reading project rules, implementing changes, running checks, and preparing the result.
Why use it?
They keep the main working directory clean and make autonomous changes easier to isolate and review.

Cursor rule for Cursor

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 rules/technickai/claude_telemetry/git-worktree-task
Clone the repo
git clone --depth 1 https://github.com/TechNickAI/claude_telemetry

Made for: Cursor.

Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,182 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.00008 $0.01182
Opus 5 $0.00004 $0.00591
Sonnet 5 $0.00002 $0.00236
Haiku 4.5 $0.00001 $0.00118

Measured 2d ago against content hash ec140959f3a3, 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-task 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.

.cursor/rules/git-worktree-task.mdc · 112 lines

How it starts

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

Git Worktree Task Workflow

When completing tasks autonomously, we work in git worktrees. This isolates our work, keeps the main working directory clean, and allows context switching without losing state. The goal: deliver a pull request that passes all checks and merges without back-and-forth.

Why Git Worktrees

Worktrees let you work on multiple branches simultaneously without stashing or losing context. Your main directory stays on main for quick reference. Your task directory is isolated. You can switch between them instantly. When done, the worktree disappears cleanly.

The Complete Cycle

Setup your workspace. Create a git worktree for the task. Choose a branch name that describes what you're building. The worktree should be in a separate directory, typically parallel to your main repo directory.

Read the standards. Before writing code, read all cursor rules in .cursor/rules/. These define how this project works. Every applicable rule must be followed. If CLAUDE.md or AGENTS.md exist at the project root, read those too.

Implement the solution. Write code that solves the problem. Follow all cursor rules. Make commits along the way as logical units of work are completed. Each commit should follow the git commit message guidelines in .cursor/rules/git-commit-message.md.

Validate locally before pushing. Run the project's pre-push validation. This catches issues before CI does, saving time and CI minutes. The project likely has pnpm pre-push or similar. Run it. Fix any issues it finds. Only proceed when everything passes locally. You can also run pre-commit if it exists, pytest, ruff, prettier, etc. For a clue, you can look for a CI job in the github workflows. It will save you time if you can run the steps locally rather than pushing and waiting for a build.

If validation fails, understand why and fix it. Don't push broken code hoping CI will tell you what's wrong - the local tooling already told you.

Self-review your changes. Invoke the code reviewer agent (Rivera in .claude/agents/rivera.md) to review your changes before pushing. The reviewer catches bugs, security issues, design problems, and maintainability concerns that you might have missed. Address critical issues. Consider warnings seriously. Evaluate suggestions for merit.

Read the full file on GitHub · 112 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. 2d ago First seen · 112 lines · 8 tokens per session scan A ec140959f3a3

Subscribe to this mod's changes

git-worktree-task is a cursor rule published in the GitHub repository TechNickAI/claude_telemetry (30 stars, last pushed 10mo ago), licensed MIT. It adds 8 tokens to every session and 1,182 once invoked, about $0.0000 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.