[BUG] macOS Keychain warning on every launch: add-generic-password missing -U flag causes -25299 "item already exists"

Resolved 💬 2 comments Opened Apr 14, 2026 by andrejhronco Closed Jun 13, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

▎ On every launch, Claude Code shows a Keychain warning: SecKeychainItemCreateFromContent (<default>): The specified item already exists in the
▎ keychain; add-generic-password: returned -25299. This happens because Claude Code uses security add-generic-password without the -U (update/upsert)
▎ flag, so it fails whenever a Claude Code-credentials entry already exists in the login keychain.

What Should Happen?

Claude Code should either use security add-generic-password -U to upsert the credential, or check for an existing entry before attempting to write.
▎ No warning should appear on normal startups when valid credentials already exist.

Error Messages/Logs

macOS Keychain is not writable (security: SecKeychainItemCreateFromContent (<default>): The specified item already exists in the keychain.
  add-generic-password: returned -25299)

Steps to Reproduce

Steps to Reproduce

  1. Run claude login to authenticate (this creates a Claude Code-credentials keychain entry)
  2. Launch Claude Code normally
  3. The keychain warning appears on startup because it tries to re-add the credential that already exists
  4. Deleting the entry and re-logging in does not fix it — the error returns on the next launch

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.108

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Warp

Additional Information

_No response_

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