Skip to content

feat: Claude Desktop Code mode session support #111

@grimmerk

Description

@grimmerk

Summary

Add Claude Desktop "Code" mode sessions to CodeV's session list, similar to VS Code session support (PR #103).

Feasibility Research

Claude Desktop's Code mode shares the same ~/.claude/ data layer. Integration feasibility:

Capability Status How
Detect sessions ~/.claude/sessions/*.json with entrypoint: "claude-desktop"
Session metadata Same JSONL format as CLI/VS Code
Status dots Hooks fire normally, codev-status files work
Bring to foreground open -a "Claude"
Switch to specific session claude:// URI exists but accepted parameters unknown
history.jsonl Not present (same gap as VS Code)
IDE lock file Not created by Claude Desktop

Why it doesn't appear now

detectActiveSessions() only handles claude-vscode specially (reads JSONL directly). claude-desktop falls into the CLI path which requires history.jsonl matching — but Claude Desktop sessions aren't in history.jsonl.

Fix

Treat claude-desktop the same as claude-vscode in:

  • detectActiveSessions() — read JSONL directly instead of matching against history.jsonl
  • scanClosedVSCodeSessions() — rename/extend to also scan for claude-desktop entrypoint
  • Display: [DESKTOP] badge
  • Switch: open -a "Claude" (app-level only, no session-level switching yet)

Comparison with VS Code support

VS Code Claude Desktop
entrypoint claude-vscode claude-desktop
JSONL format Same Same
history.jsonl
IDE lock file
URI handler (session-level) vscode://...?session=UUID claude:// exists, params unknown
Hooks/status
Switch precision Session-level (URI handler) App-level only (open -a "Claude")

Session data observed

~/.claude/sessions/38228.json:

{
  "pid": 38228,
  "sessionId": "033bedee-f8d7-4331-a040-39ce09ed7e78",
  "cwd": "/Users/grimmer/git/claude-desktop-claude-code-test",
  "startedAt": 1775483211434,
  "kind": "interactive",
  "entrypoint": "claude-desktop"
}

Process spawned as child of Claude.app with --output-format stream-json --permission-mode acceptEdits and LSP plugins (rust, typescript, swift, frontend-design).

Open questions

  1. Does claude:// URI support session parameters? (e.g., claude://code?session=UUID)
  2. Does Claude Desktop's ~/Library/Application Support/Claude/local-agent-mode-sessions/ contain useful session metadata?
  3. Will Claude Desktop eventually write to history.jsonl?

Related

🤖 On behalf of @grimmerk — generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions