claude-code - 💡(How to fix) Fix Bug: resume fails with 'g9H is not a function' - all session-env directories are empty [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#54600Fetched 2026-04-30 06:41:11
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×3subscribed ×1

Error Message

Session resume fails with error g9H is not a function even on fresh/new sessions. All previous sessions are also unable to resume. 3. Error: g9H is not a function

  • Error occurs at session restore/bootstrap phase

Root Cause

All ~/.claude/session-env/{session-id}/ directories are empty (0 bytes). There are 35 session directories and none contain any state files.

Expected files that should exist in each session-env directory:

  • state.json or similar state persistence file

Without these files, the resume logic attempts to call a function (g9H) on undefined/null data.

RAW_BUFFERClick to expand / collapse

Bug Description

Session resume fails with error g9H is not a function even on fresh/new sessions. All previous sessions are also unable to resume.

Steps to Reproduce

  1. Have an existing Claude Code session
  2. Attempt to resume it (either automatically or via /resume)
  3. Error: g9H is not a function

Root Cause Analysis

All ~/.claude/session-env/{session-id}/ directories are empty (0 bytes). There are 35 session directories and none contain any state files.

Expected files that should exist in each session-env directory:

  • state.json or similar state persistence file

Without these files, the resume logic attempts to call a function (g9H) on undefined/null data.

Environment

  • Platform: macOS (darwin 25.3.0)
  • Claude Code version: 2.1.120 → upgraded to 2.1.123
  • Installation: npm global (/opt/homebrew/lib/node_modules/@anthropic-ai/claude-code)
  • teammateMode: "tmux" enabled in settings

Additional Context

  • This affects ALL sessions, not just one specific session
  • Even sessions created after the upgrade fail to resume
  • The session-data/*.tmp files exist and contain valid session content
  • The session-env/ directories are created but remain empty
  • Error occurs at session restore/bootstrap phase

Expected Behavior

Sessions should be resumable. The session-env/ directories should contain state files necessary for session recovery.

Impact

Critical - No sessions can be resumed, forcing users to start new sessions and lose conversation history.

extent analysis

TL;DR

The issue can be mitigated by ensuring that the session-env directories contain the necessary state files, such as state.json, which are required for session resume functionality.

Guidance

  • Verify that the session-env directories are being populated correctly by checking the code responsible for creating and writing to these directories.
  • Investigate why the state.json files are not being generated or written to the session-env directories, despite the presence of session-data/*.tmp files containing valid session content.
  • Check the upgrade process from version 2.1.120 to 2.1.123 for any potential issues that may have caused the loss of session state files.
  • Consider temporarily downgrading to version 2.1.120 to see if the issue persists, which could help determine if the problem is specific to the newer version.

Example

No code snippet is provided as the issue does not contain sufficient information about the specific code responsible for populating the session-env directories.

Notes

The issue seems to be related to the missing state files in the session-env directories, which are necessary for session resume functionality. The presence of session-data/*.tmp files suggests that session data is being generated, but it is not being properly written to the session-env directories.

Recommendation

Apply a workaround to ensure that the session-env directories are populated with the necessary state files, such as manually creating the state.json files or modifying the code to correctly write to these directories. This is recommended because the issue is critical and affects all sessions, and a workaround can provide a temporary solution until the root cause is fully understood and addressed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING