claude-code-ultimate-guide/examples/hooks/bash/privacy-warning.sh
Florian BRUNIAUX 19110eba22 feat(docs): add comprehensive data privacy documentation v3.2.0
- Create guide/data-privacy.md with retention policies (5y/30d/0)
- Add privacy notice to README.md
- Add section 2.6 "Data Flow & Privacy" to ultimate-guide.md
- Add Golden Rule #7 to cheatsheet.md (know what's sent)
- Add Phase 0.5 Privacy Awareness to onboarding-prompt.md
- Add privacy checks to audit-prompt.md
- Add PRIVACY CHECK section to audit-scan.sh (human + JSON)
- Add privacy reminder to check-claude.sh
- Create privacy-warning.sh SessionStart hook

Addresses user awareness of Anthropic data retention and opt-out options.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 20:42:19 +01:00

43 lines
2 KiB
Bash

#!/bin/bash
# privacy-warning.sh - Warn users about data sent to Anthropic
#
# Hook type: SessionStart
# Triggers: Once at the beginning of each Claude Code session
#
# Purpose:
# Reminds users that their prompts, files, and MCP results are sent to Anthropic.
# Provides link to opt-out of training data (reduces retention from 5 years to 30 days).
#
# Installation:
# 1. Copy to .claude/hooks/SessionStart/
# 2. Make executable: chmod +x privacy-warning.sh
# 3. Register in hooks config (see Claude Code docs)
#
# Configuration:
# Set PRIVACY_WARNING_SHOWN=1 in your environment to suppress after first run.
#
# Reference: https://github.com/FlorianBruniaux/claude-code-ultimate-guide/blob/main/guide/data-privacy.md
# Only show once per terminal session
if [[ -n "$PRIVACY_WARNING_SHOWN" ]]; then
exit 0
fi
# Output privacy reminder
echo ""
echo "┌─────────────────────────────────────────────────────────────────┐"
echo "│ 🔐 PRIVACY REMINDER │"
echo "├─────────────────────────────────────────────────────────────────┤"
echo "│ Your prompts, files, and MCP results are sent to Anthropic. │"
echo "│ │"
echo "│ Retention: 5 years (default) → 30 days (opt-out training) │"
echo "│ │"
echo "│ Disable training: claude.ai/settings/data-privacy-controls │"
echo "└─────────────────────────────────────────────────────────────────┘"
echo ""
# Mark as shown for this terminal session
export PRIVACY_WARNING_SHOWN=1
# Always exit 0 to allow session to continue
exit 0