feat: install Claude Code integration from the menubar - #154
Merged
Conversation
New CLI command pair mirroring the codex install-hooks template: programa claude install-integration / uninstall-integration. Install writes Programa's six lifecycle hooks (the same set the runtime wrapper injects per-session) durably into the user's Claude settings (CLAUDE_CONFIG_DIR/settings.json, else ~/.claude/settings.json), so Claude Code launched from ANY terminal wires up; the guard command no-ops outside Programa. Merge is additive and marker-deduped: user hooks are never touched, reinstall is idempotent, unparsable settings abort rather than overwrite. Diff shown, y/n confirm (skippable with --yes), atomic write, uninstall is symmetric. Menubar: File > Install Claude Code Integration... opens a new terminal pre-typed with the install command via initialTerminalInput, so the diff+confirm happens in front of the user. Also fixes a latent bug found by the new test: the pre-flight argument registry rejected --yes for the codex command too (no boolean flags declared, and codex install-hooks had no test); both commands now declare yes/y. Verified: build green; tests_v2/test_claude_install_integration.py 5/5 against the built CLI (fresh install, idempotency, user-hook preservation, symmetric uninstall, decline-leaves-untouched).
This was referenced Jul 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
Adds the front door of the agent story: File > "Install Claude Code Integration…" opens a terminal running
programa claude install-integration, which shows you the exact diff it wants to make to your Claude settings and asks for confirmation before writing anything. Installing makes Programa's Claude Code integration work from any terminal — Terminal.app, iTerm, VS Code, tmux — not just inside Programa, where today's session-scoped wrapper stops. Boring, transparent, reversible.Closes #138.
Summary
programa claude install-integration/uninstall-integration, mirroring the codex install-hooks template: marker-deduped additive merge (your own hooks are never touched, reinstall is byte-idempotent), line diff,[Y/n]confirm skippable with--yes, atomic write, unparsable settings abort rather than overwrite, success output prints the uninstall command.$CLAUDE_CONFIG_DIR/settings.json(else~/.claude/settings.json). Each hook command is guard-wrapped to silently no-op when not running inside Programa or whenprogramaisn't on PATH — installing costs nothing outside Programa.initialTerminalInputprimitive from feat: instant Claude Code workspace on cmd+shift+c #152, so the diff-and-confirm happens in front of the user with a real TTY.--yesfor the existingcodex install-hookstoo (it declared no boolean flags and had no test); both commands now declareyes/y.Test Plan
tests_v2/test_claude_install_integration.py5/5 against the built CLI, no app required (fresh install writes all six events; reinstall byte-idempotent; user hooks preserved and stale programa entries replaced 1:1; uninstall symmetric with empty-key cleanup; declining the prompt leaves the file untouched)