surf-cli: Skill for Claude Code

.claude/skills/surf-codebase/SKILL.md

surf-codebase is a skill for Claude Code from nicobailon/surf-cli. It costs 42 tokens per session (960 once invoked), scanned A, original, MIT.

A development guide for surf-cli, a Chrome extension and command-line system for browser automation. It documents how the command line, native host, extension, and Chrome DevTools interface connect.

In plain words
What is it for?
Use it to navigate or modify surf-cli, add commands, implement browser-control operations, or work on Chrome, accessibility, network, and debugging features.
Why use it?
It shows where browser commands, page interactions, screenshots, network handling, and message routing belong in the codebase.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is nicobailon/surf-cli's own configuration. It tells Claude Code how to work on surf-cli itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything surf-cli configures →

Reuse

Borrowing it

Nothing to install: this file belongs to nicobailon/surf-cli. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/nicobailon/surf-cli/main/.claude/skills/surf-codebase/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/nicobailon/surf-cli

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for surf-codebase

README.md
[![agentmods](https://agentmods.dev/badge/skills/nicobailon/surf-cli/surf-codebase/github.svg)](https://agentmods.dev/skills/nicobailon/surf-cli/surf-codebase)
Your own site
<a href="https://agentmods.dev/skills/nicobailon/surf-cli/surf-codebase"><img src="https://agentmods.dev/badge/skills/nicobailon/surf-cli/surf-codebase/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for surf-codebase

Your own site · 80×15
<a href="https://agentmods.dev/skills/nicobailon/surf-cli/surf-codebase"><img src="https://agentmods.dev/badge/skills/nicobailon/surf-cli/surf-codebase.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 960 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00042 $0.00960
Opus 5.5 $0.00017 $0.00384
Sonnet 5.5 $0.00008 $0.00192
Haiku 4.5 $0.00004 $0.00096

Measured 2d ago against content hash 019bd3342efe, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

surf-codebase scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/surf-codebase/SKILL.md · 106 lines

How it starts

The opening of the file, as written. The whole thing — 106 lines — stays where its author put it; the contents beside it link to each section on GitHub.

surf-cli Codebase

Architecture

cli.cjs --socket:/tmp/surf.sock--> host.cjs --native-msg--> service-worker/index.ts --CDP/chrome-APIs--> browser

Add CLI Command

  1. Add to TOOLS in native/cli.cjs:158 (args, opts, examples)
  2. Add handler in src/service-worker/index.ts:50 handleMessage() switch
  3. CDP op? → add method src/cdp/controller.ts:60
  4. DOM interaction? → add handler src/content/accessibility-tree.ts:99

Add CDP Operation

  1. Add method to CDPController class src/cdp/controller.ts:60
  2. Use this.send(tabId, "Domain.method", params)
  3. Handle events in handleCDPEvent() if needed

Core Files

src/service-worker/index.ts (~2500L) - Central msg router, CDP ops, screenshot cache, tab registry

  • Msg types: EXECUTE_CLICK, EXECUTE_TYPE, READ_PAGE, EXECUTE_SCREENSHOT
  • Screenshot cache: generateScreenshotId(), cacheScreenshot(), getScreenshot()
  • Tab names: tabNameRegistry Map<name,tabId>

src/cdp/controller.ts (~1000L) - CDP wrapper, CDPController class

  • Mouse: click(), rightClick(), doubleClick(), hover(), drag()
  • Keyboard: type(), pressKey(), pressKeyChord()
  • Screenshots: captureScreenshot(), captureRegion()
  • Network/Console: enableNetworkTracking(), getNetworkRequests(), getResponseBody(), subscribeToNetwork(), enableConsoleTracking(), getConsoleMessages()
  • Emulation: emulateNetwork(), emulateCPU(), emulateGeolocation()

src/content/accessibility-tree.ts (~1900L) - Content script, generates a11y tree YAML, element interactions

  • Handlers: GENERATE_ACCESSIBILITY_TREE, CLICK_ELEMENT, FORM_INPUT, GET_ELEMENT_COORDINATES, WAIT_FOR_ELEMENT, WAIT_FOR_URL
  • Element refs: e1, e2... in window.__piRefs for stable references

native/cli.cjs (~2100L) - CLI parser, socket client

  • TOOLS: command defs with args/opts
  • ALIASES: shortcut→command map
  • AUTO_SCREENSHOT_TOOLS: commands that auto-capture
  • parseArgs(), sendRequest()

native/host.cjs (~2100L) - Socket server, AI integration

  • handleToolRequest(): main dispatcher
  • mapToolToMessage(): tool→extension msg converter
  • queueAiRequest(): AI request serialization
  • AI clients: chatgptClient, geminiClient, perplexityClient

Read the full file on GitHub · 106 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago Changed 019bd3342efe
  2. 2mo ago First seen · 106 lines · 42 tokens per session scan A 072b3a3ddded

Subscribe to this mod's changes

surf-codebase is a skill published in the GitHub repository nicobailon/surf-cli (684 stars, last pushed 2d ago), licensed MIT. It adds 42 tokens to every session and 960 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

surf-codebase compared with skills from other repositories

surf-codebase next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
surf-codebasenicobailon/surf-cliSkill6842d agoMITA42Claude Code
canvasleeguooooo/chrome-useSkill231yesterdayApache-2.0A124Claude Code
coreleeguooooo/chrome-useSkill231yesterdayApache-2.0A39Claude Code
electronleeguooooo/chrome-useSkill231yesterdayApache-2.0A112Claude Code
sessionsleeguooooo/chrome-useSkill231yesterdayApache-2.0A68Claude Code
slackleeguooooo/chrome-useSkill231yesterdayApache-2.0A88Claude Code
networkleeguooooo/chrome-useSkill231yesterdayApache-2.0A62Claude Code