protect-cli CLAUDE.md

Repository instructions for the Clerk CLI, a command-line program for managing Clerk authentication services. They describe its Go codebase, project structure, tools, and development conventions.

In plain words
What is it for?
Use them when developing, reviewing, or troubleshooting the Clerk CLI, especially changes involving its commands, API clients, authentication resources, or release setup.
Why use it?
They give coding agents the context needed to make changes in the right files and follow the project's established patterns. This reduces incorrect assumptions about the CLI's architecture.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/clerk/protect-cli/claude-md
Clone the repo
git clone --depth 1 https://github.com/clerk/protect-cli
Per session 3,027 This file is loaded in full into every session.
When invoked 3,027 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.03027 $0.03027
Opus 5 $0.01514 $0.01514
Sonnet 5 $0.00605 $0.00605
Haiku 4.5 $0.00303 $0.00303

Measured 2d ago against content hash 224b3ae500b0, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

protect-cli CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 435 lines

How it starts

The opening of the file, as written. The whole thing — 435 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

This file provides guidance for Claude Code when working with the Clerk CLI codebase.

Project Overview

The Clerk CLI is a command-line interface for managing Clerk authentication instances. It's written in Go and distributed via:

  • Homebrew (source build via Formula, signed .pkg via Cask)
  • NPM (binary wrapper that downloads pre-built Go binaries)
  • GitHub Releases (direct binary downloads)

Tech Stack

  • Language: Go 1.23+
  • CLI Framework: Cobra
  • Interactive UI: Huh (forms), Bubbles (TUI components)
  • Module Path: clerk.com/cli

Code Structure

cmd/clerk/
  main.go                 # Entry point

internal/
  api/                    # HTTP client layer
    client.go             # Backend API client (sk_* keys)
    platform_client.go    # Platform API client (ak_* keys)
    users.go              # Users API
    organizations.go      # Organizations API
    applications.go       # Applications API (Platform)
    transfers.go          # Transfers API (Platform)
    protect.go            # Protect Rules & Schema API
    billing.go            # Billing API
    ...                   # Other resource APIs

  cmd/                    # Cobra command definitions
    root.go               # Root command, global flags, prefix matching
    config.go             # Config, profile, alias commands
    users.go              # Users commands
    apps.go               # Applications commands (Platform API)
    transfers.go          # Transfers commands (Platform API)
    protect.go            # Protect commands
    ...                   # Other command groups

  config/                 # Configuration management
    config.go             # INI-based profiles
    aliases.go            # Command aliases (JSON)

  output/                 # Output formatting
    format.go             # Table/JSON/YAML formatting
    colors.go             # Terminal colors

  ai/                     # AI integration for rule generation
    ai.go                 # Provider abstraction
    openai.go             # OpenAI provider
    anthropic.go          # Anthropic provider
    mcp.go                # MCP client for external tools

scripts/
  postinstall.js          # NPM postinstall (downloads Go binary)
  build-macos-pkg.sh      # macOS signing and packaging
  export-certs-for-github.sh  # Certificate export helper

Formula/
  clerk.rb                # Homebrew Formula (builds from source)

Casks/
  clerk.rb                # Homebrew Cask (uses signed .pkg)

Read the full file on GitHub · 435 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 435 lines · 3,027 tokens per session scan A 224b3ae500b0

Subscribe to this mod's changes

protect-cli CLAUDE.md is an instructions file published in the GitHub repository clerk/protect-cli (5 stars, last pushed 5mo ago), licensed MIT. It adds 3,027 tokens to every session, about $0.0151 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories