agentleFS
diegocconsolinidiegocconsolini/ClaudeSkillCollection/chrome-devtools-optimizer/CLAUDE.md

ClaudeSkillCollection / chrome-devtools-optimizer

CLAUDE.md7 starsChanged 14 months agoMITView on GitHub

Add this alias to ~/.bashrc for quick access: Without Gemini, you lose 50% of savings on visual analysis tasks. ~1,000 tokens (vs ~6,000 with screenshots)

  • Installs packages

The file

We split this CLAUDE.md into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Add this alias to ~/.bashrc for quick access:

    line 14
  2. Distinctive:

    Use optimized MCP tools (see decision tree below)

    line 53

≈ “Common” is an estimate: at least 1 in 5 of the 12,729 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

Chrome DevTools Optimizer

Daily Usage (Fast)

# Start Chrome (once per session)
chrome-debug

# Process any screenshot through Gemini (instead of viewing in Claude)
gemini-vision /tmp/screenshot.jpg
gemini-vision /tmp/screenshot.jpg "find all buttons"

Add this alias to ~/.bashrc for quick access:

alias gemini-vision='node ~/ClaudeSkillCollection/chrome-devtools-optimizer/scripts/process-screenshot.js'

Quick Decision

  • Need to click/fill/automate? → Use take_snapshot
  • Need to see visuals? → Save screenshot to file, then gemini-vision <file>
  • Need both? → Snapshot first, Gemini only if visual issue

WSL2 Quick Setup

# Check Chrome → install if missing
which google-chrome || (wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - && sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && sudo apt update && sudo apt install -y google-chrome-stable)

# Check alias → add if missing
grep -q "chrome-debug" ~/.bashrc || echo "alias chrome-debug='mkdir -p /tmp/chrome-debug-profile && google-chrome --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug-profile --no-sandbox > /tmp/chrome.log 2>&1 &'" >> ~/.bashrc && source ~/.bashrc

# Check MCP config → add if missing (restart Claude Code after)
jq -e '.mcpServers["chrome-devtools"]' ~/.claude/settings.json >/dev/null 2>&1 || (jq '.mcpServers["chrome-devtools"] = {"command":"npx","args":["-y","chrome-devtools-mcp@latest","--browserUrl","http://localhost:9222"],"env":{}}' ~/.claude/settings.json > /tmp/s.tmp && mv /tmp/s.tmp ~/.claude/settings.json && echo "Restart Claude Code")

Gemini API Setup (REQUIRED for full optimization)

# Test if configured
node chrome-devtools-optimizer/scripts/test-connection.js

# If not configured, run setup (get free key: https://aistudio.google.com/apikey)
node chrome-devtools-optimizer/scripts/setup.js

Without Gemini, you lose 50% of savings on visual analysis tasks.

Usage

  1. Start Chrome: chrome-debug
  2. Verify Gemini: node scripts/test-connection.js
  3. Use optimized MCP tools (see decision tree below)

Token Optimization Decision Tree

NeedUseTokens
Page structure/elementstake_snapshot300-1,500
Visual appearancetake_screenshot → Gemini~300
Single element visualtake_screenshot with uid400-800
Form values/stateevaluate_script50-100
Console errorslist_console_messages (filtered)100-300
Network callslist_network_requests (filtered)200-500

Anti-Patterns (Avoid)

  • Screenshot after every action → Use snapshot or verify only when needed
  • Multiple fill() calls → Use single fill_form()
  • Unfiltered console/network → Always use types/resourceTypes + pageSize
  • Full page screenshot for one element → Use uid parameter

Example: Optimized Login Flow

1. navigate_page → login URL
2. take_snapshot → get form UIDs
3. fill_form → all credentials at once
4. click → submit button by uid
5. evaluate_script → check URL (verify redirect)
6. take_snapshot → confirm dashboard

~1,000 tokens (vs ~6,000 with screenshots)

Troubleshooting

# Chrome logs
cat /tmp/chrome.log

# Verify Chrome running
ps aux | grep chrome

# Test connection
curl http://localhost:9222/json

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.