# Audit logging in a Claude Code project

One command gives Claude Code the signafAIde MCP server and a short skill. Ask it to record the tools of the agent you are building: it adds the SDK, wraps the tools that act and checks the records.

Other coding agents and every file the command writes: [Coding agents](/docs/coding-agents). The steps Claude follows: [quickstart](/docs/quickstart). What recording covers and where it stops: [Tool coverage](/docs/coverage).

## The change

Run the command in the project. It creates `.mcp.json`, the skill in `.claude/skills/signafaide/SKILL.md` and a section in `CLAUDE.md`. It merges into files that exist, and a second run changes nothing. The Claude Code plugin, in the `plugin/` folder of the SDK repository, packages the same MCP server and skill.

```bash
npx signafaide agent setup --agent claude-code
```

**.mcp.json**

```json
{
  "mcpServers": {
    "signafaide": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "signafaide-mcp@0.3.2"
      ],
      "env": {}
    }
  }
}
```

## A verify run

This is what `signafaide_verify` returned in a project whose agent has three wrapped tools, before anything was sent. `npx signafaide verify` prints the same lines.

```text
local state: /home/dev/claims-agent/.signafaide
 1. Envelope schema              PASS         10 records
 2. Record hashes                NOT CHECKED  0 records; 10 not yet shipped (no receipt); nothing co-signed yet
 3. Client signatures            PASS         10 records
 4. Agent chains                 PASS         10 records
 5. Merkle proofs                NOT CHECKED  0 records; nothing co-signed yet
 6. Batch hashes and signatures  NOT CHECKED  0 batches; nothing co-signed yet
 7. Batch chain                  NOT CHECKED  0 batches; nothing co-signed yet
 8. Signed heads                 NOT CHECKED  0 heads; nothing co-signed yet
 9. drand rounds                 NOT CHECKED  0 rounds
10. Anchors                      NOT CHECKED  0 anchors; local state holds no anchors
11. OpenTimestamps               NOT CHECKED  0 proofs
12. Content hashes               PASS         10 records
coverage: _pending/nokey/claims-bot: all 3 declared tools are recorded
checked here: signatures, chain links and content hashes of all 10 records, using this machine's keys
co-signature, public timestamp: not yet. Run `signafaide init` to send hashes, or self-host (SIGNAFAIDE_URL)
PASS: 4 of 12 checks passed, 8 not checked (nothing co-signed yet)
```

## What Claude does, and what is sent

- **Previews.** `signafaide_setup` reads the project and returns the install command, the code edit and what a sandbox would send. It changes, creates and sends nothing.
- **Wraps and declares.** Following the skill, Claude installs the SDK, wraps the tools that act under an explicit agent name, starts the agent's MCP servers through the gateway and declares the full tool list.
- **Verifies.** It runs the agent once and calls `signafaide_verify`, which returns one line per check and then PASS or FAIL.
- **Nothing is sent until you opt in.** Records are signed and chained in `.signafaide/` on your machine. The skill tells Claude not to run `signafaide init` itself, and `signafaide_init` creates nothing unless it is called with `confirm_user_agreed: true` and `user_words`, what you wrote when you agreed.
- **Then only hashes.** After `signafaide init`, each record sends its salted content hash with the tool name, the agent name and the time. Inputs and outputs stay on your machine unless you turn on stored content.
- **Not recorded.** This records the tool calls of the agent you are building, not what Claude Code itself does in your repository. A tool Claude did not wrap leaves no record, and the coverage line names it. Records are evidence, not certification.

Next: the other coding agents, the files written and the MCP tools. [Coding agents](/docs/coding-agents)
