pinchtab-helper

PinchTab browser automation - profiles, instances, multi-instance routing, tabs, actions, and anti-detection When user mentions PinchTab, browser automation, pinchtab commands, headed/headless browser, or web scraping with Chrome

15 stars

Best use case

pinchtab-helper is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

PinchTab browser automation - profiles, instances, multi-instance routing, tabs, actions, and anti-detection When user mentions PinchTab, browser automation, pinchtab commands, headed/headless browser, or web scraping with Chrome

Teams using pinchtab-helper should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/pinchtab-helper/SKILL.md --create-dirs "https://raw.githubusercontent.com/shepherdjerred/monorepo/main/packages/dotfiles/dot_agents/skills/pinchtab-helper/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/pinchtab-helper/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How pinchtab-helper Compares

Feature / Agentpinchtab-helperStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

PinchTab browser automation - profiles, instances, multi-instance routing, tabs, actions, and anti-detection When user mentions PinchTab, browser automation, pinchtab commands, headed/headless browser, or web scraping with Chrome

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# PinchTab Browser Automation

## Core Concepts

- **Profile**: stored browser state on disk (cookies, local storage, history, extensions). Persistent across restarts.
- **Instance**: a running Chrome process backed by a profile. One profile can have at most one active instance.
- **Tab ID**: opaque string returned by API. Never construct them.
- **Shorthand routes** (`pinchtab nav`, `pinchtab eval`, `pinchtab snap`): proxy to the **default/first instance**. Do NOT use when targeting a non-default profile.

## Critical: Multi-Instance Routing

**Shorthand CLI commands route to the default instance.** When working with a non-default profile:

1. Get the instance ID: `pinchtab instances`
2. Use instance-scoped CLI: `pinchtab instance navigate <instanceId> <url>`
3. Or use REST API with instance-scoped routes (see API section below)

The `always-on` strategy auto-respawns the default instance — stopping it is futile. To prevent this, change strategy to `explicit` in config:

```bash
pinchtab config set multiInstance.strategy explicit
```

## Authentication & CAPTCHAs

- **HttpOnly cookies** (session tokens) CANNOT be set via `document.cookie` or `pinchtab eval`. They can only be set by actual browser login flows.
- **CAPTCHAs** (Cloudflare Turnstile, reCAPTCHA) cannot be solved by headless browsers. At the first sign of a CAPTCHA, immediately start **headed** mode and ask the user to solve it.
- After user logs in via headed mode, cookies persist in the profile. Do NOT restart the instance — that may lose the session.
- For subsequent runs, start headless from the same profile to reuse persisted cookies.

## Rate Limiting

PinchTab has no built-in rate limiting for target sites. When making multiple API calls:

- Add `await new Promise(r => setTimeout(r, 2000))` between fetch calls in `pinchtab eval` scripts
- For bulk operations, use PinchTab's scheduler with `maxInflight` to control concurrency
- Sites like LeetCode trigger bot detection with rapid automated requests

## CLI Quick Reference

### Server & Config

```bash
pinchtab health                    # Check server health
pinchtab config                    # Show config
pinchtab config set <path> <val>   # Set config value
pinchtab instances                 # List running instances
pinchtab profiles                  # List profiles
```

### Instance Management

```bash
# Start instance (prefer REST API for full control)
curl -s -X POST http://localhost:9867/instances/start \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{"profileId":"prof_xxx","mode":"headed"}'

# Stop instance
curl -s -X POST http://localhost:9867/instances/<id>/stop \
  -H "Authorization: Bearer $TOKEN"

# Get auth token
jq -r .server.token "$HOME/Library/Application Support/pinchtab/config.json"
```

### Shorthand Commands (default instance only)

```bash
pinchtab nav <url>                 # Navigate
pinchtab snap                      # Accessibility snapshot
pinchtab snap --interactive        # Interactive elements only
pinchtab snap --compact            # Token-efficient format
pinchtab click <ref>               # Click element (e.g. "e5")
pinchtab click "css:#btn"          # Click by CSS selector
pinchtab click "find:login button" # Click by semantic search
pinchtab fill <ref> <text>         # Fill input field
pinchtab type <ref> <text>         # Type into element
pinchtab press <key>               # Press key (Enter, Tab, Escape)
pinchtab text                      # Extract page text
pinchtab screenshot                # Take screenshot
pinchtab tab                       # List tabs
pinchtab eval '<js>'               # Execute JavaScript
```

### Instance-Scoped Commands (target specific instance)

```bash
pinchtab instance navigate <instanceId> <url>
pinchtab instance logs <instanceId>
pinchtab instance stop <instanceId>
```

## REST API Reference

Base URL: `http://localhost:9867`
Auth: `Authorization: Bearer <token>`

### Profiles

| Method | Endpoint                     | Description                 |
| ------ | ---------------------------- | --------------------------- |
| GET    | `/profiles`                  | List profiles               |
| POST   | `/profiles`                  | Create profile              |
| DELETE | `/profiles/{id}`             | Delete profile              |
| POST   | `/profiles/{nameOrId}/start` | Start instance from profile |
| POST   | `/profiles/{nameOrId}/stop`  | Stop profile's instance     |

### Instances

| Method | Endpoint                    | Description                    |
| ------ | --------------------------- | ------------------------------ |
| GET    | `/instances`                | List running instances         |
| POST   | `/instances/start`          | Start new instance             |
| POST   | `/instances/{id}/stop`      | Stop instance                  |
| POST   | `/instances/{id}/tabs/open` | Open tab in specific instance  |
| GET    | `/instances/{id}/tabs`      | List tabs in specific instance |

### Tabs (cross-instance, by tab ID)

