Overview
Capture screenshots of the entire page, viewport, or specific elements. Automatically resizes images to optimize for Claude Vision token costs (~1,600 tokens max) unless disabled.Syntax
Arguments
Output file path (PNG/JPEG), or directory for
--follow modeOptions
Capture target
CSS selector for element capture
Cached element index (0-based) from previous query
Scroll element into view before capture
Image format
Image format:
png or jpeg (default: png)JPEG quality 0-100 (default: 90)
Capture mode
Capture viewport only instead of full page (default: full page)
Disable auto-resize, capture at full resolution
Continuous capture
Continuous capture mode to directory
Capture interval for
--follow in milliseconds (default: 1000)Maximum frames for
--follow modeOutput
Output metadata as JSON
Auto-resize behavior
By default, screenshots are optimized for Claude Vision API:- Images exceeding 1568px on longest edge are scaled down
- Tall pages (aspect ratio > 3:1) automatically capture viewport only
- Targets ~1,600 tokens per image
- Accounts for device pixel ratio (Retina displays)
--no-resize for full resolution.
Examples
Full page capture
Viewport capture
Element capture
Continuous capture
Output metadata
Human-readable format
JSON format
Capture modes
Full page (default)
- Captures entire scrollable page
- Auto-resizes if height exceeds optimal size
- Falls back to viewport for very tall pages (aspect ratio > 3:1)
Viewport only
- Captures only visible area
- Faster than full page
- Useful for above-the-fold content
Element clipping
- Captures element’s bounding box only
- Auto-resizes if element is large
- Element must be visible (not
display: none)
Scroll + capture
- Scrolls element into view
- Waits for lazy-loaded content
- Captures viewport after scroll
- Restores original scroll position
Token optimization
Why auto-resize?
Claude Vision API charges by image resolution:- Images resize to fit within 1568px on longest edge
- Target: ~1,600 tokens per image (cost-effective sweet spot)
- Maintains aspect ratio, quality sufficient for UI analysis
When to use --no-resize
- Need to read small text or details
- Creating reference images for humans
- Image will be downscaled elsewhere
- Not using with Claude Vision API
Token estimates
Token calculation formula:- 1920×1080: ~765 tokens → ~685 tokens (resized to 1568×882)
- 1920×5120: ~5,785 tokens → ~1,584 tokens (resized to 1200×3200)
- 1920×8000: Falls back to viewport (~1,600 tokens)
Exit codes
Success - screenshot captured
INVALID_ARGUMENTS - invalid quality or dimensions
RESOURCE_NOT_FOUND - element not found
STALE_CACHE - cached index invalid
CDP_TIMEOUT - CDP operation timed out
Troubleshooting
Element not captured
Image too small
Missing lazy-loaded content
Related commands
bdg dom scroll- Scroll before capturingbdg dom query- Find elements to capturebdg dom eval- Check page state before capture

