claude-code - 💡(How to fix) Fix Crash in resume picker: TypeError: Cannot read properties of undefined (reading 'trim') [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#51849Fetched 2026-04-23 07:43:17
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Author
Participants
Timeline (top)
labeled ×4

The interactive resume picker (claude --resume) crashes with TypeError: Cannot read properties of undefined (reading 'trim') when the session list contains entries that are "continued from a previous conversation" (i.e. auto-compaction continuations). The crash fires repeatedly on every keystroke / render, making the picker unusable.

This update genuinely broke my ability to get back to work — filing alongside #51842 (the related UX gap where there's no in-app resume path at all).

Error Message

TypeError: Cannot read properties of undefined (reading 'trim')
    at nh6 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1708:4403)
    at pw (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:72:19414)
    at Mt (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:42806)
    at b9 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:38347)
    at Up (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:38275)
    at B$ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:38129)
    at Mz (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:35208)
    at ZQ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:72:4840)
    at J5 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:32453)
    at Q.updateContainer (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:78:1827)

Likely cause: nh6 in cli.js:1708 calls .trim() on a field (probably the first user message / title) that is undefined for continuation sessions, because the "continued from previous" entries don't have a user message in the usual slot.

Root Cause

Likely cause: nh6 in cli.js:1708 calls .trim() on a field (probably the first user message / title) that is undefined for continuation sessions, because the "continued from previous" entries don't have a user message in the usual slot.

Fix Action

Workaround

Resume by explicit session ID, bypassing the picker entirely:

claude --resume <session-uuid-from-~/.claude/projects/>

This works, which confirms the crash is purely in the picker's render/formatting code — the underlying session data is fine.

Code Example

TypeError: Cannot read properties of undefined (reading 'trim')
    at nh6 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1708:4403)
    at pw (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:72:19414)
    at Mt (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:42806)
    at b9 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:38347)
    at Up (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:38275)
    at B$ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:38129)
    at Mz (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:35208)
    at ZQ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:72:4840)
    at J5 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:32453)
    at Q.updateContainer (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:78:1827)

---

claude --resume <session-uuid-from-~/.claude/projects/>
RAW_BUFFERClick to expand / collapse

Summary

The interactive resume picker (claude --resume) crashes with TypeError: Cannot read properties of undefined (reading 'trim') when the session list contains entries that are "continued from a previous conversation" (i.e. auto-compaction continuations). The crash fires repeatedly on every keystroke / render, making the picker unusable.

This update genuinely broke my ability to get back to work — filing alongside #51842 (the related UX gap where there's no in-app resume path at all).

Reproduction

  1. Work long enough in a session that context auto-compacts, producing "This session is being continued from a previous conversation that ran out of context. The summary below covers the earlier p…" entries.
  2. Quit Claude Code.
  3. From the project directory, run claude --resume.
  4. Picker renders with ~8 continuation entries, all sharing that same truncated summary prefix.
  5. Pressing arrow keys / trying to select any entry (or sometimes just opening the picker) throws the stack trace below, repeated many times per render cycle.

Stack trace

TypeError: Cannot read properties of undefined (reading 'trim')
    at nh6 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1708:4403)
    at pw (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:72:19414)
    at Mt (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:42806)
    at b9 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:38347)
    at Up (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:38275)
    at B$ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:38129)
    at Mz (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:35208)
    at ZQ (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:72:4840)
    at J5 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:74:32453)
    at Q.updateContainer (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:78:1827)

Likely cause: nh6 in cli.js:1708 calls .trim() on a field (probably the first user message / title) that is undefined for continuation sessions, because the "continued from previous" entries don't have a user message in the usual slot.

Workaround

Resume by explicit session ID, bypassing the picker entirely:

claude --resume <session-uuid-from-~/.claude/projects/>

This works, which confirms the crash is purely in the picker's render/formatting code — the underlying session data is fine.

Environment

  • Claude Code: 2.0.33
  • Node: v25.6.0
  • OS: macOS 15.6.1 (Darwin 24.6.0, ARM64)
  • Install: /opt/homebrew/lib/node_modules/@anthropic-ai/claude-code

Impact

Blocks resume from the interactive picker for any user whose sessions have auto-compacted (i.e. any long-running work). Combined with the lack of an in-app resume flow (#51842), it's a rough experience after an update.

extent analysis

TL;DR

The issue can be temporarily worked around by resuming sessions using the explicit session ID, bypassing the interactive picker.

Guidance

  • The error occurs because the nh6 function in cli.js attempts to call .trim() on an undefined field, likely due to the absence of a user message in continuation sessions.
  • To verify the issue, reproduce the steps provided in the reproduction section and check for the TypeError: Cannot read properties of undefined (reading 'trim') error.
  • As a workaround, use the command claude --resume <session-uuid-from-~/.claude/projects/> to resume sessions, bypassing the picker.
  • The underlying session data appears to be intact, as resuming via session ID works correctly.

Example

claude --resume <session-uuid-from-~/.claude/projects/>

This command allows resuming a session by its ID, avoiding the crashed interactive picker.

Notes

The provided workaround confirms that the issue lies in the picker's rendering code, rather than the session data itself. However, a permanent fix would require addressing the root cause in the nh6 function.

Recommendation

Apply the workaround by resuming sessions using the explicit session ID, as it allows users to continue working despite the picker issue.

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

claude-code - 💡(How to fix) Fix Crash in resume picker: TypeError: Cannot read properties of undefined (reading 'trim') [1 participants]