# Agentgates for Claude Code

```
npx -y @agentgates/claude-code@latest
```

Adds the Agentgates models to Claude Code's `/model`: confidential models
running in attested hardware, and the open tier, each turn metered on your
prepaid balance. Claude's own models keep working in the same session on your
own subscription.

You need `node` 18 or newer, Claude Code, and an inference key: top up and
mint one at https://agentgates.ai/inference (API keys). The installer asks
for the key, or takes it from the line:

```
AGENTGATES_INFERENCE_KEY=ag_... npx -y @agentgates/claude-code@latest
```

## What it does

1. Checks that the bridge inside this package is the file the Agentgates
   release key signed. If it is not, nothing is installed.
2. Copies the bridge to `~/.agentgates/claude-bridge.mjs` and stores your key
   in `~/.agentgates/inference-key` (mode 600).
3. Runs the bridge once (`node claude-bridge.mjs --install`). The bridge
   writes its small scripts beside itself, the model rows and the wiring in
   `~/.claude/settings.json` (merged into what is there) and two helper
   agents in `~/.claude/agents`, then starts its keeper.

After it, a plain `claude` from any terminal has the rows. In `/model`, the
row `Models and account` switches accounts and adds or removes rows; `ag list`
typed at any model lists every model with its prices.

## Updates

The bridge never replaces itself. When a newer version is out, the `Models
and account` row and the footer say so, with what changed. Typing `ag update`
installs it, and only a file the release key signed: the key's private half
is in hardware and on no server, so no site serving a file can put it on your
machine. `ag version` says which bridge you run.

## The other install line

`curl -fsSL https://agentgates.ai/claude-code | sh` installs the same bridge.
It trusts whatever that site serves at that minute; this package does not.
