kube-coder: Skill for Claude Code

.claude/skills/worktree/SKILL.md

worktree is a skill for Claude Code from imran31415/kube-coder. It costs 70 tokens per session (1,752 once invoked), scanned C, original, MIT.

A session-isolation helper for Git repositories and development servers. It creates a separate checkout, branch, and network port for one coding session.

In plain words
What is it for?
Use it before isolated code changes, parallel work on one repository, or builds and development servers that could conflict.
Why use it?
It prevents simultaneous sessions from changing the same files, overwriting build output, or trying to use the same server port.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions subagents.

This is imran31415/kube-coder's own configuration. It tells Claude Code how to work on kube-coder itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything kube-coder configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/dev/kube-coder/.claude/skills/worktree/.

Reuse

Borrowing it

Nothing to install: this file belongs to imran31415/kube-coder. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/imran31415/kube-coder/main/.claude/skills/worktree/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/imran31415/kube-coder

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 worktree

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/imran31415/kube-coder/worktree"><img src="https://agentmods.dev/badge/skills/imran31415/kube-coder/worktree.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 70 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,752 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00070 $0.01752
Opus 5.5 $0.00028 $0.00701
Sonnet 5.5 $0.00014 $0.00350
Haiku 4.5 $0.00007 $0.00175

Measured 1mo ago against content hash 75896cf6021f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade C, and why

worktree scanned grade C with 1 finding 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 1mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (worktree.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

`.git/worktrees`. Don't `rm -rf` a worktree dir by hand — use `rm` (which runs
.claude/skills/worktree/SKILL.md · 136 lines

How it starts

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

Per-session git worktree

kube-coder isolates sessions at the terminal level (each task gets its own tmux session + ~/.claude-tasks/<id>/) but everything still runs in the same /home/dev filesystem. So two sessions on the same repo collide three ways:

  • git tree — branch/checkout/index thrash, a dirty working tree
  • build output — both write ./dist, ./build; Kaniko reads its context from the shared path
  • dev-server ports — EADDRINUSE on :3000 (ports are per-pod, not per-session)

This skill fixes all three for the current session with no infra change: it gives you a dedicated git worktree (own checkout + branch) at a path outside the repo, and leases a free port for any server you start. Worktrees share the main clone's object store, so they're cheap on disk — only working files are duplicated.

The helper is worktree.sh next to this file. Invoke it as bash "$CLAUDE_SKILL_DIR/worktree.sh" … (or with its absolute path under /home/dev/kube-coder/.claude/skills/worktree/).

Start an isolated session (the common path)

Run from inside the repo you want to work on (cd there first). $ARGUMENTS is an optional human slug; if omitted it derives one from the current task id (KC_TASK_ID) or a random token, so it's always unique.

WT=/home/dev/kube-coder/.claude/skills/worktree/worktree.sh
eval "$(bash "$WT" new "$ARGUMENTS")"   # creates worktree+branch+port, sets KC_WT / PORT
cd "$KC_WT"                              # <-- this cd PERSISTS across your Bash calls

After this, do all work for the change from $KC_WT. The human summary (path / branch / port / preview URL) is printed to stderr — note the port, because exported env vars do not survive between separate Bash tool calls (the cd does). The worktree also records everything in $KC_WT/.kc-worktree.json, so you can re-read the port later:

jq -r .port "$KC_WT/.kc-worktree.json"   # or read .branch / .path

What you get

Read the full file on GitHub · 136 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 1mo ago Changed · +17 lines 75896cf6021f
  2. 2mo ago First seen · 119 lines · 70 tokens per session scan C 27b021fd71ea

Subscribe to this mod's changes

worktree is a skill published in the GitHub repository imran31415/kube-coder (399 stars, last pushed 2d ago), licensed MIT. It adds 70 tokens to every session and 1,752 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

worktree compared with skills from other repositories

worktree next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
worktreeimran31415/kube-coderSkill3992d agoMITC70Claude Code
merge-batchdiegosouzapw/OmniRouteSkill83k5d agoMITA46Claude Code
prowler-commitprowler-cloud/prowlerSkill15kyesterdayApache-2.0A44Claude Code, Codex
gh-auth-isolationgithub/gh-awSkill5.6kyesterdayMITA20Claude Code, Codex
github-skillzeenie-ai/OpenCompanySkill1.1kyesterdayMITA51Claude Code
comet-githubrpamis/cometSkill3.3kyesterdayMITA72Claude Code, Codex
release-helperSahir619/fable-methodSkill2.3k1mo agoMITA43Claude Code