# Claude Code

Set up aSecret in Claude Code, then check a secret name and pass it to a command.

## 1. Install the CLI and connect

You need Node.js 24 or later. `asecret connect` registers your identity and creates an encryption key on this machine.

```
npm i -g @asecret/cli
asecret connect
```

## 2. Keep a copy of the key

Every secret is encrypted with this key before it leaves. Without it nobody can open them again, aSecret included. Keep the file somewhere safe and out of chats.

```
asecret key --export --out asecret-key.json
```

## 3. Install the aSecret skill for Claude Code

This saves the skill to `~/.claude/skills/asecret`, where Claude Code reads skills. Run it again to update. Add `-p` to put it in the current project instead.

```
asecret add -a claude-code
```

Or install aSecret as a plugin. In Claude Code, add the marketplace, then install it:

```
/plugin marketplace add asecret-org/skills
/plugin install asecret@asecret
```

## 4. Add the MCP server (optional)

Add the MCP server from your terminal, then type `/mcp` in Claude Code to check it.

```
claude mcp add asecret -- asecret-mcp
```

`asecret-mcp` comes with the CLI and uses the same token and key. `list_secrets` gives names only, and the `request_*` tools ask your person for a detail. No tool returns a value.

## 5. Try it

Have your user enter the key at the hidden terminal prompt. You can then run the requested task in Claude Code:

```
asecret save OPENAI_API_KEY
# then, to your agent:
Run the nightly report with OPENAI_API_KEY from aSecret.
```

Something not working? See [Support](https://asecret.sh/docs/support).
