feat(provider): add Claude Code CLI provider#93
Open
aurokin wants to merge 3 commits into
Open
Conversation
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.
Author Note: The intent of this PR is to add Claude Code CLI support to Clawpatch. Even with upcoming Claude Code changes,
claude -premains useful for review workflows. I spent time reading the Claude CLI docs, probing the CLI behavior directly, reviewing the implementation as it was built, and dogfooding this build while reviewing the final PR with Clawpatch using both Codex and Claude.Summary
Adds a
claudeprovider backed by the local Claude Code CLI in non-interactive print mode.This includes:
--provider claude/CLAWPATCH_PROVIDER=claudemap,review,fix, andrevalidatedoctor --provider claudesupportstructured_output--modelminimal-> Claudelownoneomittedlow|medium|high|xhighpassed throughRead,Grep,GlobacceptEdits--bare, empty MCP config, no slash commands, and no ChromeANTHROPIC_API_KEYdocs/providers.md,docs/safety.md, andREADME.mdAlso fixes a small command-execution race in
runCommandRawby adding the same single-settlement guard already used byrunCommandArgs, plus direct coverage for the exportedrunCommandwrapper.Validation
Ran:
pnpm format:checkpnpm typecheckpnpm lintpnpm testpnpm buildDogfooded the built CLI against this branch as a PR-to-
upstream/maincheck:doctor --provider codexpasseddoctor --provider claude --model claude-haiku-4-5-20251001passedmap --source agent --provider codexpassedmap --source agent --provider claude --model claude-haiku-4-5-20251001passed withCLAWPATCH_CLAUDE_TIMEOUT_MS=600000review --since upstream/main --provider claude --model claude-haiku-4-5-20251001 --limit 3 --jobs 1passed and surfaced one relevant docs issue, which is fixed in this branchNotes from dogfooding:
revalidatehelp/error wording issue was reported and left out of scope.