agentleFS
just-everyjust-every/mcp-screenshot-website-fast/CLAUDE.md

mcp-screenshot-website-fast

CLAUDE.md110 starsChanged 17 months agoMITView on GitHub

Fast, efficient screenshot capture of web pages - optimized for CLI coding tools. Automatically tiles full pages into 1072x1072 chunks for optimal processing. A TypeScript-based screenshot tool optimized for AI vision models, particularly Claude Vision API. Captures high-quality screenshots with intelligent tiling for large pages. IMPORTANT: Always run these commands before committing: Only commit if all commands succeed without errors.

The file

Show its rules and text

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

17 rules. About 0 are common, 14 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈14

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No caching - always captures fresh content

    line 15
  2. Distinctive:

    No caching for always-fresh content

    line 60
  3. Distinctive:

    IMPORTANT: Always run these commands before committing:

    line 71
  4. Distinctive:

    Only commit if all commands succeed without errors.

    line 79
  5. Very specific:

    Run tests with npm test

    line 97
  6. Distinctive:

    Test different viewport sizes

    line 98
  7. Distinctive:

    Verify tiling algorithm correctness

    line 99
  8. Distinctive:

    Test error scenarios (timeouts, invalid URLs)

    line 100
  9. Distinctive:

    Update README for user-facing changes

    line 106
  10. Very specific:

    Run npm run dev for development

    line 115
  11. Distinctive:

    Keep Puppeteer version pinned for consistency

    line 120
  12. Distinctive:

    Document any new dependencies

    line 122
  13. Distinctive:

    Chrome Process: Ensure proper cleanup to avoid zombie processes

    line 127
  14. Very specific:

    When running as MCP server (npm run serve):

    line 141
  15. Distinctive:

    No caching - always fresh screenshots

    line 147
  16. Distinctive:

    Puppeteer installation: Check firewall/proxy settings

    line 155
  17. Distinctive:

    Chrome crashes: Check system resources

    line 158

≈ “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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

Fast, efficient screenshot capture of web pages - optimized for CLI coding tools. Automatically tiles full pages into 1072x1072 chunks for optimal processing.

Core Modules & Files

  • src/internal/screenshotCapture.ts: Core Puppeteer-based capture logic
  • src/utils/: Logger and chunking utilities
  • src/index.ts: CLI interface using Commander
  • src/serve.ts: MCP server using SDK
  • No caching - always captures fresh content

Commands

Development

npm run dev capture <URL> -o out.png # Capture screenshot (tiled by default)
npm run dev capture <URL> --no-full-page -o out.png # Viewport only
npm run serve:dev                    # Run MCP server in dev mode

Build & Production

npm run build                        # Compile TypeScript to JavaScript
npm run start                        # Run compiled CLI
npm run serve                        # Run compiled MCP server

Code Quality

npm run lint                         # Run ESLint
npm run typecheck                    # TypeScript type checking
npm test                             # Run tests with Vitest

Architecture Overview

A TypeScript-based screenshot tool optimized for AI vision models, particularly Claude Vision API. Captures high-quality screenshots with intelligent tiling for large pages.

Core Components

  1. Screenshot Engine (src/internal/screenshotCapture.ts)
    • Puppeteer-based headless Chrome automation
    • Automatic viewport limiting (1072x1072 for Claude Vision)
    • Smart page tiling for full-page captures
    • Configurable wait strategies
  2. CLI Interface (src/index.ts)
    • Commander-based command line tool
    • Support for various output formats
    • Flexible viewport and wait options
  3. MCP Server (src/serve.ts)
    • SDK-based MCP implementation
    • Real-time screenshot capture
    • No caching for always-fresh content

Key Patterns

  • Browser instance reuse for performance
  • Automatic resolution optimization for AI models
  • Graceful error handling and retries
  • Memory-efficient tiling algorithm

Pre-Commit Requirements

IMPORTANT: Always run these commands before committing:

npm test          # Ensure tests pass
npm run lint      # Check linting
npm run build     # Ensure TypeScript compiles

Only commit if all commands succeed without errors.

TypeScript Configuration

  • ES Modules with Node.js >=20.0.0
  • Strict mode enabled, targeting ES2022
  • Source maps for debugging
  • Declaration files for type safety

Code Style Guidelines

  • Async/await for all asynchronous operations
  • Proper error handling with detailed messages
  • Resource cleanup (browser instances)
  • Minimal dependencies for fast installs

Testing Instructions

  • Run tests with npm test
  • Test different viewport sizes
  • Verify tiling algorithm correctness
  • Test error scenarios (timeouts, invalid URLs)

Repository Etiquette

  • Branch names: feature/description, fix/issue-number
  • Conventional commits (feat:, fix:, chore:)
  • Update README for user-facing changes
  • Include screenshot examples for visual changes

Developer Environment Setup

  1. Clone repository
  2. Install Node.js 20.x or higher
  3. Run npm install
  4. Puppeteer will auto-download Chrome
  5. Run npm run dev for development

Package Management

  • Puppeteer is the main dependency
  • Keep Puppeteer version pinned for consistency
  • Monitor bundle size for MCP deployment
  • Document any new dependencies

Project-Specific Warnings

  • Memory Usage: Large pages can consume significant memory during tiling
  • Chrome Process: Ensure proper cleanup to avoid zombie processes
  • File Sizes: Tiled screenshots can create large output files
  • Timeouts: Some sites may require longer wait times
  • Headless Detection: Some sites block headless browsers

Key Utility Functions & APIs

  • captureScreenshot(): Main capture function
  • tilePage(): Splits large pages into tiles
  • waitForPage(): Implements various wait strategies
  • optimizeViewport(): Ensures Claude Vision compatibility

MCP Server Integration

When running as MCP server (npm run serve):

Tools:

  • screenshot_website_fast - Full page capture with automatic tiling

Features:

  • No caching - always fresh screenshots
  • Automatic resolution optimization
  • Error handling with descriptive messages

Troubleshooting

Common Issues

  • Puppeteer installation: Check firewall/proxy settings
  • Memory errors: Reduce viewport size or disable full-page
  • Timeout errors: Increase wait time or change wait strategy
  • Chrome crashes: Check system resources

Debug Mode

Enable verbose logging:

DEBUG=screenshot:* npm run dev capture <URL>

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.