tommymorgan:jj-setup

tommymorgan:jj-setup is a command for coding agents from tommymorgan/claude-plugins. It costs 19 tokens per session (1,070 once invoked), scanned A, original, MIT.

A repository check that looks for Jujutsu (jj), a version-control system, and configures safeguards against accidental Git commands.

In plain words
What is it for?
It checks the jj setup, detects whether Git is also present, and adds jj usage rules to CLAUDE.md when needed.
Why use it?
It helps prevent developers from using Git commands in a jj-managed repository, where the two systems can conflict.

Command

Part of the tommymorgan plugin — 10 skills, 14 commands, 13 agents, 4 hooks shipped together

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 commands/tommymorgan/claude-plugins/jj-setup
Clone the repo
git clone --depth 1 https://github.com/tommymorgan/claude-plugins

Or install tommymorgan, the plugin that ships this one along with the rest of its 10 skills, 14 commands, 13 agents, 4 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 tommymorgan:jj-setup

README.md
[![agentmods](https://agentmods.dev/badge/commands/tommymorgan/claude-plugins/jj-setup.svg)](https://agentmods.dev/commands/tommymorgan/claude-plugins/jj-setup)
Your own site
<a href="https://agentmods.dev/commands/tommymorgan/claude-plugins/jj-setup"><img src="https://agentmods.dev/badge/commands/tommymorgan/claude-plugins/jj-setup.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 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,070 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00019 $0.01070
Opus 5 $0.00010 $0.00535
Sonnet 5 $0.00004 $0.00214
Haiku 4.5 $0.00002 $0.00107

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

Security

Grade A, and why

tommymorgan:jj-setup scanned grade A 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 3d 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.

Reads agent configuration directorieslowAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

cat .claude/settings.json 2>/dev/null | grep -A5 "PreToolUse"

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

tommymorgan/vcs/commands/jj-setup.md · 137 lines

How it starts

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

Set Up jj Safety Checks

Audit the current repository for jj usage and set up safeguards to prevent accidental git commands.

Workflow

Step 1: Verify jj Environment

Check that jj is available and the repository is jj-managed:

# Check jj is in PATH
which jj || echo "NOT_FOUND"

# Check .jj directory exists
ls -d .jj 2>/dev/null || echo "NOT_JJ_REPO"

If jj is not found: Tell the user to install jj and stop. If .jj/ doesn't exist: Tell the user this isn't a jj repo and stop.

Step 2: Check for Colocated Git

# Check if this is a colocated jj+git repo
ls -d .git 2>/dev/null && echo "COLOCATED" || echo "PURE_JJ"

If colocated, the risk of accidental git commands is highest. All subsequent checks are especially important.

Step 3: Audit CLAUDE.md

Check if the project's CLAUDE.md mentions jj:

grep -i "jj\|jujutsu" CLAUDE.md 2>/dev/null

If no mention found, add a section to CLAUDE.md:

## Version Control

This repository uses [Jujutsu (jj)](https://martinvonz.github.io/jj/) for version control. **Always use jj commands, never raw git commands.** See the `jj` skill for the full command reference.

Key rules:
- `jj status` not `git status`
- `jj describe -m "..."` + `jj new` not `git commit`
- `jj bookmark set <name>` not `git branch`
- `jj git push` not `git push`
- `jj git fetch` not `git fetch`

If already mentioned, report what's there and skip.

Step 4: Audit Claude Code Settings for Git-Blocking Hook

Check if there's a PreToolUse hook that blocks git commands in Bash:

# Check project-level settings
cat .claude/settings.json 2>/dev/null | grep -A5 "PreToolUse"

# Check user-level settings
cat ~/.claude/settings.json 2>/dev/null | grep -A5 "PreToolUse"

If no git-blocking hook exists, recommend adding one. Show the user what to add to .claude/settings.json:

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "Bash",
        "hooks": [
          {
            "type": "command",
            "command": "python3 -c \"import sys,json; d=json.loads(sys.stdin.read()); cmd=d.get('tool_input',{}).get('command',''); git_cmds=['git commit','git add','git checkout','git branch','git stash','git merge','git rebase','git push','git pull','git reset','git cherry-pick']; matches=[c for c in git_cmds if c in cmd]; sys.exit(0) if not matches else (print(json.dumps({'decision':'block','reason':f'Use jj instead of {matches[0]}. This repo is managed by jj — raw git commands can corrupt state.'})), sys.exit(0))\"",
            "timeout": 5
          }
        ]
      }
    ]
  }
}

Read the full file on GitHub · 137 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. 3d ago First seen · 137 lines · 19 tokens per session scan A f9b9d8b72c23

Subscribe to this mod's changes

tommymorgan:jj-setup is a command published in the GitHub repository tommymorgan/claude-plugins (4 stars, last pushed 1mo ago), licensed MIT. It adds 19 tokens to every session and 1,070 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.