Cannot read properties of undefined (reading 'trim') when using --continue flag

Resolved 💬 3 comments Opened Jan 28, 2026 by kylepolich Closed Feb 1, 2026

Description

Running claude --continue throws an error:

ERROR  Cannot read properties of undefined (reading 'trim')

file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2861:6198

-E_7 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2861:6198)
-A2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:739:21820)
-J9 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:739:38061)
-pP (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:739:49007)
-PR (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:739:85342)
-is (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:739:84348)
-ls (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:739:84174)
-Km (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:739:81067)
-r1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:739:8794)
-Immediate.k (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:732:5108)

Environment

  • OS: macOS (Darwin 24.0.0)
  • Platform: darwin (Apple Silicon - homebrew install path suggests arm64)
  • Installation method: npm global install (/opt/homebrew/lib/node_modules/@anthropic-ai/claude-code)

Steps to Reproduce

  1. Have a previous Claude Code session
  2. Run claude --continue
  3. Error occurs

Expected Behavior

The previous conversation should resume.

Actual Behavior

Throws Cannot read properties of undefined (reading 'trim') error.

Notes

The error appears to be in the session/conversation loading code where a value expected to be a string is undefined before .trim() is called on it.

View original on GitHub ↗

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