Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Installing claims in a consuming project

claims is a Claude Code plugin installed straight from this repository’s git URL. There is no central marketplace listing to go through, because the repository carries its own: a .claude-plugin/marketplace.json that names itself as a marketplace called claims, listing a single plugin, also called claims, whose source is the repository root. A consuming project registers the git URL as a marketplace and installs from it.

Install

From inside the consuming project:

claude plugin marketplace add https://github.com/or1can/claims.git --scope project
claude plugin install claims@claims --scope project

The first command registers this repository as a marketplace named claims, the name its own listing declares. The second installs the plugin that listing holds, also named claims, hence claims@claims. That single install gives the project the check-claims skill, the judgment-agent subagent the skill invokes, and a reminder when the commit gate is not installed.

The commit gate itself is a git pre-commit hook, installed separately as the next section describes, so it gates every commit, not only those Claude Code makes. It gates a commit only in a repository with a claims.toml at its root, and an empty one is enough. Create it to turn the gate on:

touch claims.toml

Without it the hook does nothing, so a repository that has not adopted claims is not gated.

When a Claude Code session starts in a repository with a root claims.toml, or moves into one, and no installed hook there runs claims, the plugin says so: the agent is told the gate is not active, and a one-line message tells you the same. Not every host shows that message, Zed among them, so the agent is also asked to tell you once; in a terminal you may hear it twice. It counts the hook as installed when claims appears in a file in the repository’s git hooks directory, core.hooksPath included, or when that directory holds a pre-commit hook and claims appears in .pre-commit-config.yaml, lefthook’s configuration under any of the names lefthook reads, or .husky/pre-commit. A configuration committed without pre-commit install or its equivalent having been run is not a hook, so a fresh clone is reminded. After a change of directory the reminder comes with your next prompt, and each repository is mentioned once per session after the session starts. A repository with [hook] enabled = false is not reminded, and nor is a clone where you have chosen not to install the hook and said so in its claims.local.toml, as Silencing the reminder in one clone describes. The reminder never blocks anything.

--scope project writes both declarations into the project’s own .claude/settings.json, so the dependency is explicit and travels with the repository, and a second developer cloning it is offered the same install. Both commands default to user scope, this machine’s global config, when the flag is omitted. That is fine for a quick personal try.

Whichever scope is used, the marketplace registry itself is machine-wide and keyed by name, and the CLI has no way to register a marketplace under a name its listing does not declare. A later claude plugin marketplace add of a different source also named claims, from any project at any scope, replaces the source for each project on that machine. A checkout of this repository registered as a directory marketplace for its own development is the common way to hit that.

Verify with:

claude plugin details claims@claims
claims 0.16.0
  Description: Checks documentation and agent-instruction claims against the code they describe.
  Source: claims@claims

Component inventory
  Skills (1)  check-claims
  Agents (0)
  Hooks (3)  SessionStart, UserPromptSubmit, CwdChanged  (harness-only — no model context cost)
  MCP servers (0)
  LSP servers (0)

Projected token cost
  Always-on:   ~96 tok   added to every session

Per-component (rounded)
  component     always-on  on-invoke
  check-claims       ~100      ~3.6k

  On-invoke cost is paid each time a skill or agent fires.
  Token counts are estimates and may differ from actual usage.

Captured from claude plugin details claims@claims in a throwaway project, as the next command after the install commands above.

The three hooks are the reminder described above. The inventory counts no agent, though the plugin manifest declares one. The judgment-agent subagent loads all the same, as claims:judgment-agent, and the check-claims skill invokes it once per candidate.

Pinned at install, explicit update. The install records the commit it resolved, and the plugin keeps running that commit until the project updates it. That is deliberate for a plugin that gates commits: an upstream change to this repository does not start deciding a project’s commits differently until someone chose to pull it in. To update:

claude plugin update claims@claims --scope project
Checking for updates for plugin "claims@claims" at project scope…
✔ claims is already at the latest version (0.16.0).

Captured from the same throwaway project, straight after the install, so there was nothing newer to fetch. The shorter claude plugin update claims finds the same project-scoped install.

The git pre-commit hook

The commit gate is a git pre-commit hook, so git runs it on every commit to the repository, whether Claude Code, a person in a terminal or any other tool makes it, and in whichever repository the commit lands. For each commit:

  • no root claims.toml, or [hook] enabled = false in it: nothing runs, and the commit goes ahead;
  • a check switched off with its own enabled = false is left out;
  • a gate finding, a claims.toml that does not parse, or no check registered at all: the findings or the reason are printed, and the commit is blocked;
  • an unmarked finding from a check listed under [hook] fail_on_unmarked: the findings are printed, and the commit is blocked;
  • any other advisory findings: they are printed, and the commit goes ahead.

An error inside claims itself prints a warning and lets the commit go ahead, so a broken install does not block every commit.

The hook is a Python package with no third-party dependency, and needs Python 3.11 or later. Its command is claims-pre-commit, which takes no arguments and runs in the repository git calls it from. Each release is tagged v<version> in this repository, and every setup below pins one.

