/kernel-browser:debug-session <session-id-or-name>from kernel-browser
Debug a failed, hung, blocked or timed-out Kernel browser session from its session id or name: read session state and telemetry events (they stay readable after the browser is deleted), check live page state, replays and logs, then diagnose and propose a fix. Use when a Kernel browser task fails or misbehaves, or the user gives a Kernel session id.
Ships in kernel-browser. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
You are diagnosing one Kernel browser session that you (or an earlier step) drove through the Kernel MCP tools. Evidence order: session record, then telemetry events, then (only if the browser is still alive) live checks, then replays. Telemetry and the session record stay readable after the browser is deleted, so start there.
Inputs:
ARGUMENTS:). If there is none, use the latest Kernel session id or name visible in the conversation. Ask only if there is none at all.Rules for the whole run:
tags: {cc_session: "<session id the hook tells you>"} and an explicit timeout_seconds (the create hook denies it otherwise). Otherwise offer the repro and let the user decide. The live checks in step 4 touch a still-running browser: they read page state, but they count as activity (the idle-timeout clock restarts). Run step 4 only for a browser that is still live.cdp_ws_url, webdriver_ws_url, base_url, browser_live_view_url, replay_view_url, API keys, cookie values or full event payloads. Event data can hold Cookie/Authorization headers, bodies and URL tokens (https://kernel.sh/docs/browsers/telemetry/categories). Report only fields you picked, and cut URL query strings (?***). See ../browse/references/safety.md.compact, categories, limit, or the CLI fallback with jq, head and tail.-o json errors are plain text on stderr with exit 1 and stdout stays empty, so never pipe a kernel command straight into jq (empty input makes jq exit 0 and the failure looks like success). Capture first: out=$(kernel ... -o json) && jq '...' <<<"$out" || echo "could not run: <what>", or redirect to a file with || { ...; }.context (why you call it).Tool note: MCP tool names are mcp__plugin_kernel-browser_kernel__<tool> in Claude Code and kernel_mcp.<tool> in Codex; this file just names the tool. Driving surfaces: ../browse/references/tools.md.
Argument check first: the id or name must match ^[A-Za-z0-9._-]{1,64}$; if it does not, say so and stop (it may be put in a CLI command later).
Call manage_browsers with action get and the id (use list with status: "all" and query to find a name; deleted browsers show there). Keep only: session_id, name, created_at, deleted_at, timeout_seconds, headless, stealth, proxy, tags, usage_status, telemetry. From here on use the literal session_id in every call (never the name). Compute:
running = no deleted_at.ran_s = (deleted_at or now) minus created_at, in seconds.telemetry_on = the telemetry categories whose enabled is true.If get cannot see a deleted browser, retry through list with status: "deleted" or "all". If neither finds it, the id is wrong or belongs to another project: stop and ask.
Read the result:
deleted_at present: the browser is gone. Skip step 4 (live checks). The record has deleted_at, not a status key.running and ran_s at or past timeout_seconds: it is about to be, or is being, reaped.ran_s close to timeout_seconds: the browser was most likely reaped by its timeout, not crashed. The timeout countdown starts after the browser enters standby (about 5 s with no activity), so also compare with the time of the last cdp_disconnect in step 2. Fix: create with a larger timeout_seconds (../browse/references/cost.md).headless: true: no live view URL and no replays exist for this session.telemetry_on lacks console, network or page: capture was off for those categories; there is no evidence to recover, and enabling later cannot backfill. Defaults (connection, control, system, captcha) always layer on, so you will still see CDP connects and API calls.proxy and stealth: note them for the diagnosis (unblock cases).Events default to a 5 minute window. Always pass since = created_at, or you will miss the failure. until in the future is rejected.
Call manage_browsers with action get_telemetry, session_id, since = created_at, compact: true, order: "asc" (oldest first; the server rejects since with order: "desc") and a modest limit. For the newest events instead, drop since and pass order: "desc" with until = deleted_at (or now). First get the type counts (count by event type), then narrow with categories (for example console, network, page, connection) and page with limit if more is needed. If the count is 0, report "no telemetry captured", then go to step 4 if deleted_at is null, else step 5.
Event shape: { seq, event: { ts, type, category, source, data } }; seq is on the envelope and ts is microseconds. Quote a row only after reading it, with URLs stripped of query strings, and never paste whole event objects. Failure signals to look for: console_error, page-level network_loading_failed, HTTP 4xx/5xx network_response, crash and disconnect types.
CLI fallback (when the MCP output is too large or lacks a field). Needs kernel and jq (command -v kernel jq; if missing, say so and stop, install nothing). Make a private directory once, print it and use that literal path as <D>: umask 077; D=$(mktemp -d); echo "$D". Then:
kernel browsers telemetry events <SESSION_ID> --since "<CREATED>" --all -o json > <D>/events.json || { echo "could not read telemetry"; rm -rf <D>; exit 1; }
jq -r '.events|map(.event.type)|group_by(.)|map("\(.[0]) \(length)")[]' <D>/events.json
jq -r -f "${CLAUDE_SKILL_DIR}/scripts/events.jq" <D>/events.json > <D>/rows.txt || echo "could not filter events"; tail -40 <D>/rows.txt
(${CLAUDE_SKILL_DIR} is this skill's folder; if it is empty the file is <plugin>/skills/debug-session/scripts/events.jq.) Failures sit at the end, so take the last 40 rows. The filter keeps console_error, page-level network_loading_failed, HTTP 4xx/5xx network_response and the crash and disconnect types, and redacts bearer values, secret-looking key=value pairs, URL userinfo, query strings, fragments and long opaque path segments. That is best effort: console text can still hold something sensitive. The CLI also filters server-side: --types console_error,network_loading_failed and --categories console both work. If KERNEL_API_KEY is missing the CLI fails: tell the user to set it, never print it. On any stop, run rm -rf <D>.
Traps in the data:
console_error. There is no page_error event.page.goto to an unresolvable host does not throw. The signal is page_navigation events plus a 502 network_response on /favicon.ico, not a network_loading_failed for the document.fetch that returned HTTP 500 shows as network_loading_failed with net::ERR_ABORTED (canceled), not as a network_response 500. Do not read it as a network outage.ERR_ABORTED can mean a failed navigation to an HTTP error page (a top-level goto to a 500 gave no page_navigation, only this), not only a canceled fetch. Check the failing URL and the error you saw before choosing.network_loading_failed rows can be target_type: service_worker calls to a Kernel-internal endpoint. Keep only page targets.monitor_disconnected means the collector dropped; treat events until monitor_reconnected as incomplete.Map signal to likely cause (state it as "likely", cite the event seq):
| Signal | Likely cause | Fix to propose |
|---|---|---|
system_oom_kill, service_crashed, page_crashed | VM out of memory or renderer crash | Next time create with more memory (headless accepts 1, 2 or 4 GiB) and run fewer parallel executors: ../browse/references/cost.md |
network_response 403/429, or network_loading_failed on the document with a challenge page | Bot detection or rate limit | ../browse/references/unblock.md (stealth, proxy, captcha) |
proxy_error | Proxy path failed (a classification of branded 502/403 responses, only with network telemetry on; not a complete record of proxy refusals) | Retry on a new browser with proxy mode direct to isolate, or fix the proxy: ../browse/references/unblock.md |
network_response 403 with X-Kernel-Proxy-Error: network_policy_denied | Blocked by network.allowed_hosts | Create the next browser with that host allowed |
ran_s near timeout_seconds, last cdp_disconnect then silence | Idle timeout reaped the browser | Create with a larger timeout_seconds, keep working in the session, and delete explicitly when done: ../browse/references/cost.md |
api_call for ExecutePlaywrightCode returned HTTP 200 but the code failed (playwright.execute gave success:false) | Failure inside the Playwright snippet. The error text is only in that call's result (result.error), not in telemetry | Re-read the tool result you got; fix the snippet or catch the error inside it |
page_navigation events end, then an execute failure, after a top-level page.goto to a URL that answers HTTP 500 | Playwright goto to an HTTP error page can fail with net::ERR_HTTP_RESPONSE_CODE_FAILURE while the API call is HTTP 200 (observed live with https://httpbin.org/status/500: telemetry showed only a document network_loading_failed ERR_ABORTED). Other statuses were not tested | Catch the goto error inside the snippet and return { ok:false, navError }, or check the status yourself |
ran_s far below timeout_seconds, cdp_connect with no cdp_disconnect after it | The browser was deleted explicitly (by this or another session). Telemetry showed no delete api_call, so it cannot name the deleter | Check conversation history and other sessions' cleanup for an early manage_browsers delete |
console_error after a navigation | Page-side JS failure (the site, not Kernel) | Fix selectors or wait for page_navigation_settled before acting |
Only connection/control/system events | console/network/page were not enabled | Create the next browser with telemetry including them |
monitor_disconnected before the failure window | Evidence gap | Say the diagnosis is partial |
If the symptom is still unclear and the browser is live, go to step 4. If it is deleted, go to step 5.
deleted_at is null)Run these once each, in this order, and stop as soon as the cause is clear. Use the literal <SESSION_ID>.
Screenshot: computer_action screenshot on the session. Tell the user what the page shows (blank, challenge, error page). Do not paste image bytes.
Page state: execute_playwright_code with return await page.title() (return a small value only).
Chrome path vs VM path, for connection failures. Use the failing host from the events (host only, no path or query). In the page: execute_playwright_code with const r = await page.request.get("https://<FAILING_HOST>/"); return r.status(), which uses the browser's cookie jar, so do it only on a throwaway or read-only browser (a profile opened with save_profile_changes could save what that request sets). VM path via CLI, status line only, never full headers: kernel browsers process exec <SESSION_ID> -- curl -sI https://<FAILING_HOST>/ | head -1. An empty line means the command failed, not that the host answered: say "could not check".
Chrome-only failure points at fingerprinting, cookies or the proxy route (../browse/references/unblock.md). Failure on both points at network or DNS.
Service logs (often returns no lines), CLI only: kernel browsers logs stream <SESSION_ID> --source supervisor --supervisor-process chromium --follow=false | head -50. If it prints logs source not available or failed to open log path, say logs were unavailable and move on. Do not retry in a loop.
Live view: only if the user wants to look. The live-view URL is a bearer token; do not show it. Tell the user to ask for it or run kernel browsers view <SESSION_ID> themselves. Absent on headless.
Call manage_replays with action list for the session (works after delete). Report replay_id, started_at, finished_at only. If empty, say no replay was recorded (a replay records only from the moment it is started, and a headless browser cannot record).
If there is one and the symptom is visual, offer to download it; do not download unasked. Save outside any scratch directory so cleanup does not delete it, using the CLI:
kernel browsers replays download <SESSION_ID> <REPLAY_ID> -f ./kernel-replay-<REPLAY_ID>.mp4
If the download is not ready (HTTP 202 while finalizing), wait a few seconds and retry, at most 5 times. Any other failure: report it and stop. The replay is video only. Report the file path, not the replay URL.
seq and type, or a record field).timeout_seconds 900 and telemetry including console and network"), and name the reference to read (../browse/references/cost.md, ../browse/references/unblock.md, ../browse/references/tools.md). Add the docs URL when one applies: telemetry events https://kernel.sh/docs/browsers/telemetry/categories, replays https://kernel.sh/docs/browsers/replays.console, network and page telemetry (and start a replay with manage_replays start on a headful browser) before the run.rm -rf <D>.disable_default_proxy or other routing on a live session to A/B test; that field is deprecated and had no direct effect. Use a new browser with proxy mode direct instead (../browse/references/unblock.md).kernel browsers delete ... -y: delete has no -y flag. Use manage_browsers delete.Report to the user in exactly this shape:
Session: <id> (<name>) - <live | deleted at <deleted_at>> - <headless | headful> - ran <ran_s>s of <timeout_seconds>s (so far, if live)
Telemetry captured: <categories> | events read: <count> | window: <created_at> to now
Likely cause: <one sentence>
Evidence:
- seq <n> <event type> <short text, no URLs with tokens>
- <record field or live check result>
Ruled out / not checked: <list, each with the reason>
Fix:
- <concrete change, as what to do next time with the MCP tools>
- Read: ../browse/references/<file>.md (<docs URL>)
Next step: <one thing you can run for the user, if any>
Never include Kernel-issued session URLs (CDP, live view, replay, hosted login), keys, cookies or raw event payloads in that report. Docs URLs are fine.
Verified live 2026-10-20 (Hobbyist plan); types re-checked on @onkernel/sdk 0.129.0. Evidence ledger: https://github.com/yigitkonur/plugin-kernel-sh/blob/main/verified-facts.md (MCP tool names checked against the Kernel MCP server source, 2026-10-22)
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
6 skills in this plugin
/browseDo web tasks in Kernel cloud browsers through the Kernel MCP tools instead of a browser on this machine: open and read pages, extract data, fill forms, act on sites the user is logged in to through a saved Kernel profile, run several pages in parallel, or get past bot defenses. Use when the user asks to browse in Kernel or a cloud browser, to offload browser work from the local machine, or to use a saved Kernel profile or login./diff-profilesCompare two Kernel profiles (cookies, storage, preferences, extensions, login state) without printing values, and explain why a flow works on one and not the other./loginPut a website login into a Kernel profile so later Kernel browsers start signed in, without any password passing through chat: a hosted Kernel login page or a live view the user types into, the user's 1Password (approved in the 1Password app), or a credential stored from environment variables for unattended re-login. Use when a Kernel browser lands on a login page, the user asks to log in to a site in Kernel, or a saved Kernel login has expired.npx claudepluginhub yigitkonur/plugin-kernel-sh --plugin kernel-browser