MODULO 7.6

🖥️ Desktop App Integration

6
Topicos
~60
Minutos
Deep
Nivel
Source
Tipo
1

💻 Four Integration Layers

Claude Desktop Handoff

/desktop command flushes sessions and opens via deep link claude://resume.

IDE Integration

Auto-detects VS Code, Cursor, Windsurf, 14+ JetBrains IDEs via lockfiles.

Claude in Chrome

Native messaging host manifest for browser extension tool invocation.

Computer Use MCP

Subscription-gated OS-level automation (screenshots, input, app control).

2

🔗 Desktop Handoff

Six-state machine: checking, prompt_download, flushing, opening, success, error. Deep link: claude://resume?session=uuid&cwd=path. Critical step: flushSessionStorage() writes all buffered turns to disk before opening.

💡 Platform Detection

macOS: check /Applications/Claude.app. Linux: xdg-mime query. Windows: HKEY_CLASSES_ROOT\claude registry.

3

🖥️ IDE Integration

Detection via ~/.claude/ide/.lock files written by IDE plugins. Lockfiles contain workspaceFolders, pid, ideName, transport type, authToken. Stale locks filtered via process.kill(pid, 0).

💡 Terminal Detection Shortcut

Before scanning lockfiles, checks TERM_PROGRAM env var against known IDE names. Returns immediately without filesystem I/O.

4

🌐 Claude in Chrome

Native messaging host manifest maps com.anthropic.claude_code_browser_extension to wrapper script invoking CLI with --chrome-native-host. Supports Chrome, Chromium, Brave, Edge, Opera, Vivaldi, Arc.

💡 Auto-Enable

Detects if extension installed and tengu_chrome_auto_enable GrowthBook flag is set. Disabled by default in non-interactive sessions.

5

🖱️ Computer Use MCP

Most heavily gated integration. Triple-gated: build-time feature('CHICAGO_MCP'), Max/Pro subscription, GrowthBook experiment tengu_malort_pedway. Codename 'Chicago'/'Malort'.

💡 Coordinate Mode Freeze

Coordinate mode (pixels vs normalized) freezes at first read. A live GrowthBook flip mid-session would cause model to think in one space while executor transforms in another.

6

📦 Native Installer

Binary lifecycle: ~/.local/share/claude/versions/ (permanent), ~/.cache/claude/staging/ (temporary), ~/.local/bin/claude (symlink). Keeps 2 versions on disk. PID-based lockfiles with 7-day stale timeout.

💡 Portable Session Storage

sessionStoragePortable.ts is dependency-free, shared verbatim with VS Code extension package. Same code reads session transcripts in both CLI and IDE plugin.

📋 Resumo do Modulo

/desktop command is a 6-state React machine that flushes session and hands off via deep link.
IDE detection uses ~/.claude/ide/.lock files supplemented by TERM_PROGRAM environment variable.
Claude in Chrome uses native messaging protocol with manifest mapping to wrapper script.
Computer use is triple-gated: build-time feature flag, subscription check, GrowthBook experiment.
All desktop-mode fast paths handled before config/analytics initialization for minimal overhead.
sessionStoragePortable.ts is dependency-free for sharing with VS Code extension package.
Voltar