| Method | Endpoint                   | Description                        |
| ------ | -------------------------- | ---------------------------------- |
| POST   | `/tabs/{tabId}/navigate`   | Navigate tab                       |
| GET    | `/tabs/{tabId}/snapshot`   | Get accessibility snapshot         |
| GET    | `/tabs/{tabId}/text`       | Extract page text                  |
| GET    | `/tabs/{tabId}/cookies`    | Get cookies (read-only)            |
| POST   | `/tabs/{tabId}/action`     | Execute action (click, type, etc.) |
| GET    | `/tabs/{tabId}/screenshot` | Capture screenshot                 |
| POST   | `/tabs/{tabId}/close`      | Close tab                          |

### Scheduler (if enabled)

| Method | Endpoint             | Description |
| ------ | -------------------- | ----------- |
| POST   | `/tasks`             | Submit task |
| GET    | `/tasks`             | List tasks  |
| POST   | `/tasks/{id}/cancel` | Cancel task |

## Config Reference

Config location: `~/Library/Application Support/pinchtab/config.json`

Key settings:

```json
{
  "server": { "token": "..." },
  "instanceDefaults": {
    "mode": "headed", // or "headless"
    "stealthLevel": "full" // "light", "medium", "full"
  },
  "multiInstance": {
    "strategy": "explicit", // "simple", "explicit", "simple-autorestart"
    "allocationPolicy": "fcfs" // "fcfs", "round_robin", "random"
  },
  "scheduler": {
    "enabled": true,
    "maxInflight": 5,
    "maxPerAgentInflight": 2
  }
}
```

## Stealth Levels

- **light**: Minimal anti-detection
- **medium**: Enhanced measures
- **full**: Maximum anti-detection (recommended for sites with bot detection)

## Common Patterns

### Login to a site with CAPTCHA

```bash
# 1. Start headed instance on a persistent profile
TOKEN=$(jq -r .server.token "$HOME/Library/Application Support/pinchtab/config.json")
curl -s -X POST http://localhost:9867/instances/start \
  -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
  -d '{"profileId":"prof_xxx","mode":"headed"}'

# 2. Navigate to login page
pinchtab instance navigate <instanceId> https://example.com/login

# 3. Fill credentials
pinchtab fill "css:#username" "myuser"
pinchtab fill "css:#password" "mypass"

# 4. Ask user to solve CAPTCHA in the headed window
# 5. After login, cookies persist in profile for future headless use
```

### Bulk operations with rate limiting

```javascript
// In pinchtab eval - add delays between API calls
(async () => {
  for (const item of items) {
    await fetch(url, { method: "POST", body: JSON.stringify(item) });
    await new Promise((r) => setTimeout(r, 2000)); // 2s delay
  }
  window.__result = "done";
})();
```

### Read async eval results

```bash
# pinchtab eval returns {} for async results
# Store result in window.__result, then read it after a delay
pinchtab eval '(async () => { window.__r = await fetch(...).then(r => r.text()); })()'
sleep 2
pinchtab eval 'window.__r'
```

Related Skills

zellij-helper

15
from shepherdjerred/monorepo

Zellij terminal multiplexer for session management, layouts, and pane operations When user mentions Zellij, terminal multiplexer, zellij commands, sessions, panes, layouts, or tabs

vite-react-helper

15
from shepherdjerred/monorepo

Vite + React for fast modern web development - build config, HMR, hooks, state management, and performance patterns When user works with Vite, React, creates components, manages state, uses hooks, or configures Vite builds

typescript-helper

15
from shepherdjerred/monorepo

TypeScript development guidance for type systems and tooling When user works with .ts or .tsx files, mentions TypeScript, or encounters type errors

terraform-helper

15
from shepherdjerred/monorepo

Terraform and OpenTofu infrastructure as code - HCL, providers, modules, state management, and CLI operations When user works with .tf files, mentions Terraform, OpenTofu, tofu, HCL, infrastructure as code, or tf commands

talos-helper

15
from shepherdjerred/monorepo

Talos Linux cluster administration using talosctl When user mentions Talos, talosctl, or Talos cluster operations

tailscale-helper

15
from shepherdjerred/monorepo

Tailscale VPN and networking - CLI operations, MagicDNS, ACLs, SSH, funnel, serve, and network administration When user mentions Tailscale, tailscale commands, VPN, MagicDNS, tailnet, or Tailscale networking

sentry-helper

15
from shepherdjerred/monorepo

Complete Sentry operations via sentry-cli and REST API - issues, releases, source maps, traces, events When user mentions Sentry, errors, issues, releases, source maps, error tracking, stack traces

rust-helper

15
from shepherdjerred/monorepo

Rust development with cargo, clippy, rustfmt, testing, and common patterns When user works with .rs files, mentions Rust, cargo, clippy, rustfmt, or encounters Rust compiler errors

python-helper

15
from shepherdjerred/monorepo

Python development with modern patterns, type hints, testing, and tooling When user works with .py files, mentions Python, pip, pytest, ruff, uv, or encounters Python errors

prisma-helper

15
from shepherdjerred/monorepo

Prisma ORM for type-safe database access - schema design, migrations, queries, relations, and connection management When user works with Prisma, database schemas, migrations, Prisma Client queries, or mentions prisma commands

pagerduty-helper

15
from shepherdjerred/monorepo

Complete PagerDuty operations via REST API - incidents, schedules, oncall, services, orchestrations When user mentions PagerDuty, incidents, oncall, schedules, escalation, pages, alerts

op-helper

15
from shepherdjerred/monorepo

Helps with 1Password CLI (op) for secure secret retrieval and management When user mentions 1Password, secrets, op command, or asks about credential management