Skip to content

Claude Code CLI and hook configuration

kyvvu claude setup

Interactive setup: configure API connection and register agent.

  • --fail-mode: Allow failures (open) or deny PreToolUse on failure (closed).

  • --api-url: Kyvvu API URL. Default: kyvvu auth login, else https://platform.kyvvu.com.

  • --api-key: Kyvvu agent API key (Workspace → API Keys). Default: prompt. Prefer the KV_API_KEY variable: an option is visible in the process list and shell history.

  • --owner: Email of the workspace member accountable for this agent (EU AI Act owner). Default: the API key owner's email, filled in by the platform.

  • --agent-key: Agent key to register under. Default: claude-code--.

  • --environment: development, qa, staging or production. Default: KV_ENVIRONMENT, else production.

kyvvu claude hooks install

Install Claude Code hooks for compliance monitoring.

  • --project: Write to .claude/settings.json in cwd

kyvvu claude hooks remove

Remove Kyvvu's hooks from Claude Code settings.

  • --project: Remove from .claude/settings.json in cwd

kyvvu claude set

Set one Claude integration option in the saved configuration.

kyvvu claude status

Show current kyvvu claude status.

kyvvu claude policies

Display cached policies as a table.

kyvvu claude refresh

Force policy refresh from the API.

Installed hooks

kyvvu claude hooks install merges the following entries into ~/.claude/settings.json, or .claude/settings.json with --project. The command path shown is illustrative; installation uses the script's absolute path.

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/path/to/kyvvu-claude-hook",
            "timeout": 10
          }
        ]
      }
    ],
    "PostToolUse": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/path/to/kyvvu-claude-hook",
            "timeout": 10
          }
        ]
      }
    ],
    "SessionStart": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/path/to/kyvvu-claude-hook",
            "timeout": 30
          }
        ]
      }
    ],
    "SessionEnd": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/path/to/kyvvu-claude-hook",
            "timeout": 30
          }
        ]
      }
    ],
    "SubagentStart": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/path/to/kyvvu-claude-hook",
            "timeout": 10
          }
        ]
      }
    ],
    "SubagentStop": [
      {
        "matcher": "",
        "hooks": [
          {
            "type": "command",
            "command": "/path/to/kyvvu-claude-hook",
            "timeout": 10
          }
        ]
      }
    ]
  }
}

Saved configuration

Settings live in ~/.kyvvu/integrations/claude-code/config.json. The file has user-only read/write permissions (0600), inside a 0700 directory.

Setting Default Meaning
api_url 'https://platform.kyvvu.com' Kyvvu API base URL (policy fetch + agent registration).
log_location '' WHERE logs go. Empty = same as api_url. "stdout" = print to stderr. "none" / "off" = disabled. Can also be a URL or file path.
log_format 'kv' HOW logs are formatted: "kv" (Kyvvu batch API), "json" (generic JSON), or "otlp" (OpenTelemetry).
incident_location '' WHERE incidents go. Empty = inherit the trace sink (log_location → api_url). Same vocabulary as log_location (URL, file path, "stdout", "none").
incident_format '' HOW incidents are formatted ("kv", "json", "otlp"). Empty = inherit log_format.
api_key '' Kyvvu API key (KvKey-...).
agent_id None Assigned after registration; None means not initialized.
agent_key Generated at setup; see description above. Stable identifier for this machine+user. Defaults to claude-code-<hostname>-<user>; kyvvu claude setup --agent-key overrides it.
owner_id '' Email of the workspace member accountable for this agent (EU AI Act Article 16), sent as owner_id at registration. Empty leaves it to the platform, which uses the API key owner's email.
enforce False True to block violations; False for monitor-only.
fail_mode 'open' "open" allows hook failures; "closed" denies PreToolUse calls when evaluation cannot complete.
environment Generated at setup; see description above. Deployment environment (development/staging/production). A saved value wins; otherwise KV_ENVIRONMENT, else production (the Python client and engine default).
risk_classification 'limited' EU AI Act risk tier for this agent.
policy_sync_interval_seconds 300 How often to refresh policies from API.
session_idle_timeout_seconds 300 Auto-close task after idle period.
flush_threshold 100 Flush history to API after this many steps. 0 disables count-based flushing.
flush_interval_seconds 60 Flush pending steps on the next hook after this many seconds. 0 disables interval flushing.
enforcement_history_limit 10000 Maximum recent steps retained for policy replay. 0 keeps the whole task history.
log_full_content False Export full tool input, output, and derived properties when true. When false, export input/output as byte-count and SHA-256 summaries, with only structural tool properties retained.