Skip to content

Hook Privacy

guan4tou2 edited this page Jul 31, 2026 · 1 revision

Hook Privacy

The Claude Code hook is registered globally in ~/.claude/settings.json, so it fires on every Bash tool call across every Claude Code session — including sessions unrelated to your engagement. Two gates decide whether an event actually reaches the RedLog chain.

Gate 1: RedLog is currently recording

The hook makes a short (1s timeout) HTTP call to /api/recording before sending anything. If RedLog is paused (Settings ▸ recording toggle, ⌘. shortcut, or tray menu), the hook returns immediately.

Use recording pause to step away from the engagement without leaking personal terminal activity.

Gate 2: cwd exclusion list

Since v0.6.64 — previously a whitelist, but the default is inverted now because Claude Code tool calls are AI-mediated actions worth auditing by default.

Any cwd matching a path in the operator's exclusion list is skipped. Empty list = everything is logged (privacy-first because the operator opts paths out, not in).

Config lives at ~/.redlog/hook-config.json:

{
  "excludedPaths": [
    "~/Documents/personal",
    "~/Desktop/hobby-projects",
    "~/.claude"
  ]
}

Settings ▸ 整合 exposes a UI with a native folder picker; edits write straight through to the file. Legacy v0.6.59 watchPaths (whitelist) is still honored for backward-compat and surfaces an amber banner in the UI so it's obvious that a rule is narrowing the log.

Common cases

  • Don't log personal Claude sessions — add ~/Documents, ~/Downloads, wherever your personal work lives.
  • Don't log RedLog development — add ~/Desktop/redlog (or your local clone) so working ON RedLog isn't captured as engagement activity.
  • Don't log secrets scan — add any folder you tour with Claude that has sensitive files you don't want quoted in event payloads.

Related event fields

When the hook DOES fire, it sends:

  • data.command — the Bash tool_input.command.
  • data.output_preview — truncated to 500 chars, redaction applied.
  • data.session_id — Claude Code session (pointer, not conversation body).
  • data.transcript_path — points at ~/.claude/projects/…/*.jsonl for on-demand audit reference without copying content into the chain.
  • data.cwd — the working directory the tool ran under.

Design note

The hook never stores raw conversation text. transcript_path is a pointer — Anthropic-owned content stays in Anthropic-managed files; the RedLog chain holds the auditable action + a reference. This keeps the chain small and avoids ToS / privacy concerns around bulk-mirroring AI conversations.

Reference

  • hooks/claude-code-hook.sh — the hook script.
  • src/main/index.ts ipcMain.handle('hookConfig:*') — IPC surface.
  • src/renderer/src/components/Settings.tsx HookWatchPathsPanel — UI.

Clone this wiki locally