[BUG] CCode loses ability to check on a child and crashes after infinite loop

Resolved 💬 7 comments Opened Sep 7, 2025 by seefood Closed Jan 9, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Without any warning, the CLI tries to hunt down a child process and check on it but fails (process gone?) and it goes into an infinite loop of tracebacks on te screen for 3-5 seconds, until it crashes back to BASH.

This was with client 1.0.103. it worked mostly fine for over 3 weeks but this new behaviour happened 4 times today (IIRC) and on shorter and shorter sessions.

After more copies of that than my terminal can keep in the scroll buffer, it crashes and falls out to bash.

I just upgraded to 1.0.108 and we'll see if it happens again.

more info:

  • macOS version (Darwin 24.6.0)
  • That ulimit is 8192
  • claude was installed by homebrew and didn't upgrade itself since, AFAIK, so I ran claude install and claude update.
  • crash dump seems to refer to google auth but I never gave it access to anything google, so I am worried why it is trying to get there.

What Should Happen?

fail gracefully and don't crash if the child was lost.

Error Messages/Logs

^
EMFILE: too many open files, posix_spawn 'pgrep'
      path: "pgrep",
   syscall: "spawn pgrep",
     errno: -24,
 spawnargs: [ "-P", 2912 ],
      code: "EMFILE"

      at spawn (node:child_process:647:35)
      at spawn (node:child_process:14:39)
      at OJ1 (/$bunfs/root/claude:379:19875)
      at <anonymous> (/$bunfs/root/claude:379:20110)
      at forEach (1:11)
      at Q (/$bunfs/root/claude:379:20049)
      at emit (node:events:98:22)
      at #maybeClose (node:child_process:746:16)
      at emit (node:events:92:22)
374 | `+await Z.crypto.sha256DigestHex(F),w=await jv5(Z.crypto,Z.securityCredentials.secretAccessKey,J,Z.region,Y),N=await mY0(Z.crypto,w,q),M=`${KOG} Credential=${Z.securityCredentials.accessKeyId}/${D}, SignedHeaders=${I}, Signature=${HOG.fromArrayBufferToHex(N)}`;return{amzDate:Q.date?void 0:B,authorizationHeader:M,canonicalQuerystring:Z.canonicalQuerystring}}});var $OG=C((kn)=>{var WR=kn&&kn.__classPrivateFieldGet||function(Z,G,W,Y){if(W==="a"&&!Y)throw new TypeError("Private accessor was defined without a getter");if(typeof G==="function"?Z!==G||!Y:!G.has(Z))throw new TypeError("Cannot read private member from an object whose class did not declare it");return W==="m"?Y:W==="a"?Y.call(Z):Y?Y.value:G.get(Z)},iU,c41,DOG,qOG,OC0,l41;Object.defineProperty(kn,"__esModule",{value:!0});kn.DefaultAwsSecurityCredentialsSupplier=void 0;class wOG{constructor(Z){iU.add(this),this.regionUrl=Z.regionUrl,this.securityCredentialsUrl=Z.securityCredentialsUrl,this.imdsV2SessionTokenUrl=Z.imdsV2SessionTokenUrl,this.additionalGaxi | ... truncated
375 | To learn more about authentication and Google APIs, visit:
376 | https://cloud.google.com/docs/authentication/getting-started`,NO_CREDENTIALS_FOUND:`Unable to find credentials in current environment.
377 | To learn more about authentication and Google APIs, visit:
378 | https://cloud.google.com/docs/authentication/getting-started`,NO_ADC_FOUND:"Could not load the default credentials. Browse to https://cloud.google.com/docs/authentication/getting-started for more information.",NO_UNIVERSE_DOMAIN_FOUND:`Unable to detect a Universe Domain in the current environment.
379 | https://cloud.google.com/compute/docs/metadata/predefined-metadata-keys`};class QJ1{get isGCE(){return this.checkIsGCE}constructor(Z={}){if(Cy.add(this),this.checkIsGCE=void 0,this.jsonContent=null,this.cachedCredential=null,bn.set(this,null),this.clientOptions={},this._cachedProjectId=Z.projectId||null,this.cachedCredential=Z.authClient||null,this.keyFilename=Z.keyFilename||Z.keyFile,this.scopes=Z.scopes,this.clientOptions=Z.clientOptions||{},this.jsonContent=Z.credentials||null,this.apiKey=Z.apiKey||this.clientOptions.apiKey||null,this.apiKey&&(this.jsonContent||this.clientOptions.credentials))throw new RangeError(q7.GoogleAuthExceptionMessages.API_KEY_WITH_CREDENTIALS);if(Z.universeDomain)this.clientOptions.universeDomain=Z.universeDomain}setGapicJWTValues(Z){Z.defaultServicePath=this.defaultServicePath,Z.useJWTAccessWithScope=this.useJWTAccessWithScope,Z.defaultScopes=this.defaultScopes}getProjectId(Z){if(Z)this.getProjectIdAsync().then((G)=>Z(null,G),Z);else return this.getProjectIdAsync()}async getProje | ... truncated

TypeError: undefined is not an object (evaluating 'B.stdout.on')
      at OJ1 (/$bunfs/root/claude:379:19892)
      at <anonymous> (/$bunfs/root/claude:379:20110)
      at forEach (1:11)
      at Q (/$bunfs/root/claude:379:20049)
      at emit (node:events:98:22)
      at #maybeClose (node:child_process:746:16)
      at emit (node:events:92:22)
      at emitCloseNT (internal:streams/destroy:78:14)
642 |     var file = this.spawnfile = options.file, spawnargs;
643 |     if (options.args === @undefined)
644 |       spawnargs = this.spawnargs = [];
645 |     else
646 |       validateArray(options.args, "options.args"), spawnargs = this.spawnargs = options.args;
647 |       if (this.#handle = Bun.spawn({

Steps to Reproduce

happens sporadically, no idea what triggered it.

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

1.0.103 installed by homebrew

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

the main change in config I did this morning was compact the global CLAUDE.md to stricter language. it's actually 75% shorter than before (2k vs 8k), but it still ignores many of my rules.

View original on GitHub ↗

This issue has 7 comments on GitHub. Read the full discussion on GitHub ↗