docs/DEVELOPMENT_SETUP.md
When developing CodexBar, you may see frequent keychain permission prompts like:
CodexBar wants to access key "Claude Code-credentials" in your keychain.
This happens because each rebuild creates a new code signature, and macOS treats it as a "different" app.
That can affect both CodexBar-owned entries (com.steipete.CodexBar, com.steipete.codexbar.cache) and
third-party items such as Claude Code-credentials, so an ad-hoc-signed rebuild can keep re-triggering
password/keychain approval dialogs even after you previously chose Always Allow.
When the prompt appears, click "Always Allow" instead of just "Allow". This grants access to the current build.
Use a stable development certificate that doesn't change between rebuilds:
./Scripts/setup_dev_signing.sh
This creates a self-signed certificate named "CodexBar Development".
Add this to your ~/.zshrc (or ~/.bashrc if using bash):
export APP_IDENTITY='CodexBar Development'
Then restart your terminal:
source ~/.zshrc
./Scripts/compile_and_run.sh
Now your builds will use the stable certificate, and keychain prompts will be much less frequent!
Note:
compile_and_run.shnow auto-detects a valid signing identity (Developer ID or CodexBar Development). SetAPP_IDENTITYto override the auto-detected choice.
If you see multiple CodexBar *.app bundles in your project directory, you can clean them up:
# Remove all numbered builds
rm -rf "CodexBar "*.app
# The .gitignore already excludes these patterns:
# - CodexBar.app
# - CodexBar *.app/
The build script creates CodexBar.app in the project root. Old numbered builds (like CodexBar 2.app) are created when Finder can't overwrite the running app.
./Scripts/compile_and_run.sh
This script:
swift build (release mode)swift test (all tests)./Scripts/package_app.shCodexBar.appWhen the script falls back to ad-hoc signing, it preserves CodexBar-owned keychain state by default.
That means you may still see keychain prompts for existing CodexBar cache entries, but allowing those prompts keeps the
cached browser/OAuth state available across normal rebuilds.
If you want a clean reset of CodexBar-owned keychain state for an ad-hoc build, run
./Scripts/compile_and_run.sh --clear-adhoc-keychain before relaunching.
Third-party keychain items still need stable signing if you want macOS to remember Always Allow across rebuilds.
swift build -c release
./Scripts/package_app.sh
swift test
swift build # defaults to debug
./Scripts/package_app.sh debug
The compile_and_run script should kill old instances, but if it doesn't:
pkill -x CodexBar || pkill -f CodexBar.app || true
Make sure you clicked "Always Allow" or set up the development certificate (see above).
This happens when the running app locks the bundle. The compile_and_run script handles this by killing the app first.
If you still see old bundles:
rm -rf "CodexBar "*.app
Always rebuild and restart:
./Scripts/compile_and_run.sh
Or manually:
./Scripts/package_app.sh
pkill -x CodexBar || pkill -f CodexBar.app || true
open -n CodexBar.app