# Run and track PageSpeed tests with Claude Cowork

> Tracking PageSpeed scores with Claude Cowork means giving the desktop agent a review to finish on its own, reading stored scores and running a few fresh tests through the xSpeed Hub connector on your Claude account.

Page: https://xspeedcache.com/agent/claude-cowork/pagespeed-tests/
Last updated: October 2026

Cowork suits the review you would rather not sit through. You have several sites and a client wants a speed summary by the end of the day. You describe the job once: read the stored PageSpeed history for each site, flag any whose mobile score fell since the last run, and retest only those. Cowork works through list_sites and get_score_history on its own, then reports back, which is quicker than asking the same question twelve times in a chat.

The part to watch is the retest. run_speed_test is a PageSpeed Insights run from the Hub, mobile or desktop, one site at a time, and each one can take up to about two minutes. It also spends a speed-test allowance that is shared, so a long task can use more of it than you meant. Put a limit in the brief: retest at most three sites, mobile only, and stop there. run_benchmark can time every site cached and uncached in one call, but it returns response times and no Lighthouse score.

Cowork uses the connectors already on your Claude account, so xSpeed Hub has to be added in Claude first. Cowork loads connectors when a session starts, so open a new session after you add it. Ask for the result as a short summary per site, with the score, the metric that moved and the date of the run it came from.

## Set up Claude Cowork once

### 1. Put your sites in xSpeed Hub

Sign in at app.xspeedcache.com with Google or email; the Hub is free and has no site cap. Then connect each WordPress site from its own dashboard: click Connect Hub in the xSpeed Cache top bar, then Connect via xSpeed Hub. Each site needs the free xSpeed Cache plugin.

### 2. Add xSpeed Hub to your Claude account

Cowork does not keep its own connector list. In Claude, go to Customize > Connectors, click Add custom connector, name it xspeedhub, paste the URL, choose Sign in now and, if asked, Register automatically. The full steps, including the Team and Enterprise route, are on the Claude page: /agent/claude/.

```
https://app.xspeedcache.com/xspeed/mcp
```

### 3. Connect, then start a new Cowork session

Click Connect on the connector and approve access on the xSpeed Hub page. Cowork loads the connectors enabled for your account when a session starts, so open a new Cowork session after you connect. You can also switch the connector on from the + menu in the chat box.

```
Customize  >  Connectors  >  xspeedhub  >  Connect
```

### 4. Set tool permissions before the first task

Open the connector under Customize > Connectors and set each tool to Always allow, Needs approval or Blocked. A sensible start is Always allow for the read tools and Needs approval for purge_cache, toggle_cache, update_settings and the other writes. Then pick a Cowork mode; Manual is the one that shows you each request.

```
Tool permissions: get_cache_status = Always allow
Tool permissions: purge_cache = Needs approval
```

Full setup: https://xspeedcache.com/agent/claude-cowork/

### Before you send a prompt that changes something

Reads change nothing on your sites, though contact_support emails xSpeed support. Writes run once your connection allows them, so your client's approval prompt and a read-only connection (the token's Read-only everywhere switch, or a Viewer sign-in) are the gates that matter. Cowork has three modes. Manually approve (Manual) pauses and asks you to Allow or Deny each action. Automatically approve (Auto) keeps working and blocks what Claude judges to be unsafe. Skip all approvals (Skip) asks nothing and checks nothing. Each connector tool also has a permission, set under Customize > Connectors. In Manual mode, Always allow runs, Needs approval asks and Blocked is denied; in Skip mode only Blocked stops a call. xSpeed Hub has no confirmation step of its own, so under Skip, or for any tool set to Always allow, a write runs as soon as your connection allows writes. Auto relies on Claude's own judgement, which is not a lock.

## Prompts

- Use xSpeed Hub to read the stored PageSpeed history for every site, list the ones whose mobile score dropped, and retest at most three of them on mobile.
- With xSpeed Hub, build a one-line-per-site summary of the latest desktop and mobile scores, with the date of each run.
- Ask xSpeed Hub for the benchmark history on shop and tell me whether response time improved after the settings change I made on Monday.

