/vivswan-skills:codex-browser-fixfrom Vivswan Skills
Use when Codex on macOS must drive the user's Chromium browser (Brave, Vivaldi, Opera, Edge, Chrome) through the bundled Chrome plugin, or that plugin fails with "Codex auth token is unavailable", a missing extension connection, or a stale plugin cache after a desktop app update. Codex only.
Ships in Vivswan Skills. 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.
Codex only. The desktop app bundles a Chrome plugin that drives any Chromium browser through the ChatGPT extension. Two things break it, and the vendor skill covers neither:
| Symptom | Cause | Fix |
|---|---|---|
Codex auth token is unavailable after the extension was discovered | config.toml sets a custom model_provider; the browser helper launches codex app-server and inherits it, so the ChatGPT sign-in is invisible | Preflight installs a launcher that overrides the provider for that one subprocess |
| Extension found yesterday, missing or erroring today | The desktop app updated; ~/.codex/plugins/cache/openai-bundled/chrome still points at the old bundle | Preflight re-syncs the cache and the trust hashes to the installed app |
| User asked for a Chromium browser other than Chrome or Edge (Brave, Vivaldi, Opera) and the agent picked Chrome | The vendor skill only names chrome and edge; other families need a list() match | Select by family (below) |
The installed Chrome plugin's own skill (skills/control-chrome/SKILL.md inside the app bundle) stays the authority for browser APIs. This skill owns local setup, recovery, and browser-family selection.
Codex auth token is unavailableRun before importing browser-client.mjs or selecting a browser. Requires Bun and the ChatGPT or Codex desktop app. <skill-dir> is the installed skill folder (Codex default: ~/.codex/skills/codex-browser-fix).
bun "<skill-dir>/scripts/browser-plugin-preflight.mts" # sync + verify
bun "<skill-dir>/scripts/browser-plugin-preflight.mts" --check # read-only verify
usage: browser-plugin-preflight.mts [--check] [--plugin-dir <dir>]
--check verify only, nothing written; exit 1 on drift
--plugin-dir <dir> the bundled Chrome plugin directory of a non-standard install
the codex home is $CODEX_HOME or ~/.codex
exits: 0 synchronized, or verified current; 1 a missing file or a stale setting; 2 usage
It prints the app bundle version, the plugin path to import browser-client.mjs from, and which caches were synchronized. Re-run it after every desktop app update or restart.
A failure names the missing file or stale setting and exits 1. A missing config.toml, bundle, or executable is an error, never a pass, under --check too.
What it changes, and nothing else (<home> is the codex home):
<home>/plugins/cache/openai-bundled/chrome: every existing pinned version entry, the current version's entry, and the latest link follow the installed app bundle. <home>/plugins/cache/openai-bundled/browser: the current version's companion copy and its latest link only. Replaced stale copies move to <home>/plugin-rollbacks/.<home>/config.toml, under [mcp_servers.node_repl.env]: CODEX_CLI_PATH, the app version, and the trusted code paths. Under [shell_environment_policy.set]: the browser-client.mjs hash. Each value must already be assigned there. The edit is parse-verified to change nothing else.<home>/scripts/browser-codex: a generated launcher. Only its app-server subcommand gets -c 'model_provider="openai"'. Every other subcommand passes through unchanged. The main provider, CODEX_HOME, and credentials are untouched.<home>/hosts/<host>/: its own plugins/cache/openai-bundled/browser companion cache, and, where it has a config.toml, the same config edits plus its own scripts/browser-codex. The Chrome cache is global only.Follow the installed control-chrome skill through its node_repl JavaScript tool. Import browser-client.mjs from the path the preflight printed, call setupBrowserRuntime() once, and reuse the agent and browser bindings across turns. Never reset a working session to repeat setup.
Chrome and Edge have vendor selectors: agent.browsers.get("chrome") and agent.browsers.get("edge"). Every other Chromium family is matched from the list:
// Declared once per session; call it again with a profile name after asking.
async function selectExtension(family, profileName) {
const label = (c) => c.profileName ?? c.name; // the name shown when asking
const candidates = (await agent.browsers.list()).filter(
(c) =>
c.type === "extension" &&
c.family === family &&
(profileName === undefined || label(c) === profileName),
);
if (candidates.length === 0) throw new Error(`No connected ${family} extension`);
if (candidates.length > 1) {
const profiles = candidates.map(label).join(", ");
throw new Error(`Several ${family} profiles connected (${profiles}); ask which one`);
}
return agent.browsers.get(candidates[0].id);
}
let browser = await selectExtension("<family>", undefined); // the family the user asked for; ("<family>", "Work") once the profile is known
nodeRepl.write(await browser.documentation());
selectExtension again with that name and reassign browser. Never guess.scripts/extension-ids.json: brave, chrome, edge, opera, vivaldi.documentation() output as the vendor skill requires, name the session, then claim the exact tab object from browser.user.openTabs() that matches the task.Codex auth token is unavailable, empty discovery, cache or trust failures: run the preflight, then read recovery.await agent.documentation.get("bootstrap-troubleshooting").await agent.documentation.get("chrome-troubleshooting").Never: switch the main model_provider off and back on, copy tokens, patch app binaries, or reinstall components speculatively. Report a real sign-in requirement as the user's action.
The preflight --check runs from any terminal with Bun, independent of an MCP host, and reports which bundle, cache, or setting is missing. Prepare task material locally where useful.
Live browser work resumes only in a desktop Codex session with the Chrome plugin and the requested browser connection. Never substitute another browser or automation transport.
references/recovery.md: the auth incident specimen, what the preflight synchronizes, and the extension-versus-tab failure splitscripts/browser-plugin-preflight.mts: the sole setup implementation (sync and --check)scripts/browser-auth-launcher.mts: the launcher generator, unit-tested upstream (https://github.com/Vivswan/skills, tests/skills/codex-browser-fix/browser-auth-launcher.test.ts)scripts/codex-config-toml.mts: the config.toml edit, unit-tested upstream (https://github.com/Vivswan/skills, tests/skills/codex-browser-fix/codex-config-toml.test.ts)LICENSE.md (opens in a new tab)README.md (opens in a new tab)agents/openai.yaml (opens in a new tab)references/recovery.md (opens in a new tab)scripts/browser-auth-launcher.mts (opens in a new tab)scripts/browser-plugin-preflight.mts (opens in a new tab)scripts/codex-config-toml.mts (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub vivswan/skills --plugin vivswan-skills19 skills in this plugin
/claude-remote-peersUse when this Claude Code session must message, ping, or coordinate with a Claude Code session running on another machine, or when a peer the user names is on a different host and ListAgents does not show it./code-standardsUse when writing code changes, sweeping or shortening comments (including file-size or comment-cap findings), or asked to apply the code standards./craft-skills-and-memoriesUse when creating a skill or memory, when one fails in practice, or when the user reports one misbehaving or stale.