worktrees

worktrees is a skill for Claude Code from hnikoloski/imlazy. It costs 33 tokens per session (975 once invoked), scanned A, original, MIT.

A workflow for putting feature work in a separate Git workspace, usually called a worktree. It checks whether isolation already exists and can use Git's built-in worktree support or a fallback.

In plain words
What is it for?
Use it before implementing a feature or following an implementation plan when you want an isolated copy of the repository for development.
Why use it?
It keeps unfinished changes separate from the current branch, reducing the risk of mixing work or disrupting the files you are already using.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the imlazy plugin — 26 skills, 1 command, 1 hook shipped together

Good fit Use it before implementing a feature or following an implementation plan when you want an isolated copy of the repository for development.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/hnikoloski/imlazy/imlazy-worktrees
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.

Any agent
npx skills add hnikoloski/imlazy --skill imlazy-worktrees
Clone the repo
git clone --depth 1 https://github.com/hnikoloski/imlazy

Made for: Claude Code.

Or install imlazy, the plugin that ships this one along with the rest of its 26 skills, 1 command, 1 hook.

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 worktrees

README.md
[![agentmods](https://agentmods.dev/badge/skills/hnikoloski/imlazy/imlazy-worktrees/github.svg)](https://agentmods.dev/skills/hnikoloski/imlazy/imlazy-worktrees)
Your own site
<a href="https://agentmods.dev/skills/hnikoloski/imlazy/imlazy-worktrees"><img src="https://agentmods.dev/badge/skills/hnikoloski/imlazy/imlazy-worktrees/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.

agentmods 80×15 button for worktrees

Your own site · 80×15
<a href="https://agentmods.dev/skills/hnikoloski/imlazy/imlazy-worktrees"><img src="https://agentmods.dev/badge/skills/hnikoloski/imlazy/imlazy-worktrees.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 975 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00033 $0.00975
Opus 5 $0.00016 $0.00487
Sonnet 5 $0.00007 $0.00195
Haiku 4.5 $0.00003 $0.00097

Measured 10d ago against content hash 9ee53dafbc97, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

worktrees 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 10d 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/imlazy-worktrees/SKILL.md · 101 lines

How it starts

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

worktrees

Overview

Ensure work happens in an isolated workspace. Prefer your platform's native worktree tools. Fall back to manual git worktrees only when no native tool is available.

Core principle: Detect existing isolation first. Then use native tools. Then fall back to git. Never fight the harness.

Step 0: Detect existing isolation

Before creating anything, check if you are already in an isolated workspace.

GIT_DIR=$(cd "$(git rev-parse --git-dir)" 2>/dev/null && pwd -P)
GIT_COMMON=$(cd "$(git rev-parse --git-common-dir)" 2>/dev/null && pwd -P)

Submodule guard: GIT_DIR != GIT_COMMON is also true inside git submodules. Verify you're not in one:

git rev-parse --show-superproject-working-tree 2>/dev/null

If that returns a path, you are in a submodule — treat as normal repo.

If GIT_DIR != GIT_COMMON (and not a submodule): Already in a linked worktree. Skip to Step 3 (Project Setup). Do NOT create another worktree.

If GIT_DIR == GIT_COMMON: Normal repo checkout. Ask for consent before creating a worktree: "Would you like me to set up an isolated worktree? It protects your current branch from changes." If declined, work in place.

Step 1: Create isolated workspace

Try in this order:

1a. Native worktree tools (preferred)

Check if your harness provides a native worktree tool (names like EnterWorktree, WorktreeCreate, /worktree, or a --worktree flag). If yes, use it and skip to Step 3. Native tools handle directory placement, branch creation, and cleanup automatically.

1b. Git worktree fallback (only if 1a does not apply)

Directory selection (priority order):

  1. Declared user preference in your instructions
  2. Existing project-local .worktrees/ or worktrees/ directory
  3. Existing global ~/.config/imlazy/worktrees/<project>/
  4. Default: .worktrees/ at project root

Safety verification (project-local directories only):

git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null

If NOT ignored: add to .gitignore, commit, then proceed.

Read the full file on GitHub · 101 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. 10d ago First seen · 101 lines · 33 tokens per session scan A 9ee53dafbc97

Subscribe to this mod's changes

worktrees is a skill published in the GitHub repository hnikoloski/imlazy (2 stars, last pushed 1mo ago), licensed MIT. It adds 33 tokens to every session and 975 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

git-workflow

This skill should be used when the user asks to "create git commit", "manage branches", "follow git workflow", "use Conventional Commits", "handle merge conflicts", or asks about git branching strategies, version control best practices, pull request workflows. Provides comprehensive Git workflow guidance for team…

Galaxy-Dawn/claude-scholar · 64 tokens

intuitive-squash

Squash local GSD or agent-generated commit history into a clean, reviewable story while preserving important fixes. Use when the user asks to squash commits, clean git history, compress phase commits, prepare a branch before PR, compare aggressive vs moderate squash options, or preserve hotfix/security commits during…

MiaoDX/intuitive-flow · 73 tokens

intuitive-port-worktree

Port changes from one git worktree or checkout into the default repository folder's current branch, then by default sync the result to the remote default branch when everything is clean. Use when the user asks to move, copy, transfer, transplant, cherry-pick, apply a patch, or port worktree changes into the…

MiaoDX/intuitive-flow · 79 tokens

tfx-ship

A release workflow for publishing triflux versions through GitHub Releases, the npm package registry, and the Claude Code marketplace. It also supports version changes, dry runs, skipped tests, and no-publish runs.

tellang/triflux · 130 tokens

merge-worktree

A Korean-language workflow for squash-merging a Git worktree branch into a target branch and creating a conventional commit message. A worktree is a separate working directory connected to the same Git repository; squash-merge combines its changes into one commit.

tellang/triflux · 66 tokens

codex-hud

Show Codex workspace context with local config, git state, hooks, and project hints. Standalone mode can show an expanded snapshot; patched Codex TUI footer mode is single-line. Use when the user says "codex-hud", "show Codex HUD", "status HUD", "workspace snapshot", or asks for richer Codex context.

brandonwie/codex-hud · 76 tokens