ccl-worktree-check

ccl-worktree-check is a command for Claude Code, OpenCode from ccoalm/ccl-skills. It costs 13 tokens per session (426 once invoked), scanned A, original, Apache-2.0.

A repository check that determines whether the current Git worktree is isolated and safe for editing. A worktree is a separate working directory connected to the same Git repository.

In plain words
What is it for?
Use it before making changes to inspect branch, worktree, repository, and cleanliness status, and to get a command for creating a feature worktree when needed.
Why use it?
It helps prevent edits in an unsuitable checkout, such as a shared, dirty, detached, or incorrectly based worktree.

Command for Claude CodeOpenCode

Written for Claude Code and OpenCode: shipped in a Claude Code plugin, but also installed under .opencode/.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is bash skills/worktree-isolation/scripts/worktree-status.sh --slug <task-slug>.

Part of the ccl-skills plugin — 33 skills, 4 commands, 7 hooks shipped together

Good fit Use it before making changes to inspect branch, worktree, repository, and cleanliness status, and to get a command for creating a feature worktree when needed.

Compare 6 commands from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/ccoalm/ccl-skills
agentmods
npx agentmods add commands/ccoalm/ccl-skills/ccl-worktree-check

Made for: Claude Code, OpenCode.

Or install ccl-skills, the plugin that ships this one along with the rest of its 33 skills, 4 commands, 7 hooks.

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 ccl-worktree-check

README.md
[![agentmods](https://agentmods.dev/badge/commands/ccoalm/ccl-skills/ccl-worktree-check.svg)](https://agentmods.dev/commands/ccoalm/ccl-skills/ccl-worktree-check)
Your own site
<a href="https://agentmods.dev/commands/ccoalm/ccl-skills/ccl-worktree-check"><img src="https://agentmods.dev/badge/commands/ccoalm/ccl-skills/ccl-worktree-check.svg" alt="Measured on agentmods" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 426 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.00013 $0.00426
Opus 5 $0.00006 $0.00213
Sonnet 5 $0.00003 $0.00085
Haiku 4.5 $0.00001 $0.00043

Measured 8d ago against content hash 8365d991a47e, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

ccl-worktree-check 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 8d 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.

.opencode/commands/ccl-worktree-check.md · 37 lines

What it actually says

Check the current repository's worktree isolation state before editing.

Run the repo-local preflight first:

bash skills/worktree-isolation/scripts/worktree-status.sh --slug <task-slug>

If it prints UNSAFE, do not edit. Create the feature worktree with the printed git worktree add -b ... command, then continue inside that new path. New lanes default to (and are recommended to use) the primary checkout root at .work/worktrees/<task-slug>; per-lane local metadata is conventionally .work/lanes/<task-slug>.json and the status script only prints the snippet/path (it does not write metadata). The .work/worktrees location is a convention, not a hard safety condition: an existing independent feature worktree outside it can still report SAFE when the hard conditions hold (independent worktree, named feature branch, not a submodule, not detached, clean tree, confirmed base); in that case the script only emits a non-blocking warning suggesting .work/worktrees for new lanes.

If the script is missing, fallback to:

git status --short --branch
git rev-parse --show-toplevel
git rev-parse --git-dir
git rev-parse --git-common-dir
git symbolic-ref --quiet --short HEAD || true
test -f .worktree-only && printf '.worktree-only present\n' || printf '.worktree-only absent\n'

If .worktree-only is present and the current checkout is main or master with git-dir == git-common-dir, stop and create a feature worktree before editing. Manual fallback creation should anchor on the primary checkout root, derived from the parent of git rev-parse --git-common-dir, e.g. git worktree add -b <branch> <primary-root>/.work/worktrees/<slug> <base>.

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. 8d ago First seen · 37 lines · 13 tokens per session scan A 8365d991a47e

Subscribe to this mod's changes

ccl-worktree-check is a command published in the GitHub repository ccoalm/ccl-skills (6 stars, last pushed yesterday), licensed Apache-2.0. It adds 13 tokens to every session and 426 once invoked, about $0.0001 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.