Skip to content

feat: install Claude Code integration from the menubar - #154

Merged
arzafran merged 1 commit into
mainfrom
feat/138-install-integration
Jul 20, 2026
Merged

feat: install Claude Code integration from the menubar#154
arzafran merged 1 commit into
mainfrom
feat/138-install-integration

Conversation

@arzafran

Copy link
Copy Markdown
Member

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

  • New CLI pair 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.
  • Writes the same six lifecycle hooks the runtime wrapper injects per-session (SessionStart/Stop/SessionEnd/Notification/UserPromptSubmit/PreToolUse), durably, to $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 when programa isn't on PATH — installing costs nothing outside Programa.
  • Menubar item opens a fresh terminal pre-typed with the command via the initialTerminalInput primitive 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.
  • Nothing writes to anyone's settings until the user runs the command and confirms the diff; this PR only adds the capability.
  • Drive-by fix caught by the new test: the CLI pre-flight argument registry rejected --yes for the existing codex install-hooks too (it declared no boolean flags and had no test); both commands now declare yes/y.
  • Scope: Claude Code only. Codex/OpenCode variants are Codex and OpenCode integrations #139.

Test Plan

  • tests_v2/test_claude_install_integration.py 5/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)
  • Debug app build succeeds
  • CI green

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).
@arzafran
arzafran merged commit 56803fc into main Jul 20, 2026
4 of 7 checks passed
@arzafran
arzafran deleted the feat/138-install-integration branch July 20, 2026 20:11
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.

Install Claude Code integration: menubar item backed by a CLI diff-and-confirm flow

1 participant