## Example session

```
You: Use xSpeed Hub to review PageSpeed across all my sites. Retest only sites whose mobile score dropped, and no more than two tests.
  → list_sites [read-only]: 5 sites in the default workspace: shop, blog, docs, landing, academy
  → get_score_history(site: shop) [read-only]: latest mobile 58, previous 64; LCP 4.2 s
  → get_score_history(site: blog) [read-only]: latest mobile 66, previous 65
  → get_score_history(site: docs) [read-only]: latest mobile 72, previous 72
  → get_score_history(site: landing) [read-only]: latest mobile 61, previous 59
  → get_score_history(site: academy) [read-only]: latest mobile 70, previous 68
Agent: Shop is the only site whose mobile score dropped, from 64 to 58. Blog, docs, landing and academy are flat or up. I will run one mobile test on shop, which leaves one test unused under your cap of two.
  → run_speed_test(site: shop, strategy: mobile) [uses quota]: mobile score 59, LCP 4.0 s, TBT 350 ms, saved to the Hub report history
```

## How it works

1. **Read before you test**: get_score_history returns the stored PageSpeed Insights and GTmetrix runs for a site: the score per run, with LCP, FCP, CLS, TBT, Speed Index and TTFB, mobile and desktop. It starts nothing. The Hub tells the agent to use it whenever you ask what your score is, or whether it improved, because a new test spends a shared allowance.
2. **Run a new test when you need one**: run_speed_test runs a real PageSpeed Insights audit on the site from the Hub and returns the score, the Core Web Vitals and the top opportunities. strategy is mobile (the default) or desktop, and one call tests one of them. It can take up to about 2 minutes, so the agent should say it is running before it calls.
3. **Test the other device**: Mobile and desktop scores differ, often by a lot. For both, the agent makes two calls, one per strategy. A failure is reported with its reason: PageSpeed not configured, quota reached, a timeout, or a site the audit cannot reach.
4. **Measure the cache on its own**: run_benchmark times the home page with the cache bypassed and again served from cache, and returns the response times. It is a read tool, and it accepts site: "all" for every site. It does not return a Lighthouse score, so the agent must not use it to answer a PageSpeed question.
5. **Compare over time**: get_benchmark_history returns past benchmark runs, uncached against cached, together with the settings changes on the same timeline, which is how you answer "did that change help?". For PageSpeed scores over time, use get_score_history.

## Reference

| | |
| --- | --- |
| Read stored scores | get_score_history (read): PageSpeed Insights and GTmetrix runs, starts nothing |
| Metrics per run | Score, LCP, FCP, CLS, TBT, Speed Index, TTFB, for mobile and desktop |
| Run a new test | run_speed_test (write, uses the shared allowance): one PageSpeed Insights run per call |
| strategy | mobile (default) or desktop |
| Duration | Up to about 2 minutes per run |
| Why a test is a write | It spends a shared PageSpeed allowance and stores a report; it changes nothing on the site |
| Read-only access | A connection token with Read-only everywhere on, or a Viewer member's sign-in: run_speed_test is refused; get_score_history, run_benchmark and get_benchmark_history still work. An OAuth sign-in gets the scopes the client asks for |
| Benchmark | run_benchmark (read): cached against uncached response time for the home page, no Lighthouse score |
| Benchmark history | get_benchmark_history (read): past runs plus settings changes on the same timeline |
| Scheduling | The Hub does not schedule PageSpeed tests itself; its daily pass only reads reports the plugin already stored |
| Where a new test is stored | In the Hub's own report history, the one the Hub dashboard shows |

## Rules

