Sidebar icon missing in Cursor due to secondary sidebar detection
Bug Description
The Claude Code sidebar icon intermittently does not appear in the activity bar when using Cursor. The behavior is inconsistent — sometimes it shows, sometimes it doesn't, regardless of whether opening a workspace, devcontainer, or plain window.
Root Cause Analysis
The extension's package.json registers the activity bar view container with a when clause:
"activitybar": [
{
"id": "claude-sidebar",
"title": "Claude Code",
"icon": "resources/claude-logo.svg",
"when": "claude-code:doesNotSupportSecondarySidebar"
}
],
"secondarySidebar": [
{
"id": "claude-sidebar-secondary",
"title": "Claude Code",
"icon": "resources/claude-logo.svg",
"when": "!claude-code:doesNotSupportSecondarySidebar"
}
]
Cursor inconsistently reports secondary sidebar support. The claude-code:doesNotSupportSecondarySidebar context key gets set to false (meaning "supports secondary sidebar"), so the primary activity bar icon is hidden and the extension tries to use the secondary sidebar instead. But Cursor's secondary sidebar support is broken/incomplete — running "Open in Sidebar" via the command palette even shows a "second sidebar not supported" message before falling back to the primary sidebar.
The result: no activity bar icon visible, and the only way to access Claude Code is via Cmd+Shift+P → "Claude Code: Open in Sidebar".
Steps to Reproduce
- Install Claude Code extension in Cursor (tested on v2.4.37, arm64, macOS)
- Open any workspace or window
- Observe that the Claude Code icon may not appear in the activity bar
- Running "Claude Code: Open in Sidebar" from the command palette briefly shows "second sidebar not supported" then opens in the primary sidebar
Expected Behavior
The Claude Code icon should always be visible in the activity bar when using Cursor, since Cursor does not reliably support the secondary sidebar.
Current Workaround
None that persists across restarts. The claudeCode.preferredLocation: "sidebar" setting is set but does not affect whether the activity bar icon is registered (it only controls where the webview opens, not the when clause on the view container).
Suggested Fix
- Detect Cursor specifically (e.g. via
vscode.env.appNameorvscode.env.uriScheme) and forceclaude-code:doesNotSupportSecondarySidebartotrue - Or decouple the activity bar icon visibility from secondary sidebar support — always register the activity bar icon regardless, so users have a reliable entry point
Environment
- Editor: Cursor 2.4.37 (arm64, macOS 14.2)
- Extension version: anthropic.claude-code 2.1.70
- OS: macOS Sonoma (Darwin 23.2.0)
- Setting:
claudeCode.preferredLocation: "sidebar"is set
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