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.
curl -O https://raw.githubusercontent.com/drabaioli/cdd/main/.claude/commands/cdd-merge-base.mdgit clone --depth 1 https://github.com/drabaioli/cddWrote 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.
[](https://agentmods.dev/commands/drabaioli/cdd/cdd-merge-base)<a href="https://agentmods.dev/commands/drabaioli/cdd/cdd-merge-base"><img src="https://agentmods.dev/badge/commands/drabaioli/cdd/cdd-merge-base/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.
<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="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.02344 |
| Opus 5.5 | $0.00000 | $0.00938 |
| Sonnet 5.5 | $0.00000 | $0.00469 |
| Haiku 4.5 | $0.00000 | $0.00234 |
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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 216 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)
# 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. When no base was recorded (every single-integration-branch project), it falls back to the code host's default branch — through the code-host adapter when one is installed, else from git — 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.
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.
- 1mo ago Changed · +14 lines f22f408da992
- 2mo ago First seen · 202 lines · 0 tokens per session scan A 385d304a80a9
cdd-merge-base 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 2,344 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.
Other commands, from other repositories
icpg-bootstrap
Infer ReasonNodes from existing git commit history. One-time setup for existing codebases.
pull-repos
Pull all repos (parent + marketplace clones + configured project repos).
worktree
Create a git worktree for isolated feature/fix work.
resume-project
Run resume-project now — Now / Blocked / Next. Not a cheat sheet.
session-report
Capture what changed this session and why, scoped to the current branch. Read by ship verbs when synthesizing the commit message; deleted after a successful commit.
commit
Stage, commit, and optionally ship further. Pass an escalation token (push, pr, merge, squash, squash merge) to skip the prompt. With no token, commits then asks how far to ship. Delegates message format to the atomic-git-discipline skill.