pre-commit and uvx each run the hook in an environment of their own, put first on PATH, and a command granted in claims.local.toml runs exactly as written, with that PATH. A bare python3 in a granted command is then the hook’s own Python, without the project’s dependencies. A command that needs the project’s environment names it, as executable-claims describes, and then runs the same under any hook and on the command line.

pre-commit

With pre-commit, add the hook to the project’s .pre-commit-config.yaml:

repos:
  - repo: https://github.com/or1can/claims
    rev: <tag>
    hooks:
      - id: claims

Then pre-commit install, as for any other hook. pre-commit builds its own environment for the hook, so nothing else needs installing. The hook is verbose, so its advisory findings are shown on a commit it lets through; pre-commit hides a passing hook’s output otherwise.

lefthook, husky, or a plain git hook

The other setups run the command through uvx, which fetches the tagged release into a cached environment of its own. With lefthook, in lefthook.yml:

pre-commit:
  commands:
    claims:
      run: uvx --from git+https://github.com/or1can/claims@<tag> claims-pre-commit

With husky, in .husky/pre-commit:

uvx --from git+https://github.com/or1can/claims@<tag> claims-pre-commit

As a plain git hook, in .git/hooks/pre-commit, made executable:

#!/bin/sh
exec uvx --from git+https://github.com/or1can/claims@<tag> claims-pre-commit

pip install git+https://github.com/or1can/claims@<tag> installs the same claims-pre-commit command, for a setup that calls it from an existing environment instead.

Skipping the hook

git commit --no-verify skips every git pre-commit hook, this one included. To stop Claude Code from using it, add a deny rule to the project’s .claude/settings.json:

{
  "permissions": {
    "deny": ["Bash(git commit *--no-verify*)"]
  }
}

The rule matches the flag anywhere after git commit. It does not match the short form -n, or a commit made any way other than a plain git commit command, so it stops the obvious route rather than every one.

The command line

The same checks are also a plain command line, python3 -m claims.cli, for a CI step or a one-off run:

python3 -m claims.cli --repo-root <path> --diff-range <range>

--repo-root defaults to the current directory and --diff-range to HEAD, the working tree against the last commit. The command prints each finding, then a summary line of the form N checked, M finding(s), G gate failure(s), and exits with the code below. When checked marks kept findings quiet, the summary line adds , Q quiet while checked (then , P of them partly when partial marks kept some of them quiet), and when the range added checked marks it adds , A mark(s) added in range. Findings that cite the same line with the same message and the same severity print as one line, with every mode that reported them in its parentheses; M still counts each one. The commit hook prints its findings the same way.

The exit code is:

  • 0 when no finding is a gate finding, advisory findings included, apart from the case 3 names;
  • 1 on a gate finding, or when no check at all is registered, which is reported as a failure and not as a clean pass;
  • 2 when claims.toml exists and does not parse, or an option is misused;
  • 3 under --fail-on-unmarked, when no finding is a gate finding but an advisory finding no checked mark keeps quiet is in scope, as Checked marks describes.

The commit hook and the CLI differ in two respects. The hook runs only in a repository with a root claims.toml, and the CLI runs anywhere, with every check on its defaults where the file is missing. The hook also honours the switches that take a check, or the gate as a whole, out of the commit-time decision, and the CLI ignores both, so a check silenced at commit time is still reported here. Those switches are on Configuring claims.

The CLI runs from a checkout of this repository, pointed at with PYTHONPATH:

# a CI job step, e.g. GitHub Actions
- uses: actions/checkout@v7
  with:
    repository: or1can/claims
    ref: <tag>
    path: claims
- run: PYTHONPATH=claims python3 -m claims.cli --repo-root .

What differs from the full Claude Code experience. Outside Claude Code, through either the git hook or the CLI, each mechanical check runs as it does at commit time, with the same gate and advisory split. What needs a model to interpret what the mechanical half sets up does not happen here:

  • judgment-agent’s candidates stay candidates. The check computes which claims cite a subject the diff added or removed and reports each as an advisory finding. The verdict on each is a separate step, the claims:judgment-agent subagent, which the check-claims skill invokes and neither the git hook nor the CLI does. Run this way, the candidate lines are printed and left, to read against the cited code yourself; see judgment-agent.
  • The skill’s on-demand claims.toml review does not run. Whether a project’s own configuration is doing anything, a stale exclude glob matching no file, say, is reasoned prose the check-claims skill produces on request. It is not a finding, was not part of the CLI’s output to begin with, and nothing here replaces it.

claims.toml

At the consuming project’s repository root, and required for the commit hook: without it the hook runs no check. An empty file opts in with each check on its own defaults, so there is nothing more to configure to get started. The check-claims skill and the CLI run with or without it. Each top-level table is a single check’s own configuration section, named for the check.

A check’s own keys are documented with that check. The settings no single check owns, switching the commit gate off, silencing a check at commit time, and the git-ignored claims.local.toml that governs what a check may execute, are on Configuring claims.

Next

Tutorial: documenting a release has you commit a wrong doc in a practice project, have the real commit hook refuse it, fix it, and have the push refused on the advisory finding nobody has marked as read, then mark it checked and push again.