- Check the history first. Ask for stored scores before starting a test, and run a new one only when you want a fresh measurement or something changed.
- Never answer a PageSpeed or Lighthouse question with run_benchmark. It times your own cache and carries no score.
- run_speed_test changes nothing on your site, but the Hub classes it a write because it spends a shared allowance. A connection token with Read-only everywhere on, or a Viewer sign-in, refuses it. An OAuth sign-in gets the scopes the client asks for, so there your client's approval prompt is the gate.
- Lab scores move a few points between runs of the same page. The agent should compare like with like, same site, same strategy, and not report one run's difference as a trend.
- A new test does not run on a timer. If you want a regular test, the agent has to be started by something else, such as a scheduled job in your client, and a scheduled run that spends the allowance should be one you are comfortable leaving unattended.

## Good to know with Claude Cowork

Cowork has three modes: Manual asks you to Allow or Deny each action, Auto keeps working and blocks what Claude judges unsafe, and Skip asks nothing and checks nothing. Each connector tool also has its own setting under Customize > Connectors: Always allow, Needs approval or Blocked. Set get_score_history to Always allow and run_speed_test to Needs approval, and stay in Manual for a review you want to watch. Auto is a model judging its own agent, so it is not a lock, and Skip lets every test run. The Hub adds no confirmation of its own, and each test spends shared allowance. If you walk away from a broad review, state a hard cap on tests in the prompt and set run_speed_test to Blocked. Read-only access for Cowork means signing in as a Viewer member of the workspace, or sending the connection token with Read-only everywhere on through Claude's Request headers beta, because that switch covers only the connection token.

## More prompts for this job

They work in any client connected to xSpeed Hub.

- Using xSpeed Hub, what is the mobile PageSpeed score for shop? Check the stored history before you run anything.
- Use xSpeed Hub to run a new mobile PageSpeed test on blog and tell me the score, LCP and the top opportunities.
- With xSpeed Hub, test shop on desktop and mobile and tell me which one is worse.
- Using xSpeed Hub, has the PageSpeed score on docs improved over the last few runs?
- Use xSpeed Hub to benchmark the cache on every site and tell me which one saves the least time.
- Did turning on minification on shop help? Use xSpeed Hub to compare the benchmark history around that change.
- My PageSpeed test failed on staging. Use xSpeed Hub to tell me why.

## Frequently asked questions

### Do I set up xSpeed separately in Claude Cowork?

No. Cowork uses the connectors on your Claude account, so you add xSpeed Hub in Claude first and Cowork picks it up. Your connection scope still applies. An OAuth sign-in gets the scopes the client asks for, write included by default, and the Hub's Read-only everywhere switch covers only the connection token. A Viewer member's sign-in is always read-only, so it lets Cowork read history but refuses run_speed_test.

### Can Cowork retest every site on a schedule?

xSpeed Hub has no scheduler for PageSpeed tests, and whether Cowork can run a task on a timer is a question for Anthropic's Cowork documentation. If you leave anything unattended, sign in as a Viewer member so the task can read get_score_history but cannot start a test, because each test spends shared allowance.

### What is the difference between run_speed_test and run_benchmark?

run_speed_test runs a real PageSpeed Insights audit and returns a Lighthouse score with Core Web Vitals. run_benchmark measures how fast your own cache answers compared with an uncached request for the home page, and returns no Lighthouse score. Use the first for "what is my PageSpeed score" and the second for "is my caching working".

### How long does a PageSpeed test take?

A single run can take up to about 2 minutes, so the agent should tell you it has started before it calls. One call tests one device, mobile or desktop, so checking both takes two calls.

### Can I ask for the last score without running a new test?

Yes. get_score_history reads the stored PageSpeed Insights and GTmetrix runs for the site and starts nothing. The Hub tells the agent to read it first whenever you ask what your score is, because a new test spends a shared allowance.

### Will the Hub run PageSpeed tests on a schedule?

No. The Hub does not schedule PageSpeed tests itself. Its daily pass re-verifies sites, snapshots cache status and pulls the PageSpeed and GTmetrix reports the plugin has already stored, and it can alert on a score regression. If you want regular new tests, they have to be started by a client that can run scheduled jobs.

### Why is a speed test treated as a write tool?

It does not change your site. The Hub classes run_speed_test as a write because it spends a shared PageSpeed allowance and stores a report, and a read-only connection (the connection token with Read-only everywhere on, or a Viewer sign-in) should not be able to cost the owner anything. Such a connection can still read stored scores with get_score_history.

## Track PageSpeed scores with other agents

[Claude Code](https://xspeedcache.com/agent/claude-code/pagespeed-tests/) · [Claude](https://xspeedcache.com/agent/claude/pagespeed-tests/) · [ChatGPT](https://xspeedcache.com/agent/chatgpt/pagespeed-tests/) · [Codex](https://xspeedcache.com/agent/codex/pagespeed-tests/) · [Cursor](https://xspeedcache.com/agent/cursor/pagespeed-tests/) · [GitHub Copilot in VS Code](https://xspeedcache.com/agent/github-copilot/pagespeed-tests/) · [Windsurf](https://xspeedcache.com/agent/windsurf/pagespeed-tests/) · [Gemini CLI](https://xspeedcache.com/agent/gemini-cli/pagespeed-tests/) · [Antigravity](https://xspeedcache.com/agent/antigravity/pagespeed-tests/) · [Zed](https://xspeedcache.com/agent/zed/pagespeed-tests/) · [Kiro](https://xspeedcache.com/agent/kiro/pagespeed-tests/) · [OpenCode](https://xspeedcache.com/agent/opencode/pagespeed-tests/) · [OpenClaw](https://xspeedcache.com/agent/openclaw/pagespeed-tests/) · [Hermes Agent](https://xspeedcache.com/agent/hermes-agent/pagespeed-tests/) · [Grok Build](https://xspeedcache.com/agent/grok-build/pagespeed-tests/) · [ChatGPT dots](https://xspeedcache.com/agent/chatgpt-dots/pagespeed-tests/) · [Grok](https://xspeedcache.com/agent/grok/pagespeed-tests/) · [Grok Bot](https://xspeedcache.com/agent/grok-bot/pagespeed-tests/) · [Muse](https://xspeedcache.com/agent/muse/pagespeed-tests/) · [Manus](https://xspeedcache.com/agent/manus/pagespeed-tests/) · [Kimi Code](https://xspeedcache.com/agent/kimi/pagespeed-tests/) · [Paperclip](https://xspeedcache.com/agent/paperclip/pagespeed-tests/) · [NanoClaw](https://xspeedcache.com/agent/nanoclaw/pagespeed-tests/)

## More with Claude Cowork

- [Purge the WordPress cache with Claude Cowork](https://xspeedcache.com/agent/claude-cowork/purge-cache/)
- [Find out why WordPress pages are not cached with Claude Cowork](https://xspeedcache.com/agent/claude-cowork/troubleshoot-cache/)
- [Scan a website for speed problems with Claude Cowork](https://xspeedcache.com/agent/claude-cowork/speed-scan/)
- [Raise a WordPress site's PageSpeed score with Claude Cowork](https://xspeedcache.com/agent/claude-cowork/optimize-site/)
- [Tune WordPress cache settings with Claude Cowork](https://xspeedcache.com/agent/claude-cowork/cache-settings/)
- [Warm the WordPress cache with Claude Cowork](https://xspeedcache.com/agent/claude-cowork/preload-cache/)
- [Set up the Redis object cache with Claude Cowork](https://xspeedcache.com/agent/claude-cowork/object-cache/)
- [Manage Cloudflare caching with Claude Cowork](https://xspeedcache.com/agent/claude-cowork/cloudflare/)
- [Manage every WordPress site at once with Claude Cowork](https://xspeedcache.com/agent/claude-cowork/fleet/)

## Documentation

- How to run a speed test: https://xspeedcache.com/docs/external-score/
- PageSpeed Insights integration: https://xspeedcache.com/docs/pagespeed-insights-integration/
- Running speed tests in xSpeed Hub: https://xspeedcache.com/docs/hub-speed-tests-and-notifications/
- How to run a PageSpeed audit: https://xspeedcache.com/docs/pagespeed/
