/const-change-cost:share-costsfrom const-change-cost
Load this skill first, before a pull request is opened or merged in a clone where const-change-cost counts commits — every time, whether or not the cost seems wanted. It shares what each commit cost: the block of cost-report.sh --pr in the pull request's description, the lines of cost-report.sh --trailer in the merge commit's message, and git notes only on the person's word. Use when asked what a branch or a commit cost, when the session-start line says this clone logs no commit, or when a cost reads short. Advisory: it shapes what is shared and when; no gate holds it, and the module's commands make every figure.
Ships in const-change-cost. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Claude Code writes the tokens of every reply into the session's transcript. This plugin logs each session's start and each commit as they happen. It counts the tokens of each commit's window with a pinned ccusage. It keeps one line of counts per commit in the clone's git common directory. Nothing leaves the clone by itself. A count reaches the team only when a person starts it. The person starts it by running a command, or by asking a session to open a pull request or to make a merge. This skill is how a session does that at those two moments. A hook never starts it.
The report reads the file of counts. It runs no ccusage and reads no transcript, so it is quick and
safe to run. Its range is the commits of the change, such as main..HEAD or <base>..<branch>.
The start line of this plugin appears at session start while git's configuration lacks one of its two hooks of the commit log. Commits made before the hooks stand are never logged, and never counted.
Tell the person, once, in plain words: this clone logs no commit, so its commits get no count.
Tell them that setup-commit-log.sh writes the two hooks. Tell them also that git's configuration
changes only at a person's word: a person runs the script, or a session when the person asks.
Run the setup only when the person asks for it:
sh "${CLAUDE_PLUGIN_ROOT}/scripts/setup-commit-log.sh"
sh "${CLAUDE_PLUGIN_ROOT}/scripts/setup-commit-log.sh" --check
The check prints whether both hooks stand. Never write the keys with git config by hand.
When the person says this clone should not log commits, leave it, and do not raise it again in the session. When no person watches the session, say it in the final reply; a missing person is not a yes.
setup-commit-log.sh --remove takes the two hooks out again. The logs and the counts stay.
When the person asks you to open a pull request, run the report for the change and put its block in the description:
sh "${CLAUDE_PLUGIN_ROOT}/scripts/cost-report.sh" --pr <base>..<branch>
Where gh finds the pull request of the range's head, the block is written into its description,
between its two markers. The head is the branch the range ends at. Where the pull request is found, a
second run replaces the block and keeps the rest. Where there is no pull request yet, no gh, or a gh that fails, the block is
printed with a note that says which. In that case, put the block in the description you give to the
forge, for example with gh pr create --body-file. Never type a cost by hand.
When the person asks you to make the merge, or says yes to it:
Run --pr <base>..<branch> again, so the block holds every commit made since it was written.
Make the trailer lines:
sh "${CLAUDE_PLUGIN_ROOT}/scripts/cost-report.sh" --trailer <base>..<branch>
They are one Change-Cost-Commit: line for each counted commit, then one Change-Cost: line with
the total. Print them even when some commits are not counted: the total line says how many were.
Put the lines in the last paragraph of the merge commit's message, where every line is
Key: value. A merge you make yourself:
git merge --no-ff <branch> -m "<subject>" -m "$(sh "${CLAUDE_PLUGIN_ROOT}/scripts/cost-report.sh" --trailer <base>..<branch>)"
A merge on the forge's page has no local hook to see it. For such a merge, give the person the lines to paste into the merge message, as its last paragraph.
When the person asks to share each commit's count with the team:
sh "${CLAUDE_PLUGIN_ROOT}/scripts/cost-report.sh" --notes <base>..<branch>
It writes one note under refs/notes/change-cost for each counted commit. Then name the push
command, git push <remote> refs/notes/change-cost, and run it only when the person says so. A pushed
ref publishes every count and cost, and in a public repository that is public. A person who asked only
for the pull request's block gets the block alone. A plain push sends no notes ref. A rebase leaves the
notes on the old commits unless notes.rewriteRef names their ref; say so before a rebase.
The report names each one, with the reason. Say what the line says; do not guess a count.
sh "${CLAUDE_PLUGIN_ROOT}/scripts/count-costs.sh" --all, which counts it or names what stops it.Share the report with the names in it. Do not hold the trailers back until every commit is counted.
It changes nothing in git's configuration unasked, pushes nothing unasked, and holds no gate: no check makes a merge fail for a missing trailer. The figures come from the commands alone.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub evgenus/claude-constitution-layer-kit --plugin const-change-cost