OpenEyes is a browser extension that allows you to select any element on a web page and send it—along with its HTML source and a cropped screenshot—directly to a running OpenCode or Claude Code session.
It's designed to bridge the gap between your browser and your development environment, making it easy to share UI components, bug reports, or layout snippets with your AI-assisted coding tools.
- Visual Element Picker: Click any element on the page to select it.
- Contextual Capture: Automatically captures the element's HTML, CSS selector, and page metadata.
- Smart Screenshots: Captures a precise, cropped screenshot of the selected element.
- Direct Integration: Sends captured data to the OpenCode API (defaults to
http://127.0.0.1:4096) or to a running Claude Code session via a channel (defaults tohttp://127.0.0.1:4097). - Flexible Controls: Toggle whether to include the source code or the screenshot before sending.
Chrome - TBD
-
Clone the repository:
git clone https://github.com/your-username/openeyes.git cd openeyes -
Install dependencies: The project uses
web-extfor development andjustas a command runner.# Ensure you have 'just' installed (https://just.systems/man/en/installation.html) # Ensure you have 'bun' or 'npm' for running web-ext
-
Run in Development Mode: This will launch Firefox with the extension loaded.
just dev
- Open your browser's extension management page (
about:debuggingin Firefox,chrome://extensionsin Chrome). - Enable "Developer mode" if required.
- Click "Load Temporary Add-on" (Firefox) or "Load unpacked" (Chrome).
- Select the relevant extension directory in this project.
- Start OpenCode: Ensure your OpenCode server is running with a specified port (i.e.
opencode --port 4096). - Configure: Click the OpenEyes icon in your browser toolbar to set your Server URL and Auth Password (if applicable), and select a session (defaults to latest).
- Pick an Element:
- Click the Pick Element button in the popup.
- Hover over the page to highlight elements.
- Click to select an element.
- Send to OpenCode:
- Add an instruction (e.g., "Explain this component" or "Refactor this button").
- Toggle Source and/or Screenshot options.
- Press Send or
Ctrl+Enter.
The relevant information is then send to the opencode session you selected, and you can continue the conversation in the terminal as usual.
Settings are persisted in local storage:
- Server URL: The base URL of your OpenCode instance (default:
http://127.0.0.1:4096). - Session ID: Which session to send messages to. "Auto" picks the most recently updated session.
- Auth Password: Used for Basic Auth if your OpenCode instance requires it.
Tip
To automatically start the opencode cli with the port 4096, update your opencode configuration with the following information:
{
"$schema": "https://opencode.ai/config.json",
"server": { "port": 4096 }
}The project includes a justfile for common tasks:
just run: Launches the extension in Firefox for testing.just lint: Lints the extension code usingweb-ext.just build: Packages the extension intodist/openeyes.zip.just xpi: Builds a signed or unsigned.xpifile for distribution.just clean: Removes thedist/directory.
OpenEyes can also push into a running Claude Code session via a local
channel plugin that ships in this
repo under claude-code-plugin/.
Setup:
- Install dependencies:
just channel-install(orcd claude-code-plugin && bun install). - Register the server with Claude Code. Print a ready-to-paste config with
just channel-mcp-configand add it to a project-level.mcp.jsonor to~/.claude.json. - Launch Claude Code with the channel enabled (research-preview flag required):
The server binds to
claude --dangerously-load-development-channels server:openeyes
127.0.0.1:4097automatically — don't run it yourself. - In the extension popup, set Backend to Claude Code, paste the token from
just channel-tokeninto Channel token, and send.
Selected elements arrive in the session as a <channel source="openeyes" ...> event with the HTML, selector, and a file_path meta attribute pointing at the cropped screenshot.
Not supported yet — see openai/codex#15299.
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) - see the LICENSE file for details.