Skip to content

Commit 204266c

Browse files
ashwin-antclaude
andauthored
feat: integrate Claude Code SDK to replace process spawning (anthropics#327)
* feat: integrate Claude Code SDK to replace process spawning - Add @anthropic-ai/claude-code dependency to base-action - Replace mkfifo/cat process spawning with direct SDK usage - Remove global Claude Code installation from action.yml files - Maintain full compatibility with existing options - Add comprehensive tests for SDK integration This change makes the implementation cleaner and more reliable by eliminating the complexity of managing child processes and named pipes. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com> * fix: add debugging and bun executable for Claude Code SDK - Add stderr handler to capture CLI errors - Explicitly set bun as the executable for the SDK - This should help diagnose why the CLI is exiting with code 1 * fix: extract mcpServers from parsed MCP config The SDK expects just the servers object, not the wrapper object with mcpServers property. * tsc --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent ef30446 commit 204266c

File tree

8 files changed

+389
-481
lines changed

8 files changed

+389
-481
lines changed

action.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,6 @@ runs:
192192
if: steps.prepare.outputs.contains_trigger == 'true'
193193
shell: bash
194194
run: |
195-
# Install Claude Code globally
196-
bun install -g @anthropic-ai/claude-code@1.0.57
197-
198195
# Run the base-action
199196
cd ${GITHUB_ACTION_PATH}/base-action
200197
bun install

base-action/action.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,6 @@ runs:
113113
cd ${GITHUB_ACTION_PATH}
114114
bun install
115115
116-
- name: Install Claude Code
117-
shell: bash
118-
run: npm install -g @anthropic-ai/claude-code@1.0.58
119-
120116
- name: Run Claude Code Action
121117
shell: bash
122118
id: run_claude

base-action/bun.lock

Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

base-action/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
"typecheck": "tsc --noEmit"
1111
},
1212
"dependencies": {
13-
"@actions/core": "^1.10.1"
13+
"@actions/core": "^1.10.1",
14+
"@anthropic-ai/claude-code": "1.0.58"
1415
},
1516
"devDependencies": {
1617
"@types/bun": "^1.2.12",

0 commit comments

Comments
 (0)