cdd: Command for Claude Code

.claude/commands/cdd-pre-pr.md

cdd-pre-pr is a command for Claude Code from drabaioli/cdd. It costs 0 tokens per session (5,936 once invoked), scanned A, original, MIT.

A pre-pull-request check for the current Git branch. A pull request is a proposed change submitted for review before it is added to the main codebase.

In plain words
What is it for?
Use it before opening or merging a pull request to catch failing checks, overlooked changes, and outdated documentation.
Why use it?
It gathers all branch changes, runs the project's checks, reviews the code differences, and checks whether the documentation still matches the code.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: reads .claude/ paths; mentions CLAUDE.md.

This is drabaioli/cdd's own configuration. It tells Claude Code how to work on cdd 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 cdd configures →

Reuse

Borrowing it

Nothing to install: this file belongs to drabaioli/cdd. 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/drabaioli/cdd/main/.claude/commands/cdd-pre-pr.md
Clone the repo
git clone --depth 1 https://github.com/drabaioli/cdd

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 cdd-pre-pr

README.md
[![agentmods](https://agentmods.dev/badge/commands/drabaioli/cdd/cdd-pre-pr/github.svg)](https://agentmods.dev/commands/drabaioli/cdd/cdd-pre-pr)
Your own site
<a href="https://agentmods.dev/commands/drabaioli/cdd/cdd-pre-pr"><img src="https://agentmods.dev/badge/commands/drabaioli/cdd/cdd-pre-pr/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 cdd-pre-pr

Your own site · 80×15
<a href="https://agentmods.dev/commands/drabaioli/cdd/cdd-pre-pr"><img src="https://agentmods.dev/badge/commands/drabaioli/cdd/cdd-pre-pr.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 5,936 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.00000 $0.05936
Opus 5.5 $0.00000 $0.02374
Sonnet 5.5 $0.00000 $0.01187
Haiku 4.5 $0.00000 $0.00594

Measured 6d ago against content hash 9384686d4e4c, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cdd-pre-pr 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 6d 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.

.claude/commands/cdd-pre-pr.md · 257 lines

How it starts

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

Run a pre-PR checklist for the current branch. Compare against the base branch to identify all changes. This is a verification session: it runs CI gates, code-reviews the diff, and reconciles documentation against the changes.

This session is fresh and separate from the implementation session by design, so that the verification work is not biased by the context that produced the change. Any "propose to the user" step in this command is a proposal to the user running this session.

0. Resolve the base branch

BASE_BRANCH=$(cdd-state get base_branch 2>/dev/null)
# With no base recorded, look for a code-host adapter: project, then machine; the first file present wins.
[ -z "$BASE_BRANCH" ] && for c in .cdd/code-host ~/.cdd/adapters/code-host; do [ -e "$c" ] && { CODE_HOST="$c"; break; }; done

If $CODE_HOST is set, check it before using it: the file is executable, and "$CODE_HOST" describe exits 0, parses as JSON, and reports capability code-host and contract 1. If any of that fails, the adapter is installed but broken — say so in one line naming its path, and stop; do not fall back to git, because an installed adapter declares which code host this project uses. If it is usable, say in one line which adapter serves, then take its answer:

BASE_BRANCH=$("$CODE_HOST" default-branch | jq -r '.branch // empty')   # exit 3 (unsupported) or a failure leaves it empty

Whatever is still empty falls back to git, as a bare branch name:

BASE_BRANCH=${BASE_BRANCH:-$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null | sed 's#^origin/##')}
BASE_BRANCH=${BASE_BRANCH:-main}

This reads the task's recorded base branch — the branch it was cut from and merges back into — and falls back to the code host's default branch when none was recorded — through the code-host adapter when one is installed, else from git (unchanged behaviour for single-integration-branch projects). Use $BASE_BRANCH wherever main/origin/main appears in git commands below.

Read the full file on GitHub · 257 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. 6d ago Changed 9384686d4e4c
  2. 24d ago Changed 0f363ab0faa9
  3. 25d ago Changed 8e62b34f3fe2
  4. 27d ago Changed 61cc0976c859
  5. 28d ago Changed · -9 lines 01db0de94d14
  6. 29d ago Changed cb0d14a00be8
  7. 1mo ago Changed eb924aae3ac2
  8. 1mo ago Changed · +12 lines 3373bfcfc1be
  9. 1mo ago Changed · +16 lines 52f207533ee2
  10. 1mo ago First seen · 238 lines · 0 tokens per session scan A eeac794c8965

Subscribe to this mod's changes

cdd-pre-pr is a command published in the GitHub repository drabaioli/cdd (2 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 5,936 tokens. 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.