How code-x-rahul/claude-focus-vscode works
Claude Focus is a VS Code extension that installs a Claude Code notification hook, receives its localhost focus request, and brings VS Code forward. The main path is Claude Code → local HTTP endpoint → focus behavior and user notification; users can also set up/remove the hook or trigger focus manually. The sampled implementation places most responsibilities in src/extension.ts, so nodes distinguish runtime responsibilities rather than implying separate modules. Platform-specific behavior and optional Linux helpers are documented, but only the sampled source supports the implementation links shown.
Main entry points: extension.ts Focus dispatcher
Components 13
Hook management
- Claude settings
src/extension.ts - Hook setup/removal
src/extension.ts - Hook command
src/extension.ts
Request runtime
- Command registration
src/extension.ts - Local HTTP server
src/extension.ts - Focus request handler
src/extension.ts
Focus and alerts
- Focus dispatcher
src/extension.ts - VS Code window
- Platform window tools
- User notifications
src/extension.ts - Linux helpers
Other components
- VS Code user
- Claude Code
Connections 14
- VS Code user → Command registration: invokes commands
src/extension.ts - Command registration → Focus dispatcher: invokes focus
src/extension.ts - Command registration → Hook setup/removal: invokes setup/removal
src/extension.ts - Hook setup/removal → Claude settings: reads/writes
src/extension.ts - Hook setup/removal → Hook command: registers command
src/extension.ts - Claude Code → Local HTTP server: posts notification
README.md - Hook command → Local HTTP server: posts request
src/extension.ts - Local HTTP server → Focus request handler: routes request
src/extension.ts - Focus request handler → Focus dispatcher: invokes focus
src/extension.ts - Focus dispatcher → VS Code window: raises window
src/extension.ts - Focus dispatcher → Platform window tools: executes platform action
src/extension.ts - Focus dispatcher → User notifications: shows alert
src/extension.ts - Focus dispatcher → Linux helpers: may invoke
README.md - User notifications → VS Code user: alerts
src/extension.ts