[BUG] /insights command throws TypeError: undefined is not an object (evaluating 'Object.keys(b)')
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?
Bug Description
The /insights slash command throws a TypeError every time it is executed. The error occurs both in the VS Code extension and in the CLI terminal.
Error message:
TypeError: undefined is not an object (evaluating 'Object.keys(b)')
Environment
- Claude Code version: 2.1.34
- OS: macOS (Apple Silicon / arm64) — MacBook Air 2024
- Installation method: Native
- VS Code extension version: 2.1.34 (anthropic.claude-code-2.1.34-darwin-arm64)
Observed Behavior
The command fails instantly with:
/insights
TypeError: undefined is not an object (evaluating 'Object.keys(b)')
What Should Happen?
This happens consistently on every attempt. Tried multiple times in both environments (VS Code integrated terminal and standalone terminal).
Expected Behavior
The /insights command should display session or usage insights without errors.
Additional Context
- The CLI was recently updated from 2.1.19 → 2.1.25 → 2.1.34. The error may be related to data format incompatibility between versions, as the older versions may have stored session/usage data in a different schema than what 2.1.34 expects.
- The
/insightsskill shows 4 usages in.config.json, all resulting in the same error. - Other slash commands (e.g.,
/warmup) work correctly.
Screenshot
[Attach the screenshot showing the error in both VS Code and terminal]
<img width="1334" height="1102" alt="Image" src="https://github.com/user-attachments/assets/08ffb758-76f6-4967-a208-4b8d9866434e" />
Error Messages/Logs
TypeError: undefined is not an object (evaluating 'Object.keys(b)')
Steps to Reproduce
Steps to Reproduce
- Open Claude Code (either via
claudein terminal or via the VS Code extension) - Type
/insightsand press Enter - Error is displayed immediately
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.34
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