Skip to main content
The Claude Code /plan hook automatically creates a Ref Plan when you exit plan mode in Claude Code. Your plan opens in the browser, ready to share, refine, and send to agents.

Install

Run the install script:
curl -fsSL https://api.plan.ref.tools/plugins/install/ref-plan-hook | bash

Configuration

The hook authenticates with your Ref API key. You can configure it in two ways: Environment variable:
export REF_API_KEY=your-api-key
Config file (~/.ref/config.json):
{
  "apiKey": "your-api-key"
}
You can find your API key at ref.tools/keys.

How it works

  1. You enter /plan mode in Claude Code as usual
  2. When you exit plan mode, the hook fires
  3. A new Ref Plan is created with your plan content
  4. The plan opens in your default browser
Note: If you are at the limit number of plans for your tier, the hook will fail silently.