Skip to content

Claude Code setup

Claude Code is Anthropic’s CLI for engineers. Installing InPolicy takes one command.

  • Claude Code installed (npm install -g @anthropic-ai/claude-code or equivalent).
  • An InPolicy API key.

Run this once on each machine:

Terminal window
claude mcp add inpolicy -- env INPOLICY_API_KEY=inp_live_REPLACE_ME npx -y @inpolicy/mcp-server

Replace the key and you’re done. Verify with:

Terminal window
claude mcp list

You should see inpolicy listed. Open any project with claude and the tools are available.

Next, apply the system prompt template by adding it to either:

  • User-level: ~/.claude/CLAUDE.md (applies to all Claude Code sessions on your machine), or
  • Project-level: a CLAUDE.md in the repo root (applies to anyone running Claude Code there).

Option A: Corporate Claude Code install script

Section titled “Option A: Corporate Claude Code install script”

Add the MCP config + system prompt to your standard Claude Code install script.

#!/usr/bin/env bash
set -euo pipefail
# Install Claude Code if missing
command -v claude >/dev/null 2>&1 || npm install -g @anthropic-ai/claude-code
# Register InPolicy MCP
claude mcp add inpolicy -- env INPOLICY_API_KEY="$INPOLICY_API_KEY" npx -y @inpolicy/mcp-server
# Drop the company CLAUDE.md
mkdir -p "$HOME/.claude"
curl -fsSL https://your-internal-host/company-CLAUDE.md -o "$HOME/.claude/CLAUDE.md"
echo "Claude Code + InPolicy ready."

Option B: Project-level CLAUDE.md in a shared template

Section titled “Option B: Project-level CLAUDE.md in a shared template”

If your engineering org uses a standard repo template, check in the system prompt as a CLAUDE.md in the repo root. Every engineer who runs Claude Code in that repo picks it up automatically.

Option C: Managed devcontainer / codespace

Section titled “Option C: Managed devcontainer / codespace”

Bake the MCP registration + CLAUDE.md into your devcontainer definition. Claude Code running inside the container gets InPolicy for free.

In any Claude Code session, ask:

“List the InPolicy MCP tools you have available.”

Claude Code should list record_turn, check_output, get_conversation_state, end_conversation, and (if enabled on the API key) check_tool_call.

  • Engineers will notice Claude Code surfaces policy citations in code reviews and commit-message drafts when relevant policies exist (e.g. “naming conventions,” “security review required for X,” “don’t commit .env”).
  • If you want to scope policies so engineering doesn’t see non-engineering policies (HR, legal), use Policy Areas and scope the API key accordingly.
  • Claude Code’s /mcp command shows the live tool list and lets engineers toggle servers. If an engineer turns off InPolicy, they’ll see a note about it; that’s a legitimate per-session decision (e.g. they’re debugging an InPolicy integration).