> ## Documentation Index
> Fetch the complete documentation index at: https://docs.openmail.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code

> Give your Claude Code agent a real email address. Install the OpenMail CLI, create an inbox, and add the openmail skill so Claude Code can send, read, and reply.

Claude Code uses the OpenMail CLI directly. Prefer no install? Use the [MCP server](https://docs.openmail.sh/integrations/mcp.md) instead. The `openmail` skill in the [skills repo](https://github.com/openmailsh/skills/blob/main/skills/openmail/SKILL.md) teaches it the commands. The same setup works for Cursor and Codex.

## Get started

**1. Install the CLI**

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
npm install -g @openmail/cli
export OPENMAIL_API_KEY=om_...
```

Requires Node.js 20+. Get the key from the [console](https://console.openmail.sh/api-keys).

**2. Create an inbox**

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
openmail init --mailbox-name my-agent --display-name "My agent"
```

Creates the inbox and saves it as the default in `~/.openmail-cli/state.json`, so `send`, `threads`, and `messages` work without `--inbox-id`.

**3. Install the skill**

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
npx skills add openmailsh/skills
```

Or copy `skills/openmail/SKILL.md` from the [skills repo](https://github.com/openmailsh/skills) into `~/.claude/skills/openmail/`. For Cursor or Codex, use that agent's skills directory.

**4. Verify**

Ask Claude Code to send a test email. It runs `openmail send` and returns the `threadId`.

## Narrow the key

`OPENMAIL_API_KEY` is whatever you export. An account-wide key reaches every inbox, so once the inbox exists, swap in an inbox-scoped key:

```bash theme={"theme":{"light":"github-light","dark":"dark-plus"}}
openmail inbox keys create --inbox-id <inbox-id> --name claude-code --json
```

Run this from your own shell, not the agent's. Why and how to rotate: [Agent keys](https://docs.openmail.sh/best-practices/api-key-scopes.md).

## What the skill covers

* Sending and replying in-thread with `openmail send`
* Checking for new mail with `openmail threads list --is-read false`
* Reading attachments as text with `openmail attachments text`
* Inbound and outbound policy with `openmail policy`
* Treating email bodies as untrusted data

Inbound mail does not wake Claude Code on its own. The skill polls with `threads list` when you ask it to wait for a reply. For push delivery, use [WebSockets](https://docs.openmail.sh/concepts/websockets.md) or [webhooks](https://docs.openmail.sh/guides/webhooks.md) from your own code.

## Related

* [Quickstart](https://docs.openmail.sh/quickstart.md): Claude Code tab with copy-paste steps
* [OpenClaw](https://docs.openmail.sh/integrations/openclaw.md) and [Hermes Agent](https://docs.openmail.sh/integrations/hermes.md): native plugins with inbound delivery
* [API integration](https://docs.openmail.sh/guides/api-integration.md): multi-tenant or non-CLI setups


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.