[BUG] Claude Code SDK crashes with exit code 1 in GitHub Actions (v2.1.31)

Status Closed — not planned
Reported on v2.1.31
Maintainer reply None cached
Activity 12 comments · opened Feb 4, 2026 · closed Mar 24, 2026

Description

Claude Code crashes during SDK initialization when running via GitHub Actions with the claude-code-action@v1. The process exits with code 1 before any actual work can be performed, outputting minified JavaScript code in the error message.

Error Output

SDK execution error: 14 |     depsCount: ${Q},
15 |     deps: ${$}}`};var Zj={keyword:"dependencies",type:"object",schemaType:"object",error:EB.error,code(X){let[Q,$]=Cj(X);RB(X,Q),IB(X,$)}};function Cj({schema:X}){let Q={},$={};for(let Y in X){if(Y==="__proto__")continue;let W=Array.isArray(X[Y])?Q:$;W[Y]=X[Y]}return[Q,$]}function RB(X,Q=X.schema){let{gen:$,data:Y,it:W}=X;if(Object.keys(Q).length===0)return;let J=$.let("missing");for(let G in Q){let H=Q[G];if(H.length===0)continue;let B=(0,W4.propertyInData)($,Y,G,W.opts.ownProperties);if(X.setParams({property:G,depsCount:H.length,deps:H.join(", ")}),W.allErrors)$.if(B,()=>{for(let z of H)(0,W4.checkReportMissingProp)(X,z)});else $.if(fY._\`${B} && (${(0,W4.checkMissingProp)(X,H,J)})\`),(0,W4.reportMissingProp)(X,J),$.else()}}EB.validatePropertyDeps=RB;function IB(X,Q=X.schema){let{gen:$,data:Y,keyword:W,it:J}=X,G=$.name("valid");for(let H in Q){if((0,Sj.alwaysValidSchema)(J,Q[H]))continue;$.if((0,W4.propertyInData)($,Y,H,J.opts.ownProperties),()=>{let B=X.subschema({keyword:W,schemaProp:H},G);X.mergeValidEvalu
[... more minified code ...]

error: Claude Code process exited with code 1
      at $ (/home/runner/work/_actions/anthropics/claude-code-action/v1/base-action/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs:19:7785)
      at emit (node:events:98:22)
      at #handleOnExit (node:child_process:520:14)

Environment

  • Claude Code Version: 2.1.31
  • SDK Version: @anthropic-ai/claude-agent-sdk@0.2.31
  • Runner: ubuntu-latest (GitHub Actions)
  • Model: claude-sonnet-4-5-20250929
  • Max Turns: 30
  • Duration Before Crash: ~468ms

Workflow Configuration

<details>
<summary>Click to expand workflow YAML</summary>

name: Scheduled - Dependency Audit (Claude)
on:
  schedule:
    - cron: '0 17 * * 0'
  workflow_dispatch:

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

permissions:
  contents: write
  pull-requests: write
  id-token: write

jobs:
  dependency-audit:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v6
        with:
          fetch-depth: 0

      - name: Setup Node.js & install deps
        uses: ./.github/actions/common-node-setup
        with:
          github_token: ${{ secrets.BOT_PAT }}
          skip_documentation_site: 'true'

      - name: Claude Dependency Analysis & Update
        uses: anthropics/claude-code-action@v1
        env:
          GH_TOKEN: ${{ secrets.BOT_PAT }}
        with:
          anthropic_api_key: ${{ secrets.MOBILE_DEPENDENCY_AUDIT_ANTHROPIC_API_KEY }}
          claude_args: |
            --model claude-sonnet-4-5-20250929
            --max-turns 30
          prompt: |
            # Weekly Dependency Audit - React Native Project
            [... large prompt for dependency updates ...]

</details>

Reproduction

This occurred in a scheduled workflow run:

The crash happens very early during SDK initialization, before Claude can process any prompts or execute any tools.

Expected Behavior

Claude Code should initialize successfully and begin processing the provided prompt.

Actual Behavior

The process crashes immediately with exit code 1, outputting what appears to be minified JSON schema validator code in the error message.

Additional Context

The minified code in the error message suggests the crash is happening in a JSON schema validation library (possibly ajv based on the patterns visible). The crash occurs in the SDK's bundled dependencies before reaching the main Claude Code logic.

Impact

This completely blocks the GitHub Actions workflow from running automated dependency audits. The workflow cannot complete any work when Claude Code crashes during initialization.

View original on GitHub ↗

12 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/20752
  2. https://github.com/anthropics/claude-code/issues/11701
  3. https://github.com/anthropics/claude-code/issues/17373

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

DEM1TASSE · 6 months ago

same issue here

Andrew-Tierno · 6 months ago

Also hitting this issue on v2.1.31

2026-02-09T20:54:40.8668244Z Installing Claude Code v2.1.31...
2026-02-09T20:54:40.8670003Z Installation attempt 1...
2026-02-09T20:54:42.2747760Z Setting up Claude Code...
2026-02-09T20:54:42.7692755Z ^[[?2026h
2026-02-09T20:54:42.7693910Z Checking^[[1Cinstallation^[[1Cstatus...
2026-02-09T20:54:42.8728499Z ^[[?2026l^[[?2026h
2026-02-09T20:54:42.8729474Z ^[[1AInstalling Cl^[[1Cude C^[[1Cde n^[[2Cive build^[[1C2.1.31...
2026-02-09T20:54:45.9080144Z ^[[?2026l^[[?2026h
2026-02-09T20:54:45.9080886Z ^[[1ASet^[[1Cing up^[[1Clauncher and shell^[[1Cintegration.^[[2C 
2026-02-09T20:54:50.0394172Z ^[[?2026l^[[?2026h
2026-02-09T20:54:50.0397709Z ^[[1A✔ Claude Code successfully installed!       
2026-02-09T20:54:50.0398179Z 
2026-02-09T20:54:50.0398442Z ^[[2CVersion:^[[1C2.1.31
2026-02-09T20:54:50.0398742Z 
2026-02-09T20:54:50.0399037Z ^[[2CLocation:^[[1C~/.local/bin/claude
2026-02-09T20:54:50.0399428Z 
2026-02-09T20:54:50.0399435Z 
2026-02-09T20:54:50.0399918Z ^[[2CNext:^[[1CRun^[[1Cclaude^[[1C--help^[[1Cto^[[1Cget^[[1Cstarted
2026-02-09T20:54:52.0436605Z ^[[?2026l^[[?2026h
2026-02-09T20:54:52.1094141Z ^[[?2026l
2026-02-09T20:54:52.1095580Z ✅ Installation complete!
2026-02-09T20:54:52.1095897Z 
2026-02-09T20:54:52.1107305Z Claude Code installed successfully
2026-02-09T20:54:52.1114567Z Setting up Claude settings at: /home/runner/.claude/settings.json
2026-02-09T20:54:52.1116389Z Creating .claude directory...
2026-02-09T20:54:52.1134576Z No existing settings file found, creating new one
2026-02-09T20:54:52.1136172Z Updated settings with enableAllProjectMcpServers: true
2026-02-09T20:54:52.1137506Z Settings saved successfully
2026-02-09T20:54:52.1140650Z No marketplaces specified, skipping marketplace setup
2026-02-09T20:54:52.1142345Z No plugins specified, skipping plugins installation
2026-02-09T20:54:52.1174046Z Using multi-block message with user request (content hidden)
2026-02-09T20:54:52.1175888Z Running Claude Code via SDK (full output hidden for security)...
2026-02-09T20:54:52.1177160Z Rerun in debug mode or enable `show_full_output: true` in your workflow file for full output.
2026-02-09T20:54:52.1178377Z Running Claude with prompt from file: /home/runner/work/_temp/claude-prompts/claude-prompt.txt
2026-02-09T20:54:52.1179384Z SDK options: ***
2026-02-09T20:54:52.1179855Z   "allowedTools": [
2026-02-09T20:54:52.1180408Z     "Edit",
2026-02-09T20:54:52.1180805Z     "MultiEdit",
2026-02-09T20:54:52.1181213Z     "Glob",
2026-02-09T20:54:52.1181597Z     "Grep",
2026-02-09T20:54:52.1181992Z     "LS",
2026-02-09T20:54:52.1182386Z     "Read",
2026-02-09T20:54:52.1182770Z     "Write",
2026-02-09T20:54:52.1183265Z     "mcp__github_comment__update_claude_comment",
2026-02-09T20:54:52.1183909Z     "mcp__github_ci__get_ci_status",
2026-02-09T20:54:52.1184511Z     "mcp__github_ci__get_workflow_run_details",
2026-02-09T20:54:52.1185168Z     "mcp__github_ci__download_job_log",
2026-02-09T20:54:52.1185747Z     "Bash(git add:*)",
2026-02-09T20:54:52.1186449Z     "Bash(git commit:*)",
2026-02-09T20:54:52.1186988Z     "Bash(git push:*)",
2026-02-09T20:54:52.1187478Z     "Bash(git status:*)",
2026-02-09T20:54:52.1187971Z     "Bash(git diff:*)",
2026-02-09T20:54:52.1188440Z     "Bash(git log:*)",
2026-02-09T20:54:52.1188924Z     "Bash(git rm:*)",
2026-02-09T20:54:52.1189379Z     "Bash(gh issue:*)",
2026-02-09T20:54:52.1189857Z     "Bash(gh pr:*)",
2026-02-09T20:54:52.1190293Z     "Bash(npm install)",
2026-02-09T20:54:52.1190729Z     "Bash(npm run build)"
2026-02-09T20:54:52.1191152Z   ],
2026-02-09T20:54:52.1191541Z   "systemPrompt": ***
2026-02-09T20:54:52.1192008Z     "type": "preset",
2026-02-09T20:54:52.1192460Z     "preset": "claude_code"
2026-02-09T20:54:52.1192934Z   ***,
2026-02-09T20:54:52.1193362Z   "pathToClaudeCodeExecutable": "",
2026-02-09T20:54:52.1193938Z   "extraArgs": ***
2026-02-09T20:54:52.1200463Z     "mcp-config": "***\n  \"mcpServers\": ***\n    \"github_comment\": ***\n      \"command\": \"bun\",\n      \"args\": [\n        \"run\",\n        \"/home/runner/work/_actions/anthropics/claude-code-action/v1/src/mcp/github-comment-server.ts\"\n      ],\n      \"env\": ***\n        \"GITHUB_TOKEN\": \"***\",\n        \"REPO_OWNER\": \"CodeinPlace\",\n        \"REPO_NAME\": \"<redacted>\",\n        \"CLAUDE_COMMENT_ID\": \"2784489861\",\n        \"GITHUB_EVENT_NAME\": \"pull_request_review_comment\",\n        \"GITHUB_API_URL\": \"https://api.github.com\"\n      ***\n    ***,\n    \"github_ci\": ***\n      \"command\": \"bun\",\n      \"args\": [\n        \"run\",\n        \"/home/runner/work/_actions/anthropics/claude-code-action/v1/src/mcp/github-actions-server.ts\"\n      ],\n      \"env\": ***\n        \"GITHUB_TOKEN\": \"***\",\n        \"REPO_OWNER\": \"CodeinPlace\",\n        \"REPO_NAME\": \"<redacted>\",\n        \"PR_NUMBER\": \"1664\",\n        \"RUNNER_TEMP\": \"/home/runner/work/_temp\"\n      ***\n    ***\n  ***\n***",
2026-02-09T20:54:52.1206430Z     "model": "claude-opus-4-6"
2026-02-09T20:54:52.1207069Z   ***,
2026-02-09T20:54:52.1207497Z   "settingSources": [
2026-02-09T20:54:52.1207982Z     "user",
2026-02-09T20:54:52.1208381Z     "project",
2026-02-09T20:54:52.1208800Z     "local"
2026-02-09T20:54:52.1209180Z   ]
2026-02-09T20:54:52.1209551Z ***
2026-02-09T20:54:54.5921251Z ***
2026-02-09T20:54:54.5926670Z   "type": "system",
2026-02-09T20:54:54.5929835Z   "subtype": "init",
2026-02-09T20:54:54.5931772Z   "message": "Claude Code initialized",
2026-02-09T20:54:54.5935461Z   "model": "claude-opus-4-6"
2026-02-09T20:54:54.5936012Z ***
2026-02-09T20:54:54.7422803Z ***
2026-02-09T20:54:54.7423663Z   "type": "result",
2026-02-09T20:54:54.7425122Z   "subtype": "success",
2026-02-09T20:54:54.7425917Z   "is_error": true,
2026-02-09T20:54:54.7426918Z   "duration_ms": 190,
2026-02-09T20:54:54.7428545Z   "num_turns": 1,
2026-02-09T20:54:54.7428971Z   "total_cost_usd": 0,
2026-02-09T20:54:54.7429438Z   "permission_denials": []
2026-02-09T20:54:54.7429953Z ***
2026-02-09T20:54:55.2992684Z SDK execution error: 14 |     depsCount: $***Q***,
2026-02-09T20:54:55.2999385Z 15 |     deps: $***$***`***;var Cj=***keyword:"dependencies",type:"object",schemaType:"object",error:EB.error,code(X)***let[Q,$]=kj(X);RB(X,Q),IB(X,$)***;function kj(***schema:X***)***let Q=***,$=***;for(let Y in X)***if(Y==="__proto__")continue;let W=Array.isArray(X[Y])?Q:$;W[Y]=X[Y]***return[Q,$]***function RB(X,Q=X.schema)***let***gen:$,data:Y,it:W***=X;if(Object.keys(Q).length===0)return;let J=$.let("missing");for(let G in Q)***let H=Q[G];if(H.length===0)continue;let B=(0,W4.propertyInData)($,Y,G,W.opts.ownProperties);if(X.setParams(***property:G,depsCount:H.length,deps:H.join(", ")***),W.allErrors)$.if(B,()=>***for(let z of H)(0,W4.checkReportMissingProp)(X,z)***);else $.if(fY._`$***B*** && ($***(0,W4.checkMissingProp)(X,H,J)***)`),(0,W4.reportMissingProp)(X,J),$.else()***EB.validatePropertyDeps=RB;function IB(X,Q=X.schema)***let***gen:$,data:Y,keyword:W,it:J***=X,G=$.name("valid");for(let H in Q)***if((0,Zj.alwaysValidSchema)(J,Q[H]))continue;$.if((0,W4.propertyInData)($,Y,H,J.opts.ownProperties),()=>***let B=X.subschema(***keyword:W,schemaProp:H***,G);X.mergeValidEvalu
2026-02-09T20:54:55.3034888Z ##[error]Action failed with error: SDK execution error: Error: Claude Code process exited with code 1
2026-02-09T20:54:55.3035717Z 16 | `))X=Z0(X);let Y=`$***new Date().toISOString()*** [$***Q.toUpperCase()***] $***X.trim()***
2026-02-09T20:54:55.3039829Z 17 | `;if(WW())***d7(Y);return***gU().write(Y)***function GW()***return JW()??process.env.CLAUDE_CODE_DEBUG_LOGS_DIR??YW(V4(),"debug",`$***s7()***.txt`)***var fU=k1(()=>***if(process.argv[2]==="--ripgrep")return;try***let X=GW(),Q=z9(X),$=YW(Q,"latest");if(!n0().existsSync(Q))n0().mkdirSync(Q);if(n0().existsSync($))try***n0().unlinkSync($)***catch***n0().symlinkSync(X,$)***catch***);var pU=!1;function F0(X,Q)***let $=performance.now();try***return Q()***finally***performance.now()-$>B9***var dU=***cwd()***return process.cwd()***,existsSync(X)***return F0(`existsSync($***X***)`,()=>h.existsSync(X))***,async stat(X)***return hU(X)***,async readdir(X)***return uU(X,***withFileTypes:!0***)***,async unlink(X)***return lU(X)***,async rmdir(X)***return mU(X)***,async rm(X,Q)***return cU(X,Q)***,statSync(X)***return F0(`statSync($***X***)`,()=>h.statSync(X))***,lstatSync(X)***return F0(`lstatSync($***X***)`,()=>h.lstatSync(X))***,readFileSync(X,Q)***return F0(`readFileSync($***X***)`,()=>h.readFileSync(X,***encoding:Q.encoding***))***,readFileBytesSync(X)***return F0(`readFileBytesSync($***X***)`,()=>h.readFileSync(X))***,readS
2026-02-09T20:54:55.3043715Z 18 | `),F4***function N1(X)***let Q=eU();if(!Q)return;let Y=`$***new Date().toISOString()*** $***X***
2026-02-09T20:54:55.3047660Z 19 | `;tU(Q,Y)***function zW(X,Q)***let $=***...X***;if(Q)***let Y=***sandbox:Q***;if($.settings)try***Y=***...L4($.settings),sandbox:Q***catch***$.settings=Z0(Y)***return $***class XX***options;process;processStdin;processStdout;ready=!1;abortController;exitError;exitListeners=[];processExitHandler;abortHandler;constructor(X)***this.options=X;this.abortController=X.abortController||F6(),this.initialize()***getDefaultExecutable()***return M6()?"bun":"node"***spawnLocalProcess(X)***let***command:Q,args:$,cwd:Y,env:W,signal:J***=X,G=W.DEBUG_CLAUDE_AGENT_SDK||this.options.stderr?"pipe":"ignore",H=XV(Q,$,***cwd:Y,stdio:["pipe","pipe",G],signal:J,env:W,windowsHide:!0***);if(W.DEBUG_CLAUDE_AGENT_SDK||this.options.stderr)H.stderr.on("data",(z)=>***let K=z.toString();if(N1(K),this.options.stderr)this.options.stderr(K)***);return***stdin:H.stdin,stdout:H.stdout,get killed()***return H.killed***,get exitCode()***return H.exitCode***,kill:H.kill.bind(H),on:H.on.bind(H),once:H.once.bind(H),off:H.off.bind(H)***initialize()***try***let***additionalDirectories:X=[],agent:Q,betas:$,cwd:Y,execu
2026-02-09T20:54:55.3051323Z 
2026-02-09T20:54:55.3051470Z error: Claude Code process exited with code 1
2026-02-09T20:54:55.3052124Z       at $ (/home/runner/work/_actions/anthropics/claude-code-action/v1/node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs:19:7857)
2026-02-09T20:54:55.3052771Z       at emit (node:events:98:22)
2026-02-09T20:54:55.3053119Z       at #handleOnExit (node:child_process:520:14)
2026-02-09T20:54:55.3053355Z 
2026-02-09T20:54:55.3053483Z Fetching PR review comment 2784489861
2026-02-09T20:54:55.4915062Z Successfully fetched as PR review comment
2026-02-09T20:54:55.9874146Z ✅ Updated PR review comment 2784489861 with job link
2026-02-09T20:55:00.3039761Z ##[error]Process completed with exit code 1.
2026-02-09T20:55:00.3090419Z ##[group]Run curl -L \
2026-02-09T20:55:00.3090723Z ^[[36;1mcurl -L \^[[0m
2026-02-09T20:55:00.3090984Z ^[[36;1m  -X DELETE \^[[0m
2026-02-09T20:55:00.3091309Z ^[[36;1m  -H "Accept: application/vnd.github+json" \^[[0m
2026-02-09T20:55:00.3091975Z ^[[36;1m  -H "Authorization: ***" \^[[0m
2026-02-09T20:55:00.3092347Z ^[[36;1m  -H "X-GitHub-Api-Version: 2022-11-28" \^[[0m
2026-02-09T20:55:00.3092813Z ^[[36;1m  $***GITHUB_API_URL:-https://api.github.com***/installation/token^[[0m
2026-02-09T20:55:00.3124646Z shell: /usr/bin/bash --noprofile --norc -e -o pipefail ***0***
2026-02-09T20:55:00.3125076Z env:
Edit,MultiEdit,Glob,Grep,LS,Read,Write,mcp__github_comment__update_claude_comment,Bash(git add:*),Bash(git commit:*),Bash(git push:*),Bash(git status:*),Bash(git diff:*),Bash(git log:*),Bash(git rm:*)
2026-02-09T20:55:00.3131152Z   DISALLOWED_TOOLS: WebSearch,WebFetch
2026-02-09T20:55:00.3131468Z ##[endgroup]
2026-02-09T20:55:00.3233504Z   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
2026-02-09T20:55:00.3237105Z                                  Dload  Upload   Total   Spent    Left  Speed
2026-02-09T20:55:00.3237602Z 
2026-02-09T20:55:00.4742622Z   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
2026-02-09T20:55:00.4745125Z   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
2026-02-09T20:55:00.5087811Z Post job cleanup.
2026-02-09T20:55:00.5149996Z Post job cleanup.
2026-02-09T20:55:00.6098418Z [command]/usr/bin/git version
2026-02-09T20:55:00.6149424Z git version 2.52.
bashiransari · 6 months ago

Have the same issue, any updates on this?

shaikegross · 6 months ago

same issue here

haiko-ritense · 6 months ago

same issue here

mark-stell · 6 months ago

getting the same issue

SDK execution error: 14 |     depsCount: ${X},
mark-stell · 6 months ago
getting the same issue `` SDK execution error: 14 | depsCount: ${X}, ``

Uhh I think we get this because our credits below $0. Adding some more 💸 fixed it...

ncryptedV1 · 6 months ago

Seems to be a minified/obfuscated generic error (thrown at least during internal invocation of [TARGET_URL]/v1/messages). Could be

  • an invalid base URL (remember to exclude the /v1 suffix)
  • invalid API key
  • insufficient funds
  • ...

The best way to find out is to test API calls manually and analyze the response - either by following the API specs or by replaying a call from Claude Code. The latter can be achieved by setting the base URL to a trusted HTTP Request Logger.

Maybe using Claude Code directly with the same setup throws a readable error, too.

sstklen · 6 months ago

Hey! I ran into a similar pattern in our bug knowledge base and thought this might help.

What's happening: Claude Code SDK exits with code 1 and dumps minified AJV schema-validation JS when the Anthropic account has insufficient credits ($0 or negative balance). The SDK's error-handling path fails to surface a clear 'insufficient funds' message and instead leaks internal bundled code as the error output.

What worked for us:

Add credits/funds to the Anthropic account. The minified JS dump is a red herring — the actual cause is a 402/billing rejection from the API that the SDK fails to handle gracefully, causing it to crash with an unhelpful error message.

# In your GitHub Actions workflow, verify billing before running:
# 1. Check account: https://console.anthropic.com/settings/billing
# 2. Ensure positive balance
# 3. No code change needed — this is a billing issue masked by poor SDK error handling

# Workaround: add a pre-check step
- name: Verify API key has credits
  run: |
    response=$(curl -s -o /dev/null -w '%{http_code}' \
      -H "x-api-key: ${{ secrets.ANTHROPIC_API_KEY }}" \
      -H "content-type: application/json" \
      -d '{"model":"claude-haiku-4-5-20251001","max_tokens":1,"messages":[{"role":"user","content":"hi"}]}' \
      https://api.anthropic.com/v1/messages)
    if [ "$response" = "402" ]; then
      echo '::error::Anthropic account has insufficient credits. Add funds at console.anthropic.com'
      exit 1
    fi

Hope this helps! Let me know if it doesn't match your case — happy to dig deeper. 🦞

_Disclosure: This analysis is from Confucius Debug, an AI-powered community KB for agent bugs. Please verify before applying._

---
<sub>🦞 Confucius Debug — community knowledge base for AI agent bugs. Free to search via MCP.</sub>

github-actions[bot] · 5 months ago

Closing for now — inactive for too long. Please open a new issue if this is still relevant.

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.