cdd-merge-base

cdd-merge-base is a command for Claude Code from drabaioli/cdd. It costs 0 tokens per session (2,070 once invoked), scanned A, original, MIT.

A command that brings the latest code from the base branch into your feature branch. The base branch is the branch a feature branch will eventually merge into, often called main.

In plain words
What is it for?
Use it when the base branch has moved forward and your work needs to include its latest changes before a pull request is opened or merged.
Why use it?
It checks for merge conflicts before changing your branch, then performs the merge and helps resolve conflicts when needed.

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-merge-base
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-merge-base

README.md
[![agentmods](https://agentmods.dev/badge/commands/drabaioli/cdd/cdd-merge-base.svg)](https://agentmods.dev/commands/drabaioli/cdd/cdd-merge-base)
Your own site
<a href="https://agentmods.dev/commands/drabaioli/cdd/cdd-merge-base"><img src="https://agentmods.dev/badge/commands/drabaioli/cdd/cdd-merge-base.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 2,070 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.1 $0.00000 $0.02070
Opus 5 $0.00000 $0.01035
Sonnet 5 $0.00000 $0.00414
Haiku 4.5 $0.00000 $0.00207

Measured 5d ago against content hash 385d304a80a9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-05, from the pricing page.

Security

Grade A, and why

cdd-merge-base 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 5d 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-merge-base.md · 202 lines

How it starts

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

Integrate the current state of the base branch into the feature branch. Two phases: a dry-run conflict assessment first, then the actual merge with conflict resolution. The approval between the two phases is conditional — the merge runs automatically when the dry run proves the case mechanically trivial (step 4), and stops for approval otherwise.

Run this command on the feature branch (not on the base branch). Use it when:

  • The base branch has advanced under your feature branch and you want to integrate before opening or merging the PR.
  • Something useful has landed on the base branch (a new utility, a refactor, an updated convention) that this branch should pick up without a separate roadmap task.

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. When no base was recorded (every single-integration-branch project), it falls back to the hosting platform's default branch, so behaviour is unchanged there. Use $BASE_BRANCH everywhere main/origin/main appeared in earlier versions of this command. All git commands below use this variable.

1. Sanity check

Confirm the current branch is not the base branch:

git rev-parse --abbrev-ref HEAD

Confirm the worktree is clean:

git status --porcelain

If there are uncommitted changes, stop and ask the user whether to stash or commit before continuing. Do not merge over uncommitted work.

2. Update local base branch reference

git fetch origin "$BASE_BRANCH"

Determine how far the branch has diverged from origin/$BASE_BRANCH:

git log --oneline "HEAD..origin/$BASE_BRANCH" | head -50
git log --oneline "origin/$BASE_BRANCH..HEAD" | head -50

Report:

  • Number of commits on origin/$BASE_BRANCH not in this branch.
  • Number of commits on this branch not in origin/$BASE_BRANCH.

Read the full file on GitHub · 202 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. 5d ago First seen · 202 lines · 0 tokens per session scan A 385d304a80a9

Subscribe to this mod's changes

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