Skip to content

fix: prevent op inject overwrite prompt with multiple secrets files#29

Merged
smartwatermelon merged 1 commit intomainfrom
claude/fix-secrets-basename-collision-3f8a2c
Mar 28, 2026
Merged

fix: prevent op inject overwrite prompt with multiple secrets files#29
smartwatermelon merged 1 commit intomainfrom
claude/fix-secrets-basename-collision-3f8a2c

Conversation

@smartwatermelon
Copy link
Copy Markdown
Owner

Summary

  • When both global (~/.config/claude-code/secrets.op) and project-level (.claude/secrets.op) secrets files exist, inject_secrets() created temp files using basename alone, causing filename collisions in the shared temp directory
  • The second op inject --out-file hit the already-existing file and prompted for overwrite confirmation every launch
  • Prefixed each temp filename with a loop index counter so stripped-, resolved-, and normalized- files are unique across iterations

Test plan

  • Launch claude in a repo that has its own .claude/secrets.op while global secrets also exist — confirm no overwrite prompt
  • Launch claude in a repo with only global secrets — confirm no regression
  • Run tests/test-wrapper.sh — 77/78 pass (1 pre-existing failure unrelated)

🤖 Generated with Claude Code

…hare basename

When both global (~/.config/claude-code/secrets.op) and project-level
(.claude/secrets.op) secrets files exist, inject_secrets() created temp
files using basename alone, causing filename collisions in the shared
temp directory. The second op inject --out-file hit the existing file
and prompted for overwrite confirmation.

Prefix each temp filename with a loop index counter so stripped-,
resolved-, and normalized- files are unique across iterations.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@smartwatermelon smartwatermelon merged commit ab5b4fe into main Mar 28, 2026
4 checks passed
@smartwatermelon smartwatermelon deleted the claude/fix-secrets-basename-collision-3f8a2c branch March 28, 2026 00:58
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.

1 participant