No Terminal Needed
Inspect & Ask
Press Alt+Shift+C, click an element, and click Add to chat.
The element becomes a chip in the composer of this tab's side-panel chat; ask your question,
and once you send it the panel's agent has the element's selector, place, source file and screenshot, and can act on it in this tab.
Or switch to Terminal session (ocs): write what should change, and chrome-use sends your words, the element's
source file and line, a screenshot and its styles through ocs to the Claude Code, Codex or Pi session already working
on that project, and that agent edits the code. It works on local dev servers and on test-environment domains,
in the Chrome you are already logged in to.
Getting started
- Install chrome-use and the extension. The side-panel chat needs extension 0.5.69 or later and CLI 1.5.223 or later; a terminal session needs extension 0.5.57 or later and CLI 1.5.214 or later (for path scopes, claims and tab-only targets).
- Only for a terminal session: install ocs and keep a Claude Code, Codex or Pi session open in the project folder. Without ocs the panel shows the install command and keeps your draft.
- Press
Alt+Shift+Con the page, or click Inspect element in the toolbar popup. For a terminal session, the first time it asks you to enable the feature. Change the shortcut atchrome://extensions/shortcuts. - Click an element. Shift+click or drag a box to select several (up to 8); β/β move to the parent or child; P pauses page animations so moving things are easy to hit; Esc exits.
- At the top of the panel, choose where it goes: Side panel chat (the default) or Terminal session (ocs); the choice is remembered per site. Each element can carry its own note, and you can draw on its screenshot. For the side-panel chat, optionally write a question and press Enter or Add to chat (see the next section); for a terminal session, write the change and press Enter or Send. Shift+Enter adds a line.
Into the side-panel chat (default)
The most direct way in is the side panel itself: the crosshair Pick element button at the start of the composer toolbar. Click it to start picking (the button lights up and the composer says "Click an element on the page Β· Shift+click for several Β· Esc cancels"),
then click an element on the page: it flashes "Added to chat" and appears as a chip in the composer at once; picking ends and the cursor is back in the message box. Hold Shift to pick several; click the button again, Cancel, or Esc to stop.
The screenshot and source location fill in afterwards (a small dot on the chip means they are still coming); a source found shows as file:line, none found shows nothing. The button is disabled on chrome:// and similar pages.
A click in the side panel does not grant activeTab the way the shortcut does, so on a site the extension cannot access yet Chrome asks you once to allow it.
The in-page panel from Alt+Shift+C can send to the side panel too:
- Add to chat opens this tab's own side panel (or adds to it if it is open), puts the elements above its composer as chips, and puts the question from the picker into its message box. Nothing is sent, and a conversation already running in the panel is not touched.
- Pick as often as you like: chips add up to 8; picking the same element again replaces its chip. Γ on a chip removes it.
- When you send, the message carries each element's context: selector, page address, which iframe or shadow DOM it is in, a JavaScript expression that finds it from the top document, the source location when one was found, its text, an HTML snippet and your note; screenshots go as image attachments (at most 5 together with your own images). The panel's agent works in this tab by default, so it can read or click the element by its selector. The transcript shows your words, with the element context folded under "N picked elements".
- If the page navigates or reloads after picking, the chip stays and is marked "page changed"; the agent is told the element may no longer be there. Closing the tab clears its chips.
- Elements inside open shadow roots and same-origin iframes can be picked. A cross-origin iframe is picked as a whole, without its content; a closed shadow root only offers its host element.
- Chips live only in the extension's session storage (gone when the browser closes), out of the page's reach; once picking ends the page keeps no element, attribute or global from it.
Into a terminal session (ocs)
The first send on a site asks two things: which project folder the site belongs to, and which session gets the request. Candidates come from the local dev server's process folder, the working folders of ocs sessions, and which projects actually contain the source files the page names. The choice is remembered per site. Review or remove bindings in the Inspect & Ask card of the extension options.
How a page finds its project and session
The first pick on a site (optionally per path) shows one card: "Send requests from this scope to a session (its folder) in a project", with the evidence: project config, local dev server, matched source files, and how the deployed revision relates to your checkout. Hand over makes it the site default with no further questions; Only this tab applies to this tab until it reloads; Choose another lists the other candidates. Only locally verifiable evidence preselects: a project config or the local port's process folder, and exactly one running session in that project. Source paths and revisions from the page only rank.
Project config: .chrome-use/inspect.json
The easiest route for test environments: commit a config that names the domains of each app, shared by the whole team.
{
"version": 1,
"sourceRoots": ["../../packages/ui"],
"sites": [
{ "origins": ["https://test-admin.x.com", "http://localhost:5173"] },
{ "origins": ["https://*.preview.x.com"], "pathScope": "/admin" }
]
}
- The directory above
.chrome-useis the app root, so a monorepo can have one per app. pathScopematches whole path segments:/admincovers/admin/orders, not/administrator. Only needed when several apps share a domain.- A single-label wildcard
https://*.preview.x.comis supported: scheme and port must match, exact domains win, and a confirmation binds only the exact domain you are on. - A top-level
sourceRootscan list shared package directories (relative to the app root); they are shown on the card and count as the page's source only after you confirm. - Only git-tracked configs in the repositories of running sessions are read; a symlinked, oversized (over 64 KiB), unknown-version or unknown-field file is rejected with a note in the panel.
Claim a site from a session
# run inside the agent session that should receive requests
$ chrome-use inspect link https://test-admin.x.com/
$ chrome-use inspect link https://apps.x.com/shop --path-scope /shop
$ chrome-use inspect list
$ chrome-use inspect unlink https://test-admin.x.com/
The command identifies the session through ocs. When the site, or a path overlapping it, already belongs to another session, nothing is overwritten:
a pending claim appears in the panel, where you replace or keep the current target; until then requests keep going to the current one.
unlink removes only the calling session's own binding.
When the bound session exits, moves to another folder, or the local port is taken by a dev server from another folder, the card comes back instead of redirecting silently. Different git worktrees of one repository are different projects.
Source locations: add code-inspector-plugin
To show file:line, the project marks its DOM at build time. chrome-use reads the
data-insp-path attribute that code-inspector-plugin
adds; it supports Vite, webpack, Rspack, esbuild and Turbopack, with React, Vue, Svelte and more. When a page has no marks,
the panel lists the exact changes and asks whether your agent should make them. Or add it yourself:
// vite.config.ts
import { codeInspectorPlugin } from 'code-inspector-plugin';
export default defineConfig({
plugins: [
codeInspectorPlugin({ bundler: 'vite', pathType: 'relative', hotKeys: false }),
// ...your other plugins
],
});
// webpack.config.js / vue.config.js (configureWebpack)
const { codeInspectorPlugin } = require('code-inspector-plugin');
module.exports = {
plugins: [codeInspectorPlugin({ bundler: 'webpack', pathType: 'relative', hotKeys: false })],
};
hotKeys: false turns off the plugin's own Option/Alt+Shift element picker, which would otherwise react when you press Alt+Shift+C.
chrome-use only reads the data-insp-path marks; keep the plugin's picker if you use it, at the cost of both reacting to that shortcut.
Without the plugin it still works: React 18 and earlier dev builds expose a component's source location, and Vue dev builds expose the component file. When neither is there, the message says "no source location" and carries the selector and text so the agent can search. React 19 removed per-component source locations, so React 19 projects should add the plugin.
In our tests, code-inspector-plugin 2.0.9 builds carry absolute paths in the marks (on a test environment, paths from the CI machine). chrome-use matches them by path suffix inside the project folder you bound, labels such matches "matched by path suffix", marks the rest unverified, and never searches outside that folder.
Test environments
Test-environment pages work too, as long as the test build keeps the marks. The plugin only runs in development by default, so turn it on explicitly for test builds. Never for production: with marks on, anyone who can open the test environment can read source file paths in the page.
// Test builds only, never production. DEPLOY_ENV is whatever your CI sets.
const isTestBuild = process.env.DEPLOY_ENV === 'test';
codeInspectorPlugin({
bundler: 'vite',
pathType: 'relative',
hotKeys: false,
dev: () => process.env.NODE_ENV === 'development' || isTestBuild,
server: isTestBuild ? 'close' : 'open',
});
// index.html of the test build: lets the agent compare revisions
<meta name="chrome-use-revision" content="%GIT_SHA%">
# a production build must contain no source marks
$ grep -rl "data-insp-path" dist/ && echo "FOUND: do not ship" || echo "clean"
A test environment may run older code than your local branch. When the page carries chrome-use-revision,
the message includes it and tells the agent to check local files and treat line numbers as approximate. The revision comes
from the page too, so it is only a hint, never an authorization.
Sending and status
The panel reports what ocs actually returned, with storage and wake kept apart:
| State | Meaning |
|---|---|
| Sent | ocs stored it and woke the session. The request is in the agent's queue; the code is not changed yet. |
| Stored | Stored, but the session was not woken (busy or refused). The agent sees it when it next reads its inbox. Do not resend. |
| Unknown / Unconfirmed | ocs may have stored it but the receipt was lost. Never resent automatically; press Check status, and start a new batch only once it is known not to have gone out. |
The full context (each element's HTML, styles and screenshot) is written to ~/.chrome-use/inspect/ctx/<id>/,
readable only by you and removed after 7 days (only the batch id and its outcome stay, so a batch is never sent twice); the ocs message carries a summary and that path. Without ocs, or when you do
not want to deliver, Copy puts the same content on the clipboard as Markdown, and Open in editor
opens the file at the line in VS Code, Cursor, Windsurf or WebStorm.
Safety boundaries
- The page is touched only when you press the shortcut or the button. Nothing stays in pages, and no "started debugging this browser" bar appears. In our probes on Chrome for Testing 155, a page requesting several of its resources by extension id (fetch, script and link) saw no difference from a non-existent extension, with the same median timing over 40 requests, and the checks listed by the relay-mode stealth bench passed. These are limited observations, not a guarantee that it cannot be detected. While picking, the element names added to the page are random per session and carry no brand, but the picker UI itself is visible to the page, so a pick in progress is not hidden.
- Page text, HTML, component names and source paths are untrusted data, labelled apart from your words, and they never choose the project or the session.
- The input box runs in the extension's own frame, so page scripts cannot read or change what you type. The frame proves itself with a one-time secret; a copy made by the page never gets it.
- Every send re-checks that the panel is fully visible; a covered, faded or moved panel does not send. This lowers the risk of UI deception without guaranteeing against it.
- Screenshots are attached only when the page is the visible tab and nothing changed during capture; otherwise they are dropped with a reason. Your tabs are never switched for you.
- Delivery never raises the receiving session's permissions and never starts an agent for you.
How it differs
code-inspector-plugin's AI mode, React Grab, Agentation, MCP Pointer and Cursor's Design Mode also hand a clicked element to AI. Most are limited to a local dev server, or start their own agent process and deliver through the clipboard or a local MCP endpoint. Inspect & Ask works in your logged-in Chrome, on test environments too, and sends to the session you already run, without a new process and without loosening permissions.
Troubleshooting
| Symptom | Fix |
|---|---|
| The shortcut does nothing | Check chrome://extensions/shortcuts for a conflict. chrome:// pages and the Web Store cannot be inspected. |
| The panel says the native host is not connected | Run chrome-use doctor. Copy works without the host. |
| Elements show no source location | Add the plugin as above; test environments need the next deployment. |
| The panel says it is covered | Scroll until the panel is fully visible, or press the shortcut again. |