Skip to content

Encrypt the Claude configuration with cc - #86

Merged
pietrangelo merged 4 commits into
mainfrom
claude/encrypt-claude-config
Oct 24, 2026
Merged

pietrangelo merged 4 commits into
mainfrom
claude/encrypt-claude-config

Conversation

@pietrangelo

@pietrangelo pietrangelo commented Oct 24, 2026 •

Copy link
Copy Markdown
Owner

Requested by Pietrangelo · project thread

Applies cc (cc init) to this repository:

  • The project instructions are in .claude/private/CLAUDE.md, stored encrypted with sec v2 through a git filter; the root CLAUDE.md is a clear stub.
  • .claude/settings.json adds the SessionStart hook that decrypts the configuration when the session has SEC_TOOL_KEY (the key is the one already set in the cloud environment).
  • .gitattributes, a pre-commit hook (local) and .github/workflows/cc-check.yml keep protected files from being committed in clear.

Checked from a fresh clone: the blob in git is ciphertext, cc session-start decrypts it to a file identical to the previous CLAUDE.md. The instructions are about 138 KB, over the 10,000 character hook limit, so the hook tells Claude to read .claude/private/CLAUDE.md first instead of injecting it.

History: main was rewritten with git filter-repo --invert-paths --path CLAUDE.md to drop the 111 earlier plaintext versions, so until this PR merges main has no CLAUDE.md. Old pull request refs on GitHub still reference the previous commits.

🤖 Generated with Claude Code

https://claude.ai/code/session_013B8vqhYDPMmPdgwixFRmfs

Move the project instructions to .claude/private/CLAUDE.md, encrypted with
sec through a git filter, and leave a clear stub in CLAUDE.md. A SessionStart
hook decrypts them when a session has SEC_TOOL_KEY.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013B8vqhYDPMmPdgwixFRmfs
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013B8vqhYDPMmPdgwixFRmfs
@pietrangelo pietrangelo self-assigned this Oct 24, 2026
Comment thread .github/workflows/cc-check.yml Fixed
Pin actions/checkout to a full commit SHA, as repositories that require
pinned actions reject a tag, and give the job a read-only GITHUB_TOKEN.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013B8vqhYDPMmPdgwixFRmfs
The project instructions live encrypted in .claude/private/CLAUDE.md. This
stub, in clear, tells Claude where they are when the key is missing.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013B8vqhYDPMmPdgwixFRmfs
@pietrangelo
pietrangelo force-pushed the claude/encrypt-claude-config branch 3 times, most recently from e4f0d41 to a99faf1 Compare October 24, 2026 14:54
@pietrangelo
pietrangelo marked this pull request as ready for review October 24, 2026 15:07
@pietrangelo
pietrangelo merged commit a27689a into main Oct 24, 2026
8 checks passed
@pietrangelo
pietrangelo deleted the claude/encrypt-claude-config branch October 24, 2026 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants