Skip to main content
skill CX Codex

derive-client — Claude Code skill: what it does, how to install

derive-client records browser network traffic into a HAR archive and turns captured internal endpoints into a standalone API client or CLI script.

Apache-2.0 ★ 1,216 updated 2026-10-24

Install into Claude Code · Plugin marketplace All methods and platforms ↓
/plugin marketplace add fcakyon/claude-codex-settings
/plugin install agent-browser@claude-settings
Open on GitHub

What derive-client does

This skill reverse-engineers website endpoints to replace repeated browser automation with direct HTTP calls. It uses agent-browser to capture network traffic during user flows and stores JSON response bodies directly inside a HAR file. After recording, jq filters out analytics domains and telemetry to extract real schemas, headers, and request payloads.

The workflow generates typed functions for each tracked flow, such as search or detail views. Session tokens and cookies export via agent-browser cookies get --json into separate configuration files instead of hardcoded strings. Response bodies inside the HAR are capped at 2 MB.

Captured HAR files contain active session credentials, which means keeping them out of version control is mandatory. Each generated endpoint is verified with live HTTP calls against the target service.

What it helps with

  • record browser network traffic into a HAR archive
  • isolate internal JSON endpoints from analytics telemetry
  • build a standalone CLI client from captured requests
  • extract session cookies into runtime configuration

Example prompts for the agent

  • Derive an API client from the network traffic of this site
  • Record the search flow and turn it into a direct HTTP script
  • Extract endpoints from /tmp/site.har and write typed client functions

How to install derive-client

1Plugin marketplace

/plugin marketplace add fcakyon/claude-codex-settings
/plugin install agent-browser@claude-settings

This installs the whole agent-browser plugin with all its skills

2Skills CLI (Vercel)

npx skills add fcakyon/claude-codex-settings --skill derive-client -a claude-code

3Manually: put the files in place

~/.claude/skills/derive-client/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/derive-client/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about derive-client

How to install derive-client in Claude Code?

Install it using npx skills add fcakyon/claude-codex-settings --skill derive-client -a claude-code. Alternatively, add it via plugin commands: first run /plugin marketplace add fcakyon/claude-codex-settings, then /plugin install agent-browser@claude-settings.

What does derive-client do?

It captures site interactions into a HAR file, isolates internal API endpoints, and builds standalone scripts that call HTTP services directly without running a browser.

How does derive-client handle authentication?

It exports active cookies using agent-browser cookies get --json and configures the generated client to load tokens and cookies from runtime environment variables or a cookies.json file.

Source text

SKILL.md · Apache-2.0
---
name: derive-client
description: Reverse-engineer a website's internal API by recording browser traffic into a HAR file, then generate a standalone client or CLI that calls the endpoints directly, with no browser needed after the first recording. Use when asked to "derive a client", "build a CLI for <site>", "reverse engineer this site's API", "record network requests", "turn this site into an API", or when the same site will be automated repeatedly and direct HTTP calls would beat driving the browser every time.
allowed-tools: Bash(agent-browser:*), Bash(npx agent-browser:*)
license: Apache-2.0
---

# Derive an API client from a recorded session

Driving a browser is the right tool for the first visit and the wrong tool for the hundredth. This skill records a site's network traffic once while you use it, then turns the captured requests into a standalone client (script, CLI, or library) that talks to the site's internal API directly.

The recording alone contains everything needed: agent-browser embeds text response bodies (JSON/HTML/JS) in the HAR by default, so endpoint shapes can be studied offline after the browser is closed.

## Workflow

```
1. Record     Start HAR capture, drive the flows you want in the client
2. Identify   Find the real API endpoints among the noise
3. Extract    Pull request shapes, response schemas, and auth material
4. Generate   Write the client, one function per flow
5. Verify     Call every endpoint for real before declaring done
```

## 1. Record

```bash
agent-browser network har start          # embeds text response bodies by default
# ... drive the site: search, open a detail page, paginate, etc. ...
agent-browser network har stop /tmp/site.har
```

- Exercise **every flow the client should support**, and run each one at least twice with different inputs (two search terms, two detail pages). Diffing the recorded URLs reveals which parts are parameters.
- If the site needs login, log in **before** starting the HAR so credentials don't land in the recording unnecessarily. The session cookies are exported separately in step 3.
- `--content all` embeds binary bodies too (base64); `--content none` disables embedding. Per-body cap is 2 MB.

While the session is still open, `agent-browser network requests` and `network request <id>` give the same data interactively — but only the HAR survives navigation and browser close, so prefer it for anything multi-page.

