setup:transitions

A migration command that adds hourly progress tracking to an existing Claude Code project. It creates a hook, updates project settings, and adds instructions to CLAUDE.md.

In plain words
What is it for?
Use it on projects that already have a .claude directory to create hourly transition files and enable automatic progress tracking when you submit prompts.
Why use it?
It makes it easier to record what happened during coding sessions and continue work with a recent progress history.

Command

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/stefan-jansen/claude-code-toolkit/setup-transitions
Clone the repo
git clone --depth 1 https://github.com/stefan-jansen/claude-code-toolkit
Per session 18 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,093 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 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.00018 $0.01093
Opus 5 $0.00009 $0.00547
Sonnet 5 $0.00004 $0.00219
Haiku 4.5 $0.00002 $0.00109

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

Security

Grade B, and why

setup:transitions scanned grade B 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 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.

Reads agent configuration directoriesmediumAgent snooping

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

cat > .claude/hooks/init-transition.sh << 'HOOK_EOF'
plugins/setup/commands/setup:transitions.md · 163 lines

How it starts

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

Add Session Progress Tracking

This command adds automatic hourly transition file tracking to your project.

What it does:

  1. Creates .claude/hooks/init-transition.sh - Hook that creates hourly progress files
  2. Updates .claude/settings.json - Adds UserPromptSubmit hook
  3. Updates CLAUDE.md - Adds progress tracking instructions

Implementation

# Check we're in a project with .claude directory
if [ ! -d ".claude" ]; then
    echo "❌ No .claude directory found. Run /setup:existing first."
    exit 1
fi

echo "🔄 Adding session progress tracking..."
echo ""

# Create hooks directory
mkdir -p .claude/hooks

# Create the transition hook
cat > .claude/hooks/init-transition.sh << 'HOOK_EOF'
#!/bin/bash
# Initialize hourly transition file for session progress tracking
# This hook runs on UserPromptSubmit to ensure the hourly file exists
# Format: .claude/transitions/YYYY-MM-DD/HH.md (e.g., 19.md for 7pm hour)

set -e

# Get project root (where .claude/ directory is)
PROJECT_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || pwd)"
TRANSITIONS_DIR="$PROJECT_ROOT/.claude/transitions"
TODAY=$(date +%Y-%m-%d)
HOUR=$(date +%H)
TODAY_DIR="$TRANSITIONS_DIR/$TODAY"
HOURLY_FILE="$TODAY_DIR/${HOUR}.md"

# Create today's transition directory if it doesn't exist
mkdir -p "$TODAY_DIR"

# Initialize hourly file if it doesn't exist
if [ ! -f "$HOURLY_FILE" ]; then
    cat > "$HOURLY_FILE" << EOF
# Session Progress: $TODAY ${HOUR}:00

---

EOF
fi

# Exit silently (hook output not visible to Claude anyway)
exit 0
HOOK_EOF

chmod +x .claude/hooks/init-transition.sh
echo "✅ Created .claude/hooks/init-transition.sh"

Now update settings.json to add the hook:

# Get absolute path to hook
HOOK_PATH="$(pwd)/.claude/hooks/init-transition.sh"

# Check if settings.json exists
if [ ! -f ".claude/settings.json" ]; then
    echo "❌ No .claude/settings.json found. Run /setup:existing first."
    exit 1
fi

echo "📝 Updating .claude/settings.json..."

I'll update the settings.json to add the UserPromptSubmit hook configuration. Let me read the current settings and merge the hook configuration.

Read the full file on GitHub · 163 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 · 163 lines · 18 tokens per session scan B 65767c8e8fb6

Subscribe to this mod's changes

setup:transitions is a command published in the GitHub repository stefan-jansen/claude-code-toolkit (85 stars, last pushed 1mo ago), licensed MIT. It adds 18 tokens to every session and 1,093 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B 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-30.