| name | setup |
| description | Set up Promptbook — connect your account to start tracking builds.
Use when the user wants to enable session analytics on promptbook.gg.
Trigger with "/setup" or "set up promptbook".
|
| version | 1.4.0 |
| author | Promptbook <contact@promptbook.gg> |
| license | MIT |
| allowed-tools | Bash(curl:*), Bash(open:*), Bash(xdg-open:*), Bash(mkdir:*), Bash(cat:*), Bash(chmod:*), Bash(node:*), Bash(nohup:*), Bash(find:*), Bash(wc:*), Read |
| tags | ["analytics","telemetry","setup","onboarding"] |
| compatibility | Designed for Claude Code |
Promptbook Setup
Overview
Connect a Promptbook account using the device-code OAuth flow. After consent, the plugin tracks session metrics (prompts, tokens, build time, lines changed) and publishes shareable build cards on promptbook.gg.
Prerequisites
- Internet access (calls promptbook.gg API)
- A browser for the sign-in step
- Node.js installed (used by hook scripts)
Privacy Note
What IS sent to promptbook.gg: session ID, project name, model, timestamps, prompt count, token counts, build time, lines changed, language, file extension counts, and tool usage counts.
What is NEVER sent: source code, prompt content, file contents, file paths, or working directory.
To generate a title and summary for each build, the plugin calls Claude Haiku via the user's own Claude credentials — this data goes to Anthropic (same as normal Claude Code usage), never to Promptbook.
The plugin stays inactive until setup writes consent into ~/.promptbook/config.json. Continuing with setup means the user consents to this data collection. After each session ends, a short background process may continue briefly to submit stats and generate the title/summary.
Instructions
Run all commands via Bash — the user just waits for the browser sign-in.
1. Create a setup session
curl -sL -X POST "https://promptbook.gg/api/auth/setup-session"
Parse the JSON response to extract three values: token, device_code, and setup_url.
2. Open the browser
Use the setup_url value from step 1:
open "<setup_url value>"
xdg-open "<setup_url value>"
Tell the user: "Opening promptbook.gg — sign in or create an account to continue."
If the browser cannot open, show the URL for manual access.
3. Poll for authorization
Check every 2 seconds using the token from step 1:
curl -sL "https://promptbook.gg/api/auth/setup-session/<token value>/status"
Parse the JSON and check whether status equals "authorized". Use a unique variable name like or (do NOT use a variable named ). Timeout after 5 minutes.