cdd-pre-pr

cdd-pre-pr is a command for Claude Code from drabaioli/cdd. It costs 0 tokens per session (4,098 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

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/drabaioli/cdd/cdd-pre-pr
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.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.svg" alt="Measured on agentmods" 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 4,098 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00000 $0.04098
Opus 5 $0.00000 $0.02049
Sonnet 5 $0.00000 $0.00820
Haiku 4.5 $0.00000 $0.00410

Measured 3d ago against content hash e191f2985262, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

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 · 203 lines

How it starts

The opening of the file, as written. The whole thing — 203 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)
BASE_BRANCH=${BASE_BRANCH:-$(git symbolic-ref --quiet --short refs/remotes/origin/HEAD 2>/dev/null || echo main)}

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

1. Identify changes

git diff "$BASE_BRANCH"...HEAD --name-only
git status --porcelain

Capture the list of changed files. Use it as the scope for steps 3 and 4.

Also record the git status --porcelain output as the entry snapshot. The tree should be clean here (the implementation session commits its own work). If it is already dirty, those are changes this session did not create — note them now; step 10 must not sweep them into the auto-commit.

2. Build & QA

Run the project's check runner — the single command that runs every gate, the same one CI invokes. Because it is the same command, a green run here means CI will be green too. Capture only the last 40 lines + exit code, do not read the full output.

<check runner command>   2>&1 | tail -40; echo "EXIT:${PIPESTATUS[0]}"

Report each gate as pass ✓ / fail ✗ / skipped ⊘ from the runner's summary. On failure, include the captured tail. A skipped gate is not a pass: say which gate was skipped and why (usually a tool missing on this host), so the reader knows the local verdict is weaker than CI's.

Read the full file on GitHub · 203 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 · 203 lines · 0 tokens per session scan A e191f2985262

Subscribe to this mod's changes

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