Repository navigation
feat(pip): add a Claude quip backend and an explicit backend chooser - #334
Merged
Merged
Conversation
Pip's AI quips can now come from Claude Code as well as Codex. The backend is an explicit choice in Pip options (Off / Codex / Claude), never the focused session's CLI, because it decides which company receives the request. - src/main/pip/backends/ holds a PipCommentBackend interface. The Codex client moves behind it; its instructions and reply normalisation are shared through src/main/pip/instructions.ts. - The Claude backend runs one Haiku prompt at low effort in Tether's neutral folder: no tools, no settings sources (so no hooks, Tether's included), strict MCP with claude.ai connectors off, no skills, and no saved session. The request goes on stdin, so the prompt excerpt never crosses a command line or cmd.exe shim. A reply counts only if every modelUsage key is a Haiku model, it took one turn, and no permission was denied. - Subscription sign-in is required: `claude auth status --json` must report claude.ai on the first-party provider. API keys, proxies and cloud-provider switches are removed from the child environment. - Choosing a backend checks its sign-in and model right away and shows the result. Try a quip asks for one immediately; it skips the cooldown but counts toward the hourly cap. - Prompt-sharing consent names the recipient (OpenAI or Anthropic), and choosing another backend withdraws it. The main process discards a reply if the backend changed while the request was in flight. - "Personality & comments" is renamed "Pip options". Verified live on Claude Code 2.1.322: the debug log shows 0 hooks registered, ~/.claude/projects is unchanged after a run, --effort low spends 0 thinking tokens, and a quip took about 2 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.



Pip plan PR 6: backend interface, Claude backend, and the chooser.
What changes
aiBackend, defaultcodex, so existing users are unchanged). The expander is renamed Pip options.pip:backend-statusIPC checks sign-in and model when a backend is chosen or the options open. It makes no model request, and picking another backend abandons the previous check. Account identifiers never leave main.helloevent right away. Main lets it skip the cooldown but counts it toward the hourly cap.src/main/pip/backends/addsPipCommentBackendplus Codex and Claude adapters. Shared instructions and reply checks live insrc/main/pip/instructions.ts. Recipient and account facts are incli-tools.ts(pipQuips).Claude backend
claude -p --model haiku --effort low --tools "" --no-session-persistence --setting-sources "" --strict-mcp-config --disable-slash-commands --system-prompt … --output-format json. The request goes on stdin.authMethod: "claude.ai"on the first-party provider.ANTHROPIC_API_KEY, the auth token, base URL, model overrides and Bedrock/Vertex/Foundry switches are stripped, case-insensitively on Windows.ENABLE_CLAUDEAI_MCP_SERVERS=false.type: result,subtype: success,is_error: false,num_turns: 1,permission_denialsis empty, and everymodelUsagekey isclaude-haiku-*. Same 180-character and control-character limits as Codex. 20 s timeout with a process-tree kill, 1 MB output cap.Plan items verified live (Claude Code 2.1.322)
Registered 0 hooks. User settings, including Tether's hook overlay, are not loaded.~/.claude/projectsis unchanged after runs.--effort low:thinking_tokens: 0(the spike without it spent 59).claude-haiku-5-5. Codex status was also checked live: "GPT-6 Luna".Known limits, documented in the docs: Claude Code still adds its own environment context (account email and the neutral folder), and quips don't appear in usage totals because no transcript is saved.
Docs
src/docs/settings.md(Pip + Optional AI quips),src/docs/sessions.md,README.mdprivacy table,docs/ARCHITECTURE.md.Tests
New: Claude client (args, env stripping, account parsing, result validation, stdin, timeout/abort/exit/oversize), Codex status, handler routing and status IPC, service cooldown and backend-change rules, settings consent reset, panel chooser, status line and Try a quip. Full
vitestpasses (2792), as dotsc --noEmitandtest:security. Lint finds nothing new in the changed files.🤖 Generated with Claude Code