$ show andrewmccalip/kickbacks.ai
The Kickbacks extension is a VS Code extension that monetizes IDE 'thinking' spinners in Claude Code and Codex by rendering clickable sponsored ads and sharing up to 50% of ad revenue with developers. It operates as a modular TypeScript application with a complex activation orchestrator managing subsystems for authentication, ad rotation, metrics, earnings, kill switch, consent, self-update, and UI components. The extension uses a local loopback server for secure communication between the extension and injected code in webviews/CLI, implements feature flags via sentinel files, and employs OS-native credential storage. Its architecture centers around adapters for Claude Code (webview and CLI) and Codex (webview), with centralized state management and serving gates controlling ad display based on kill switches, user preferences, and canary states. The code demonstrates strong engineering practices in areas like secure token handling, deduplication, and resilience patterns, though it remains tightly coupled to its specific ad-serving backend and third-party tool integrations.
The LLM identified 5 files worth highlighting for reuse:
Implements a singleton local HTTP server for secure communication between the VS Code extension and injected code in webviews (Claude Code, Codex). Includes token-based authentication, CORS handling, and test hooks. Demonstrates the pattern of creating a trusted local channel for extension-to-sandboxed-content communication, reusable in any Electron or desktop application with webviews.
Manages feature flags by checking for the presence of sentinel files in the user's home directory (~/.vibe-ads/). Allows runtime enabling/disabling of features (webview, CLI, banner) without code changes or restarts. Demonstrates a simple, persistent, and overridable feature flag pattern using the file system, reusable in any desktop application for canary releases, debugging, or user opt-in/out.
Provides OS-native secure storage (Keychain on macOS, Credential Locker on Windows, Secret Service on Linux) for sensitive data like tokens, with a fallback to encrypted file storage. Includes atomic writes and backup handling. Demonstrates a robust pattern for cross-platform secret management in desktop applications, reusable in any Node.js app requiring secure credential storage.
Centralizes the decision to serve ads based on multiple factors: global kill switch (with confirmed/offline/recovery states), user opt-in (K_ON flag), and canary suspension. Implements a state machine that safely combines these conditions to prevent ad serving when inappropriate. Demonstrates a reusable pattern for hierarchical feature gating where multiple overlapping conditions (global, user, rollout) must be evaluated to determine feature availability.
Centralizes session state (signed-in status, ad presence, kill switch state, Claude Code version) with a publish/subscribe mechanism for state changes. Allows decoupled components (adapters, metrics, UI) to react to state updates without tight coupling. Demonstrates a reusable pattern for application-wide state management using an event emitter, avoiding prop drilling and enabling loose coupling between modules.