[BUG] Claude Code SDK crashes with exit code 1 in GitHub Actions (v2.1.31)
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:
- Run: https://github.com/AgoraSystems/mobile/actions/runs/21656755102/job/62433011027
- Trigger: workflow_dispatch
- Time: 2026-02-04T03:04:25Z
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.
12 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
same issue here
Also hitting this issue on v2.1.31
Have the same issue, any updates on this?
same issue here
same issue here
getting the same issue
Uhh I think we get this because our credits below $0. Adding some more 💸 fixed it...
Seems to be a minified/obfuscated generic error (thrown at least during internal invocation of
[TARGET_URL]/v1/messages). Could be/v1suffix)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.
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.
Hope this helps! Let me know if it doesn't match your case — happy to dig deeper. 🦞
---
<sub>🦞 Confucius Debug — community knowledge base for AI agent bugs. Free to search via MCP.</sub>
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
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.