## 2. Identify endpoints

Query the HAR with `jq`:

```bash
# All JSON API calls: method, URL, status
jq -r '.log.entries[]
  | select(.response.content.mimeType | test("json"))
  | "\(.request.method) \(.response.status) \(.request.url)"' /tmp/site.har
```

Ignore analytics and infrastructure noise: telemetry endpoints (`/collect`, `/track`, `/beacon`, `/log`), third-party domains (google-analytics, segment, sentry, datadog, intercom, hotjar), and static assets. The real API is usually first-party, JSON, and correlates with the actions you performed.

## 3. Extract shapes and auth

```bash
# Full detail for one endpoint: request headers, POST body, response body
jq '.log.entries[] | select(.request.url | test("api/search"))
  | {request: {method: .request.method, headers: .request.headers,
     postData: .request.postData.text},
     response: .response.content.text}' /tmp/site.har
```

- **Response schema**: read `.response.content.text` — this is the real payload, use it to derive types.
- **Auth**: compare request headers across endpoints. Look for `authorization`, `cookie`, `x-csrf-token`, `x-api-key`, and site-specific `x-*` headers. Replay only the ones that matter — test by omission in step 5.
- **Cookies**: export the live session with `agent-browser cookies get --json > cookies.json` for the client to load at runtime. Never hardcode cookie values into generated source.

## 4. Generate the client

- One function per recorded flow (`search(query)`, `getItem(id)`), typed from the observed response bodies.
- Auth material (cookies, bearer tokens) loads from a file or environment variable, with a clear error telling the user to re-run the browser login when it expires.
- Reproduce the headers the API actually requires — some sites 403 without a matching `user-agent`, `referer`, or `x-requested-with`.
- Keep pagination, sort, and filter parameters that appeared in the recorded query strings as function options.

## 5. Verify

Call every generated function against the live API and compare the response shape with the recording. Common failures:

| Symptom | Cause | Fix |
|---------|-------|-----|
| 401/403 | Expired or missing session | Re-login via agent-browser, re-export cookies |
| 403/419 on writes | CSRF token is per-session or per-form | Fetch the token endpoint first, or keep that flow browser-driven |
| Works then breaks | Signed/expiring request params | Fall back to the browser for that step; derive the rest |
| Different shape than HAR | A/B tests or geo-dependent responses | Re-record and treat the union as optional fields |

## Caveats

- Internal APIs are unversioned and change without notice — keep the HAR so the client can be re-derived.
- Respect the site's terms of service and rate limits; add delays for bulk fetching.
- HAR files contain live session credentials (cookies, tokens, POST bodies). Treat them like secrets: keep them out of version control and delete them when done.

© fcakyon · Apache-2.0 · fcakyon/claude-codex-settings

Similar skills

All skills for Browser and scraping →

From the same set113

The whole set →
ultralytics-branding ultralytics-branding loads Ultralytics brand rules: colors, typography, logo specs and tone for PDFs, slides, documents, marketing emails and social posts. CX Codex +1 ★ 1,216repo stars email-design email-design — a skill for Claude Code and Codex that handles transactional email layout. Styles account confirmations, password resets and billing receipts to match your application branding. CX Codex +1 ★ 1,216repo stars commit-creator commit-creator reviews staged changes, plans a single commit or a logical series, and writes concise commit messages. Available for Claude Code and Codex. CX Codex ★ 1,216repo stars site-architecture The site-architecture skill for Claude Code and Codex plans or restructures site structure, including page hierarchy, navigation, URL patterns, breadcrumbs, and internal links. CX Codex +1 ★ 1,216repo stars polar-local-environment The polar-local-environment skill for Claude Code manages Polar’s local Docker setup, including stack operations, service debugging, and separate environments for multiple worktrees. CX Codex +1 ★ 1,216repo stars yolo-training yolo-training reads YOLO26 training curves and results.csv, diagnoses overfitting or poor mAP, and points to the cheapest fix first. CX Codex +1 ★ 1,216repo stars supabase-cli Equips coding agents to run Supabase CLI commands for local environments, schema migrations, edge function deployments, and TypeScript type generation. CX Codex +1 ★ 1,216repo stars payment-testing The payment-testing rule explains local checks for login, Stripe events, subscription renewals, refunds, and the backoffice. Use it when a payment flow behaves differently in your local stack. CX Codex +1 ★ 1,216repo stars

Project sponsors

Companies that keep this analytics open