# Charles Jones: Full Content Export

> Every blog post on https://charlesjones.dev as raw markdown, concatenated into one file for LLMs. Generated on 2026-11-13T05:12:16.265Z.

Index: https://charlesjones.dev/llms.txt

---
## One Sentence Makes Claude Own Your Codebase. In a Global CLAUDE.md, It Needs Limits.

Source: https://charlesjones.dev/blog/claude-code-codebase-ownership-claude-md
Published: 2026-11-10
Modified: 2026-11-10
Tags: Claude Code, AI, Claude Fable 5.2, Prompt Engineering, Context Engineering, Developer Tools

> Anthropic's prompting guide for Claude Fable 5.2 says one sentence about code ownership gets the model to merge repeated code and make related fixes. I put that sentence in my global CLAUDE.md and it wasn't enough. Here are the seven things I had to add, and a version of my section you can copy.

Anthropic's [prompting guide for Claude Fable 5.2](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-fable-5-2#say-who-owns-the-code) has a section called "Say who owns the code." Here's the finding in Anthropic's words:

> Claude Fable 5.2 responds closely to what the prompt says about who owns the code it works on. In Anthropic's testing on small coding tasks, when a prompt said nothing about ownership or presented the code base as someone else's, the model tended to add to the existing structure, even when that repeated existing code. It also tended to report nearby problems instead of fixing them. When the prompt says the code base is the model's own, the model often merges repeated code and makes related fixes without being asked.

The fix is one sentence:

```text
This codebase is yours: what it's for and how it's built are your call, and you'll keep building on it.
```

In Anthropic's testing on small coding tasks, the model merged repeated code in about half of the tries with that sentence, and in under a tenth of the tries without it.

I tried it. I put the sentence in my user-level `CLAUDE.md`, the file Claude Code loads in every project on my machine, and on its own it wasn't enough. One sentence can't tell my own repos from my forks of other people's, so it grew into a full section.

<Callout type="info">

Short version: the sentence works, but in a file that loads in every repo you also have to tell Claude which repos are yours, which aren't, and what "yours" doesn't include. A copy-ready version of my section is near the end.

</Callout>

## Why One Sentence Wasn't Enough

I worked the section out with Claude Code, checking each rule against the folders, git remotes and worktrees on my disk. Here are the seven things I had to add, and why.

### 1. A Global File Reaches Every Repo

A user-level `CLAUDE.md` loads everywhere, including my clones and forks of other people's projects. "This codebase is yours" is the wrong instruction there. A maintainer reviewing my pull request wants the smallest diff that fixes the bug, and the guide itself says to leave the sentence out "where the user owns the code and wants it changed as little as possible."

So the section starts by telling Claude to work out who owns a repo from its path before it plans or edits. One folder holds my code, and another holds everyone else's. For the second one, the section says it outright: "You are a guest here."

### 2. It Collided With a Rule Already in the File

My global file already tells Claude to list the problems it notices outside the task and leave them alone until I name the ones I want fixed. The ownership sentence says the opposite: if you own the code, fix what you find.

I didn't want Claude guessing which one wins, so I spelled it out. In the code the task touches, Claude merges duplicates, fixes the bugs it finds, and changes structure that's in the way. Anything outside that, it reports. In my threads, that has kept Claude focused on the task.

### 3. A Guest Has to Know Whose Repo It Is

Following the maintainers' rules only works if Claude can find the maintainers' repo, and you can't go by the remote name. In a fork, `origin` is my fork and the maintainers' repo is `upstream`. In a direct clone, `origin` is the maintainers' repo.

So the section tells Claude to run `git remote -v`. The maintainers' repo is `upstream` when that remote exists and `origin` when it doesn't.

### 4. Worktrees Don't Follow the Folder Rule

Going by the path breaks down with worktrees. Mine sit in two folders, and a worktree of one of my forks sits in a third place: inside the folder for other people's code. So the worktree rule doesn't look at the folder at all. A worktree has the same owner as the repo it came from, and the first line of `git worktree list` shows that repo.

<Callout type="info">

I run Claude Code inside [T3 Code](https://t3.codes/), an open-source control plane for coding agents. It's one app that runs Claude Code, Codex and other agents on the subscriptions you already have. It has become a fundamental part of my workflow lately, and the worktrees it creates for threads are why this section needs a worktree rule.

</Callout>

### 5. "Yours" Needs Limits

"What they're for and how they're built are your call" is a lot to hand an agent that can also push, deploy and delete. So I wrote down what it doesn't cover:

- I still set the task and make the product decisions. Claude makes the engineering choices and says what it chose.
- A destructive, hard-to-reverse or outward-facing action still needs my confirmation.
- A repo's own `CLAUDE.md` still applies.

### 6. A Fork Gets Two Kinds of Change

Some changes to a fork go back to the maintainers in a pull request. Others are for me alone. The section names both paths and has Claude ask which one applies, once, before the first edit.

A change headed to the maintainers follows their rules and touches only what the fix needs. A change for me alone can depart from their rules, and it stays small and on its own branch so the fork stays easy to update. [My Clawdmeter fork](https://github.com/charlesjones-dev/Clawdmeter) is an example: it carries a bunch of customizations I'll likely never ask to merge upstream. Either way, Claude never pushes, opens a pull request or an issue, or comments on the maintainers' repo until I say so. Anything it posts there goes out under my name.

### 7. "Accessible" Needs a Level

If Claude is going to keep building on my code, I want it built to my standards: secure, performant and accessible. "Accessible" can't be checked until it names a version and a level, so the section says WCAG 2.2 level AA.

## The Section, Ready to Copy

This is the section from my `CLAUDE.md`, with my name and folders swapped for placeholders.

```markdown
## Code Ownership

The owner of a codebase decides how much freedom you have in it. Find the owner from the repo's path before you plan or edit.

### `<folder for your own repos>`: yours

<your name> (the user) and <your company> own every codebase under `<folder for your own repos>`. These codebases are yours: what they're for and how they're built are your call, and you'll keep building on them.

- Work as the owner, not as a guest. In the code that your task touches, merge duplicate code, fix the bugs you find, and change the structure when it's in the way. Don't add a new function beside an old one that does the same job.
- You maintain this code for the long term. Keep it secure, performant and accessible to WCAG 2.2 level AA.
- The user still sets the task and makes the product decisions. Make the engineering choices yourself, and say what you chose.
- Ownership doesn't lift any other rule. The repo's own `CLAUDE.md` still applies. A destructive, hard-to-reverse or outward-facing action still needs the user's confirmation.
- A problem in code that the task doesn't touch gets reported, not fixed. Don't fix it until the user asks.

### `<folder for other people's repos>`: the maintainers'

Other developers or organizations own every codebase under `<folder for other people's repos>`. Each one is a clone of the maintainers' repo, or a fork of it. What the codebase is for and how it's built are the maintainers' call. You are a guest here.

Run `git remote -v` to find the maintainers' repo. It is the `upstream` remote when that remote exists, and the `origin` remote when it doesn't.

Before the first edit, find out where the change goes. If the user hasn't said, ask once, during planning.

- **The change goes to the maintainers in a pull request.** Follow the maintainers' rules: the contributor guide, code style, commit format, tests and PR template. Change only what the fix or feature needs. Don't refactor, rename, reformat or upgrade dependencies, and don't fix nearby problems. Report those problems to the user instead. Keep the user's own files, such as a `CLAUDE.md`, out of the branch.
- **The change is for the user only.** You can depart from the maintainers' rules. Keep the change small and on its own branch, so the fork stays easy to update from the maintainers' repo.

In both cases:

- Never push to the maintainers' repo, and never open a pull request or an issue or post a comment there, until the user tells you to in the current task.
- The code you write must be secure and performant. Where it has a UI, it must be accessible to WCAG 2.2 level AA.

### Worktrees

A git worktree has the same owner as the repo it came from. The first line of `git worktree list` shows that repo.

- Worktrees sit under `<folder for worktrees>`. Most come from repos in `<folder for your own repos>`, so they are yours.
- A worktree that comes from a repo in `<folder for other people's repos>` belongs to the maintainers, wherever it sits.

### Anywhere else

Don't assume an owner for code outside these folders. If the answer changes what you would do, ask the user.
```

<Callout type="warn">

Edit the placeholders before you save it:

- `<your name>` and `<your company>`: who owns your code. Drop the company if you don't have one.
- `<folder for your own repos>`: where your own projects live.
- `<folder for other people's repos>`: where you keep clones and forks.
- `<folder for worktrees>`: where your worktrees get created. List more than one folder if you need to.

WCAG 2.2 level AA is my accessibility standard, so change it if yours is different.

</Callout>

Yes, that's 20 words turned into more than 500, in a file that loads on every turn. I've argued for [cutting a CLAUDE.md down to what Claude can't work out from the repo](/blog/claude-opus-5-context-engineering-what-to-delete), and I think this still qualifies. Nothing in a repo says whether I want it treated as mine.

## Do You Need All of It?

If all your work is in repos you own, you can skip most of this. Put the guide's sentence in each project's `CLAUDE.md` and keep the limits from reason 5.

I'm keeping mine. Since it went in, Claude takes ownership of my codebases in the threads where it applies, and it stays on the task while it does.

<Callout type="success">

Anthropic's [prompting guide for Claude Fable 5.2](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-fable-5-2#say-who-owns-the-code) is the source for the sentence and the numbers in this post. Its "Say who owns the code" section is short, and it covers what the sentence costs, which I skipped here.

</Callout>

---

## Hosting a Vision Model for Medical Images Under HIPAA: Self-Host, AWS Bedrock, or Azure OpenAI?

Source: https://charlesjones.dev/blog/vision-models-phi-hipaa-self-host-bedrock-azure
Published: 2026-09-17
Modified: 2026-09-17
Tags: AI, Healthcare, HIPAA, Security, Enterprise, Compliance, AWS Bedrock, Azure OpenAI, Self-Hosting, Multimodal AI

> A working engineer's guide to running a text-plus-image AI model on protected health information. What PHI, covered entity, and BAA mean in plain English, the three realistic hosting paths (self-hosted open-weight models, AWS Bedrock, Azure OpenAI and Foundry), where the paperwork gets murky for image inputs specifically, and the checklist to run before the first byte of PHI moves.

I've done a good bit of research lately on how to put an AI model in front of two kinds of data at once: clinical notes and the medical images that go with them. X-rays, CT scans, tissue samples under a microscope. The data is protected health information, so the first thing you hear is "we can't use hosted AI for this."

That sentence turned out to be half right, and the wrong half took the most reading to untangle. This is the write-up I wish I had found at the start: the research I did as an engineer, for other engineers, architects, and the technical people at healthcare organizations, health-tech startups, the contract research firms that run clinical trials, and consultancies who get handed this exact problem.

The short version: finding a model that can look at an x-ray and read the chart is the easy part. Deciding where that model runs, and under what contract, is the whole job.

<Callout type="info">

If you already know what a BAA is and only want the hosting comparison, skip to [Three places the model can run](#three-places-the-model-can-run). The table at the end of that section is the one-screen summary.

</Callout>

## The model question is mostly solved

"Multimodal" means the model takes more than one kind of input in a single request, usually text plus images. The class you want is vision-language models, and every current frontier model from Anthropic, OpenAI, Google, and the rest is one. Sending a chest x-ray alongside the written report and asking "does the report match the image?" is a normal API call, the same shape as sending a screenshot of a bug.

So the answer to "is there a model that can do this" is yes, and has been for a while. The questions that remain take work:

- **Accuracy on your task.** A general vision benchmark tells you nothing about how a model handles your specific kind of image. You need your own evaluation set.
- **Edge cases.** Poor image quality, a patient who does not look like the training data, a smudge from the scanner. What the model does when it should say "I can't tell" matters more than the happy path.
- **DICOM and 3D scans.** Medical images ship in DICOM, the file format hospitals use, and a CT or MRI is a stack of image slices with patient metadata in the file headers. Most APIs want a PNG or JPEG. Somebody has to pick which slices to send, convert them, and strip the metadata. I underestimated this part when I started reading.
- **Where the model is allowed to run.** This is the rest of the post.

One framing point. None of this makes the model a diagnostic device. A model that sorts which cases a doctor looks at first, drafts a report for a doctor to sign, checks whether a patient qualifies for a clinical trial, or pulls structured data out of scanned records still needs a human reviewing the output, validation on your own data, and often a separate regulatory review. FDA's rules for software that acts as a medical device, the FDA record-keeping rules for trials (21 CFR Part 11), the clinical trial quality standard (GCP), and the ethics board that oversees a study (the IRB) all have opinions here. They are out of scope for this post, and the hosting decision does not settle them.

## The HIPAA vocabulary you need

Most of the confusion I ran into came from people (me included, early on) using these words loosely. Plain-English versions:

**PHI, protected health information.** Any health information that can be tied to a specific person, held by a healthcare organization or one of its vendors. An x-ray with a patient ID on it, a doctor's note, a trial participant's record. If you can tie it to a person, it is PHI.

**Covered entity.** A healthcare provider, a health insurer, or a clearinghouse (the middlemen that process claims and billing). The HIPAA Privacy and Security Rules apply to these organizations directly.

**Business associate.** Anyone outside the covered entity's own workforce who handles PHI on its behalf. That covers a cloud provider processing PHI, a model API vendor receiving it, and a consultancy building the system on real data. A business associate's own subcontractors who touch PHI are business associates too, all the way down.

**BAA, business associate agreement.** The written contract HIPAA requires between a covered entity and each business associate, and between associates and their subcontractors. In plain terms, it says what the vendor is allowed to do with the data, requires them to protect it, requires them to tell you about breaches, lets the government inspect them, makes their own vendors sign the same terms, and lets you walk away if they break it.

**HIPAA-eligible versus HIPAA-compliant.** This is the one that tripped me up early on. Cloud providers label services "HIPAA-eligible," meaning "we will cover this under our BAA." It does not mean your workload is compliant. The cloud provider secures the platform. Securing what you build on it is your job: configuration, access control, encryption, logging, how long you keep data, and the documentation proving all of it. Eligibility is where compliance starts.

**Enforcement.** Nobody certifies you as HIPAA-compliant up front. The federal health privacy office investigates after a breach or a complaint, and both the healthcare organization and its vendors can be fined, and in bad cases prosecuted.

**De-identification.** HIPAA gives you two approved ways to scrub data so it no longer points at a person: strip out a fixed list of 18 identifiers (names, dates, record numbers, and so on), or have a qualified expert certify that the chance of identifying anyone is very small. The legal names for those are Safe Harbor and Expert Determination. Data that passes either test is no longer PHI, and you can send it to any model you like with no BAA. The catch with medical images is that identifiers hide in two places you might not think to look: text stamped onto the picture itself (a patient name in the corner of an x-ray) and the metadata stored inside the image file. Renaming the file fixes neither. And plenty of clinical trial work needs to keep patients identifiable, which is why the rest of this post exists.

## Three places the model can run

Once the data is PHI and stays PHI, there are three realistic answers to "where does the model run." Bring the model to the data on hardware you control, or send the data to a hosted model under a BAA with one of the two clouds that have paved this road. Each path trades capability, ops load, and paperwork differently, and for image inputs the paperwork is not equal across clouds.

### Path A: bring the model to your data

Run open-weight vision-language models on GPUs you control: on-prem servers, a private cloud tenancy, or dedicated GPU instances inside your own private cloud network. Serve them with vLLM or a packaged inference container (NVIDIA's NIM-style microservices are the usual enterprise wrapper).

The open-weight options worth knowing as of mid-2026:

- **MedGemma 1.5** (Google, January 2026). The best-known purpose-built open medical model. The 4B variant handles x-ray, CT, MRI, and microscope slides on a single GPU or edge hardware. The 27B text variant scores higher on medical question-answering benchmarks. Released under Google's HAI-DEF terms, which you should read before assuming "open" means "do whatever."
- **GLM-4.5V** (Zhipu). A general-purpose open vision-language model, 106B mixture-of-experts with about 12B active. Not medically tuned. Useful when a small medical model runs out of reasoning on a complicated mixed image-and-text question.
- **gpt-oss-120b and gpt-oss-20b** (OpenAI, Apache 2.0). Text only, so they cover the clinical-notes side and none of the images. The 120B fits on a single 80 GB GPU.
- **DeepSeek-R1** (MIT license). Text-only reasoning model, and a big one. A university hospital documented running it on-prem for radiology, which is the kind of evidence I was looking for.
- **Research-grade radiology models.** RadFound (8.1 million x-rays and scans across 10 image types), CheXmix (Stanford, chest x-rays plus reports, CVPR 2026), and OpenMedQ (fully open training data across microscope slides, x-rays, and scans). These are research artifacts. Evaluate them if you need domain-specific options, but nobody is on call for them.

The deployment that convinced me self-hosting is not theoretical is [University Hospital Bonn's write-up](https://arxiv.org/html/2604.22768) of a self-hosted LLM service for its radiology department. They locked it onto its own network segment with the minimum permissions it needs, built it so the model underneath can be swapped out (vLLM does the serving), tested it in a real pilot with clinicians, and now run it as a permanent service for more than 10,000 employees processing PHI. A hospital did this, with the constraints a hospital has.

What you get: PHI never leaves your boundary, so there is no business associate at the model layer and no BAA to negotiate for it. Full control over retention, logging, network isolation, and model versioning, which matters for trials because a hosted model can be updated under you mid-study. Predictable cost once volume is high.

What it costs you: the entire security posture is yours, where a cloud BAA would have carried part of it. Open-weight models trail the frontier on general reasoning, and the medical-tuned small models are strong on narrow tasks and weaker on complex mixed reasoning. You need GPU ops expertise, meaning capacity planning, driver and CUDA patching, on-call, and an evaluation harness on your own data. And if "your own GPUs" are a cloud's managed GPU instances, that compute still has to be HIPAA-eligible under the cloud's BAA. Self-hosting removes the model vendor from the chain and leaves the infrastructure provider in it.

One more cost that is easy to miss on a whiteboard: your own hardware caps how much the model can do at once. A hosted API hides a fleet of GPUs behind one endpoint, so a burst of a few hundred requests gets absorbed without you noticing. On a self-hosted box, a single GPU can only hold one copy of the model and work through a limited number of requests at a time, and a vision model chewing on a large scan or a stack of slices ties it up longer than a short text prompt would. With one or two GPUs, that means requests queue instead of running in parallel, throughput is whatever that card can push, and a nightly batch job over a few thousand studies can turn into a multi-day run. Getting real concurrency means buying enough GPUs to run several model copies side by side, and that hardware sits idle most of the day. Budget for the capacity you need at peak, not the average, or accept that some workloads will wait. This ceiling is the reason I stopped pushing further on self-hosted models for anything beyond my own use. A local model for coding works fine, because one developer sends one request at a time. A department sending hundreds is a different machine.

Best fit: existing GPU infrastructure, strict rules about which country or building the data can live in, clinical trial rules that forbid external processing, or a need to freeze a model version for the life of a study.

### Path B: AWS Bedrock

Bedrock is AWS's managed service that puts frontier models from Anthropic, Meta, Mistral, Amazon, and others behind one API inside your AWS account.

The paperwork here is the simplest of the three. Bedrock is on the list of services AWS will cover under its HIPAA agreement, and that includes AgentCore, the add-on for hosting agents. You sign one agreement with AWS and it covers every model you can reach through Bedrock, whether it comes from Anthropic, Meta, or anyone else. There is no separate contract with each model company. The agreement itself is a document you accept with a few clicks in the AWS console, and if your company already has an enterprise deal with AWS it is probably signed already. Compare that to going to a model vendor directly, where a BAA means a sales call and a negotiation. AWS also promises in writing not to use your data to train or improve its services, and the underlying infrastructure already carries the security certifications healthcare auditors ask about.

The caveats:

- **Coverage is per feature, not per product.** AWS's own terms say that if a specific Bedrock feature is not on the covered list, the agreement does not apply to it, and running patient data through it breaks the rules. Check the exact features you plan to use, plus everything around them (where files are stored, what orchestrates the calls, where logs go), in the region you plan to run in. AWS adds features faster than the list gets updated.
- **You still have to lock it down yourself.** The agreement covers AWS's side. Your side means keeping the model calls inside your private network instead of going over the public internet, encrypting prompts and outputs with your own keys, turning on audit logging, giving people and services the narrowest access that works and only for as long as they need it, keeping patient data in specific accounts and regions, using fake data in dev and test, and writing down where patient data flows. None of that comes turned on.
- **AWS's other AI products are not covered.** The chat assistants and coding copilots AWS sells are built on the same models but are not meant for patient data.
- **Models change when the vendor says so.** If you are running a study, pin the exact model version and write it down, because AWS retires old versions on the model vendor's schedule.

Net: as of this writing, Bedrock is the most defensible paper trail for running a hosted frontier model on text plus medical images.

### Path C: Azure OpenAI and Microsoft Foundry

Microsoft's version: OpenAI's models hosted by Microsoft, plus a catalog of other companies' models (Foundry), running inside your Azure account.

The paperwork is even easier than AWS if your company already has a deal with Microsoft. The HIPAA agreement is built into Microsoft's standard terms, so there is nothing extra to sign, and Microsoft publishes a list of which services it covers. Microsoft also promises not to train on your data. One thing to keep straight: Azure OpenAI and OpenAI's own API are two different companies' products. A deal with Microsoft does not cover OpenAI's API, and the other way around.

Here is the catch for images. I could not find anything in Microsoft's official documents that says image inputs are covered by the HIPAA agreement. The clearest answers I found were on [Microsoft's public Q&A forum](https://learn.microsoft.com/en-us/answers/questions/2106637/azure-openai-hipaa-compliance-status), from community members rather than Microsoft itself. They say coverage applies to normal text use, and that images and preview features are not covered unless Microsoft says so explicitly. Two other forum questions raise the same doubt from different angles: one asks whether a partner vision model from the Foundry catalog is covered at all, and one asks whether Microsoft's abuse monitoring (it stores flagged prompts and can have a human look at them) falls inside the agreement. If you instead run a model's weights on your own Azure VMs, that is Path A on Azure hardware, and the responsibility is yours.

The honest summary: the answer is not written down anywhere I could find, and the people asking are healthcare organizations asking in public. Azure can be the right pick if you already live there. For image inputs, get Microsoft to confirm coverage in writing before any patient data moves.

### Going direct to the model vendor

Anthropic and OpenAI both offer BAAs through sales-assisted enterprise processes. The consumer products and the standard API tiers do not include one and must not receive PHI. For most teams this route takes longer than Bedrock or Azure, because you are negotiating a contract instead of accepting one that already exists. It is a legitimate path, and rarely the fastest one.

### Side by side

| | Self-host | AWS Bedrock | Azure OpenAI / Foundry |
|---|---|---|---|
| BAA for the model layer | Not needed (you are the host) | One AWS agreement covers every Bedrock model | Included in Microsoft's standard terms |
| Image input coverage | Your responsibility | Covered when the feature is HIPAA-eligible | Verify in writing; text coverage is clearer than image coverage |
| Model capability | Open-weight: medical-tuned small models or large generalists | Frontier models from multiple vendors | OpenAI models plus the Foundry catalog |
| Model version control | Full | Pin versions; vendor deprecation schedule | Pin versions; vendor deprecation schedule |
| Ops burden | High | Medium (configuration still required) | Medium (configuration still required) |
| Time to first PHI request | Weeks to months | Days if the AWS agreement is signed | Days if you already have a Microsoft enterprise deal; longer to confirm image scope |

## The checklist I'd run before sending a byte of PHI

This is the order I would do it in, which is roughly the reverse of the order I researched it.

1. **Write down what you need.** What goes in (single images, DICOM files, 3D scans, free text, records), what comes out, how accurate it has to be, how fast, how much, and who checks the answers. Half the hosting argument goes away once this is on paper.
2. **Figure out whether the data is PHI.** Can you strip the identifiers, including text stamped on the image and the metadata in the file? Do the study rules or the ethics board forbid sending data outside? If you can strip it, do that and skip most of this post.
3. **Pick where the model runs before picking the model.** Whether you already own GPUs, and where the data is allowed to live, decide this faster than benchmarks do.
4. **Get coverage confirmed in writing for every service you touch.** That includes image inputs and any monitoring or logging the provider does on your traffic.
5. **Check coverage per feature and per region.** A "HIPAA-eligible" label on the product tells you nothing about the specific feature you are about to call.
6. **Build your test set first, using fake or scrubbed data.** No patient data touches a model until it has passed on that.
7. **Pin the model version and write it down.** Hosted models change under you.
8. **Write down where patient data goes.** Where it lives, how long it stays, who can read it, and what gets logged. Use fake data in dev and test.
9. **Keep a human checking the output, and treat the medical-device and trial rules as a separate project.** Picking a host does not answer them.

The thing that shifted for me over the course of this research is how little of the decision is about the model. I started out comparing benchmarks. I ended up reading contract terms and forum threads about abuse monitoring, because that is where the risk lives. The model can read the x-ray. Whether it is allowed to is a question for your paperwork, and the paperwork is different on every path.

<Callout type="warn">

I'm an engineer, not a lawyer, so treat this as a map and not legal advice. Before you send real patient data anywhere, run the plan past your legal team and the cloud provider's compliance people. I did this research in September 2026. The coverage lists and the models change often, so double-check the current ones before you build on anything here.

</Callout>

---

## Apple Rejected My App Eight Times. Here's the Playbook I Wish I Had.

Source: https://charlesjones.dev/blog/apple-app-store-rejection-playbook
Published: 2026-09-04
Modified: 2026-09-04
Tags: App Store, Apple, Swift, SwiftUI, StoreKit, iOS, macOS, SereneReader, Pulse, SiteGrade

> Three apps through App Review in one summer: SereneReader, Pulse, and SiteGrade. One of them collected eight findings in three rejection rounds. Here is what App Review flags, what the real cause usually is, and which rejections you answer with a reply instead of a build. Covers the sandbox-on-production trap, Sign in with Apple on macOS, closed version trains, Terms of Use metadata, and how to write the reply.

Between June and August 2026 I shipped three apps to the App Store: [SereneReader](https://apps.apple.com/us/app/serenereader/id6776072640), the native iOS and Mac client for my RSS platform, with an auto-renewing subscription; [Pulse](https://apps.apple.com/us/app/pulse-widgets-for-ga4/id6790556420), Google Analytics widgets for the Home Screen, the wrist, and the Mac menu bar; and [SiteGrade](https://apps.apple.com/us/app/sitegrade-security-check/id6790558285), a website security configuration report card for iPhone, iPad, and Mac.

SereneReader's Mac 1.0 went first and collected eight findings across three rejection rounds in a single week. Pulse was rejected twice for things that had nothing to do with code. SiteGrade went through with far less drama, because by then I had written down every trap the first two hit and run the list before submitting.

That list became a guidebook that lives in each app's repo. This post is the public version. It is organized around what App Review flags, what the real cause usually is, and the shortest path to "Ready for Sale." The single most useful thing in it is the first section, because most submission pain comes from treating "Apple rejected it" as one problem.

<Callout type="info">

If you're mid-rejection right now: scroll to the guideline number Apple cited. Several of the most common rejections (4.0 browser sign-in, 3.1.2(c) Terms of Use, 2.1(b) purchase errors) are answered with a reply or a metadata edit, and uploading a new build for them costs you a review cycle for nothing.

</Callout>

## Three Gates, Not One

There are three independent gates between your archive and the store. Each one fails differently and reports the failure somewhere different. The fixes do not overlap.

| Gate | Who runs it | How it fails | Where the real error lives |
|------|-------------|--------------|----------------------------|
| **Upload and processing** | Automated (ITMS) | The build shows "delivered" but never appears, or "Preparing build failed" with every CI step green | An **email** from App Store Connect with an `ITMS-xxxxx` code. The web UI shows nothing useful. |
| **Signing and export** | Xcode, Xcode Cloud, the developer portal | `exportArchive` exits 70, "No profiles for ... were found" | Portal state (App IDs, devices, capabilities), not your code |
| **App Review** | A human reviewer | A rejection citing a guideline number | Often the reviewer's *environment* (sandbox, region, account) rather than a bug |

Before debugging anything, identify which gate rejected you. I lost most of an evening once chasing a "failed" build through CI logs when the answer was sitting in my inbox as ITMS-90242, a missing `LSApplicationCategoryType` in the Mac target's Info.plist. Nothing in Xcode Cloud was red. The build had uploaded fine. Apple's processing step rejected it afterward and told me by email.

The rest of this post is mostly about the third gate, because that is where the confusing rejections live. Two rules for the first two gates before moving on:

- **Missing `LSApplicationCategoryType` (ITMS-90242) and missing App Sandbox (ITMS-90296)** are the two Mac delivery emails you will get once each. A networked Mac app also needs `com.apple.security.network.client`, or every request fails silently inside the sandbox. All three go in the project config once and never come back.
- **Export failures are almost always portal-side.** A provisioned capability not enabled on the App ID, zero registered Macs on the team (the automatic development export needs one), or a new embedded target with no explicit App ID. Read the portal before reading your code.

## The Sandbox-on-Production Trap

This is the most confusing subscription rejection Apple issues, and SereneReader got it on build 84, the third round.

The rejection reads "error message upon a successful in-app purchase." The reviewer buys the subscription, Apple's payment sheet succeeds, and the app then shows a server error. From the outside that looks like a broken purchase flow.

Here is what happens. App Review tests purchases in Apple's **Sandbox** environment. Your app posts the signed transaction to your **production** backend, which verifies the signature against Apple's root certificates and checks the `environment` field. Sandbox transactions are cryptographically valid, so if production accepts them, anyone with a sandbox Apple ID can mint a free subscription. A correctly built backend rejects them. The reviewer's purchase gets rejected by the same rule that protects you from fraud.

If you gate features off the tier your server reports (which you should, since local StoreKit state is not a source of truth), the reviewer sees the error and files 2.1(b).

My first defense was an allowlist: accept sandbox grants in production only for the demo account listed in App Review Information. That failed, because **reviewers go off-script**. The build 84 reviewer signed in with their own Apple ID and a Gmail account instead of the demo credentials, and the allowlist never fired.

The defense that works has no code in it:

1. **Put the sandbox check behind one environment flag** on the server. Staging accepts sandbox grants. Production rejects them.
2. **Flip that flag to allow for the review window.** Any verified Sandbox transaction now completes, regardless of which account the reviewer used. Real App Store purchases are production-environment and unaffected either way.
3. **Flip it back the moment the app is approved.** The risk during the window is that TestFlight testers can grant themselves the paid tier. For a short, watched window that is acceptable.
4. **Reset the demo account to the free tier before every submission.** A sandbox subscription granted on production never auto-expires, because sandbox renewal and expiry webhooks go to your sandbox notification URL. A demo account that bought last round still looks subscribed this round, and the reviewer never sees the paywall at all.

A few related rules that came out of building the subscription backend for SereneReader:

- **Finish transactions after the server acknowledges, never before.** Unfinished transactions redeliver through `Transaction.unfinished` and `Transaction.updates`, which is your crash and offline recovery path. Finish first and a failed sync silently loses the entitlement.
- **Permanent rejections must still be finished.** An expired purchase or an unverifiable payload will never succeed on retry. Leave it unfinished and it replays and re-fails at every launch forever. Keep transport errors and 5xx responses retryable; finish the 400s.
- **Re-buying an expired subscription can hand `purchase()` the original, already-expired transaction.** Handle a 400 on the purchase payload by finishing the stale transaction and syncing `currentEntitlements` instead.
- **Send `appAccountToken` with every purchase**, a UUID minted server-side per user before the purchase. It is how App Store Server Notifications map Apple's events to your accounts, and the server should reject a posted transaction whose token does not match the caller.

Pulse and SiteGrade have no backend. Their Pro unlocks are non-consumables verified on-device with StoreKit 2, so sandbox purchases complete in review without any of this. If you can design a paid app without a server, this entire section disappears.

## Sign in with Apple Is Two Gates on macOS

SereneReader's very first Mac rejection, build 74, was guideline 4.0: Sign in with Apple "not displayed as an equivalent option." The button was smaller than the Google and GitHub buttons above it.

Two separate guidelines cover this, and passing one does not pass the other:

- **4.8 says you must include it.** If your app offers any third-party sign-in, you must also offer a privacy-preserving option, and Sign in with Apple is the safe answer. Email plus a one-time code does **not** qualify, because the user cannot keep their email private. Removing Apple sign-in "to simplify" while keeping Google is a guaranteed rejection.
- **4.0 says it must render as an equal peer.** The reviewer compares size, shape, and prominence against your other login buttons. Color is exempt. Apple's button cannot be tinted anyway, so keep the official black-on-light or white-on-dark style and put it first in the group.

On macOS the problem is that SwiftUI's `SignInWithAppleButton` ignores `.frame()` on macOS. It draws at a small intrinsic size, centered, and `minHeight` does not help. iOS stretches the SwiftUI button correctly. On the Mac, the fix was wrapping AppKit's `ASAuthorizationAppleIDButton` in an `NSViewRepresentable` whose `sizeThatFits` returns the proposed size, with the `ASAuthorizationController` owned by a coordinator. Four lines of layout in SwiftUI became a small AppKit bridge, and that was the only code change the round needed.

Pulse has no account system at all. Google OAuth there is authorization to the user's own Analytics data, which only Google can grant, so there is nothing Sign in with Apple could log into. If 4.8 ever comes up for an app like that, the reply is one sentence explaining the difference.

### The Browser Sign-In Flag That Comes Back Every Round

On macOS, `ASWebAuthenticationSession` (and SwiftUI's `WebAuthenticationSession` wrapper) always opens the system default browser. There is no in-app variant like iOS's `SFSafariViewController`. This is the sanctioned flow. From the outside, though, a reviewer cannot tell it from a raw `NSWorkspace.open`, so both SereneReader and Pulse received the 4.0 flag "the app takes the user to the default browser to sign in."

A reply answers it. No code change. Apple's own next-step text says "if the app already uses this instance, reply and confirm." One paragraph confirming that web OAuth uses `ASWebAuthenticationSession` and that Sign in with Apple uses the native `ASAuthorizationController` and completes in-app is enough.

Two details matter here:

- **It is a boilerplate repeat flag.** SereneReader got it on build 76 and again on build 84 after confirming. Paste the confirmation paragraph into every reply for the life of the app.
- **Do not cite the "Wants to Use ... to Sign In" system dialog as proof.** With `preferredBrowserSession: .ephemeral`, macOS suppresses that prompt, so Google may show no dialog at all while GitHub shows its own authorize page. The shared code path is the proof.

The only code-level way to avoid the hand-off on macOS is to drop web OAuth there entirely. That is a product decision, and a big one.

## When "Everything Is Broken," Check Your CDN First

SereneReader build 76 came back with two findings at once: 1.5 Safety, "the Support URL does not work," and 2.1(a), "none of the sign-in methods work."

Neither was an app bug. Cloudflare was challenging the reviewer's region and user agent. The support page served a bot challenge, and every API call from the app got the same treatment. Two rejections, one firewall rule.

The pattern to recognize: when a reviewer reports that the Support URL errors **and** that all sign-in methods fail in the same round, the odds are overwhelming that it is infrastructure. Fix the rule, reply asking for a retest, and touch no Swift.

This one is now the first item on my pre-submission checklist for every app: load the Support URL and the Marketing URL from a clean browser in another region before submitting. It caught nothing on Pulse or SiteGrade, which is the point.

## Rejections You Fix in App Store Connect

A surprising share of rejections are answered by editing fields in App Store Connect. No binary, no new review of the build, usually a same-day turnaround. Five of them came up across the three apps.

**Terms of Use link missing (3.1.2(c)).** SereneReader's in-app paywall was already compliant: title, length, price, Restore Purchases, Terms and Privacy links beside the buy button. The finding was about the store listing. There is no dedicated "Terms of Use URL" field for the standard Apple EULA. Apple's own answer is a line in the **App Description**, such as `Terms of Use: https://example.com/terms`. A custom EULA goes in App Information under License Agreement instead. In-app links alone do not satisfy this, and it is the number one subscription rejection.

**Apple product names in the subtitle (5.2.5).** Pulse 1.1.0 shipped with the subtitle "Live visitors · Watch · Mac." Rejected. No Apple product name (Mac, iPhone, iPad, Watch, Vision Pro) may appear in the app name or subtitle in any locale, even as a plain platform list. Referential use in the description stays fine when the mark is an adjective on a generic noun ("your Mac menu bar"). The fix was editing the subtitle in every locale to generic surface nouns (wrist, desktop, menu bar) and resubmitting the existing build.

**Automated login pre-screen (before any human reads your notes).** Pulse 1.0.0 was rejected by a bot before any reviewer saw it. Apple's pre-screen detects login UI in the binary and, if the demo-account fields in App Review Information are empty, rejects on that alone. It does not read Review Notes. Pulse needs no login, because a one-tap Demo Mode exercises every feature with sample data, but the bot cannot know that. The answer was a Resolution Center reply confirming no login is required, the one-tap demo path, and a screenshot of the sign-in screen showing the "Try the demo" button. No new build.

**Describing a feature the build does not have (2.3.1).** This one I caught before submission, on SiteGrade. The drafted Mac description promised "Reports open in their own window." The app has exactly one `WindowGroup`. Reports open inside it. Marketing copy gets written from the design document, and the design is what got cut during the build. Before every submission, walk the description feature by feature against the app you built. The plan lies.

**No way to reopen the main window (macOS, 4.0).** Reviewers close the window, then look for it. If there is no File → New Window command that brings it back, that is a rejection. SereneReader got it on build 76. Add the menu item and handle the dock-icon reopen.

## The Version Train Closes Behind You

Once a marketing version is approved on a platform, that version is closed for that platform forever. Every later upload at the same `CFBundleShortVersionString` is rejected at delivery with ITMS-90062 or ITMS-90186. It arrives as an email. Nothing turns red in CI. Nothing appears in Resolution Center. The binary never reaches review.

The check is per platform on a shared app record, so iOS 1.0 uploads kept working after SereneReader's macOS 1.0 shipped. The catch is that a train stays open across many builds while a version is in review, so the bump feels unnecessary right up until the approval that closes it.

I wrote this rule into Pulse's knowledge base after the first hit, and still missed it on 1.1.1 build 54 two days later. Bump the marketing version in the first commit of a release wave, before the work starts, because by the end of the wave you will have forgotten. A metadata-only resubmission is a patch bump. Companion targets such as a watch app move in lockstep, since their version has to match the host app anyway. And never reuse a released marketing version because "it was only a metadata change."

A related note: **build numbers must be unique per version**, and if CI stamps `CFBundleVersion` from the build number, do not also enable App Store Connect's auto-increment. Pick one source of truth or they fight.

## Write the Review Notes Before the Reviewer Needs Them

By SiteGrade, the review notes were written before the first build was archived, because the first two apps had taught me what a reviewer needs to hear and what they will trip over without it.

**Lead with how to review without an account.** Pulse's notes now open with "NO LOGIN IS REQUIRED TO REVIEW THIS APP" and the one-tap demo path in the next sentence. That line exists because of the bot pre-screen above, and because a human reviewer who has to hunt for the demo path files a 2.1.

**If sign-in is passwordless, set up a review bypass.** App Store Connect's Sign-In Information has only Username and Password fields. If your app signs in with email plus a one-time code, the reviewer will fail to sign in and reject under 2.1 unless you pre-create a demo account on production and add a server-side fixed code scoped to that one email, gated by an environment variable. The fixed code must not count toward any per-IP or per-email rate limit, or a reviewer who retries gets a 429 and reports "sign-in is broken." Put the demo email in Username and the fixed code in Password, and use Review Notes to explain the flow without restating the credentials: "Sign-in is email on the first screen, then a 6-digit code on the second. The value provided as Password is that code." Apple's field help forbids raw credentials in the notes.

**Pre-answer the flags you know are coming.** SereneReader's and Pulse's notes both name `ASWebAuthenticationSession` up front, which answers the macOS browser flag before it is raised. SiteGrade's notes carry two paragraphs that head off a different worry entirely: the app declares an App Transport Security exception (`NSAllowsArbitraryLoads`), because testing whether a site redirects plain HTTP to HTTPS requires making a plain HTTP request. The notes say that, then state what the app does not do: no port scanning, no probing of anything the user didn't type, read-only GET requests to ports 443 and 80 equivalent to visiting the site in Safari. A reviewer reading "security" in an app name is going to wonder whether they are looking at an attack tool. Answer the question before it gets asked.

**Say where the paywall lives.** "Settings → Account shows the subscription, Restore Purchases, Terms, and Privacy." Reviewers change between rounds, and a reviewer who cannot find the purchase files 2.1 "could not locate the in-app purchase."

**Describe only what is in the submitted build.** Confirm the branch before naming a feature in the notes or a reply. Post-launch work sits on feature branches long before it ships.

Two pieces of paperwork belong in this section because they have multi-day latency and block everything downstream. **The Paid Apps agreement** must show Active before StoreKit will load products even in sandbox, and bank verification can take days. It is the single most common reason a paywall shows no products. **The Small Business Program** drops Apple's commission from 30% to 15% under the revenue threshold, but only takes effect the fiscal month after approval. Enroll before launch.

## Writing the Reply

Assume the reviewer will not read your reply in full. That is not a guess. More than once I have written a careful reply, had the next rejection cite something I answered in paragraph three, and realized the reviewer stopped at paragraph one. Reviewers work through a queue, and a long reply reads as an argument before it reads as a fix.

So the reply has one job: put the fix where it cannot be missed. The shorter the reply, the more of it gets read.

- **Lead with the fix**, one sentence per finding, in the order Apple listed them. If Apple listed one finding, the reply can be one sentence.
- **Cut everything that is not a fix or a confirmation.** No background, no apology, no explanation of how the bug happened. Every extra sentence pushes the next fix further down the page.
- **Confirm the boilerplate items explicitly every time**, even if you confirmed them last round. "Web sign-in uses ASWebAuthenticationSession. Sign in with Apple uses ASAuthorizationController and completes in-app."
- **Restate the sign-in path for the demo account in the reply** as well as in Review Notes.
- **Do not narrate infrastructure.** For the sandbox purchase fix, "we identified and fixed the issue that caused an error after a successful purchase; the purchase now completes" is the whole reply. Describing the mechanism invites follow-up questions, extends the cycle, and buries whatever comes after it.
- **Do not argue.** If you believe a finding is wrong, state the fact once, cite the API, and ask for a retest.
- **When a fix needs a new binary, upload it, attach it to the version, and then reply.** A reply on a version with no new build is treated as "no change."

## Things That Look Wrong and Are Not

A short list of behaviors that look like bugs and are correct. Do not "fix" them.

- macOS web OAuth opens the default browser. That is `ASWebAuthenticationSession` behaving normally.
- TestFlight testers pointed at production cannot earn a real subscription. Sandbox grants are rejected on purpose.
- The Apple sign-in button is a different color from your brand buttons. Apple requires its own style.
- Sandbox subscriptions renew every few minutes and expire after a handful of renewals. That is the sandbox clock.
- Products load as an empty list in a local Debug run without a `.storekit` file. Nothing sources them.
- One App Store Connect build serves internal TestFlight, external TestFlight, and the public release. You do not rebuild per audience, and public release is always a manual step.

## The Checklist I Run Now

This is the condensed version of what the three apps taught me. It runs before every submission, including the tenth.

1. Marketing version has not already been approved on this platform. Build number is unique for this version.
2. `LSApplicationCategoryType`, App Sandbox, and `network.client` are set on the Mac target. `ITSAppUsesNonExemptEncryption` is `false` if you only use standard HTTPS.
3. The privacy manifest in the binary matches the App Privacy questionnaire. Subscriptions add Purchase History to both.
4. Sign in with Apple is present and rendered as an equal peer on every platform, if any third-party login exists.
5. Demo account exists on production and is reset to the free tier. Structured Sign-In fields are filled. Review Notes explain the flow and where the paywall lives.
6. Support URL and Marketing URL load from a clean browser in another region.
7. Privacy Policy URL is set. Terms of Use link is in the App Description.
8. Every feature the description names exists in the build being submitted. No Apple product names in the name or subtitle in any locale.
9. macOS has a File → New Window command. Screenshots are at an accepted exact size.
10. For subscriptions: products are attached to the version submission, server notification URLs return 200 on a test notification, and the production sandbox-allow flag is flipped for the review window with a reminder set to flip it back.

Item ten has a detail that bit me once and deserves its own sentence. **The first auto-renewable subscription must be submitted together with a new app version.** Products sit in "Ready to Submit" until you attach them on the version page. Forget, and the app can be approved while the subscription is never reviewed, and the paywall shows nothing in production.

Eight findings in three rounds sounds like a lot, and at the time it felt like a lot. Looking back, one of them needed real code (the AppKit button), one needed a menu item, one needed a firewall rule, and the other five were answered with a reply or a field in App Store Connect. That ratio is the reason to look up the guideline number before opening Xcode.

<Callout type="success">

If you want to see what came out the other side: [SereneReader](https://apps.apple.com/us/app/serenereader/id6776072640), [Pulse](https://apps.apple.com/us/app/pulse-widgets-for-ga4/id6790556420), and [SiteGrade](https://apps.apple.com/us/app/sitegrade-security-check/id6790558285) are all live on the App Store for iPhone, iPad, and Mac. Apple's [App Review Guidelines](https://developer.apple.com/app-store/review/guidelines/) are the primary source for every guideline number in this post, and they change, so check the current text before relying on my summary.

</Callout>

---

## Anthropic Deleted 80% of Claude Code's System Prompt. Here's What to Delete From Yours.

Source: https://charlesjones.dev/blog/claude-opus-5-context-engineering-what-to-delete
Published: 2026-07-24
Modified: 2026-10-04
Tags: Claude Code, AI, Claude Opus 5, Prompt Engineering, Context Engineering, Developer Tools, Productivity

> Claude Opus 5 lands near Fable 5 intelligence at Opus 4.8 pricing, and the prompting habits that made Opus 4.8 good now make Opus 5 worse. Anthropic cut over 80% of Claude Code's system prompt with no measurable loss on coding evals. Here's how the model compares, plus what to cut from your CLAUDE.md, your verification instructions, your subagent caps, and the one API change that returns a 400.

Claude Opus 5 just shipped and the benchmark numbers are strong. The one that should reshape how most developers work sits outside the charts: Anthropic removed over 80% of Claude Code's system prompt for Opus 5, and their coding evals didn't move. Four fifths of the guidance came out and the model wrote code at the same quality.

Their explanation is more interesting than the number. In [their write-up on context engineering for Claude 5 models](https://claude.com/blog/the-new-rules-of-context-engineering-for-claude-5-generation-models), the team says they "were overconstraining Claude Code, both through our system prompt and in our CLAUDE.md files and skills." The guidance was fighting itself. One line said to leave documentation as appropriate while another said DO NOT add comments, and the model spent reasoning deciding which instruction won before it could touch a file.

Every constraint I've written into a CLAUDE.md over the last year was built for a model that needed the guardrail. Opus 5 mostly doesn't. Going by Anthropic's own guidance, some of those constraints will now cost me tokens and quality, because they stack on top of behavior the model already has.

So here's my migration plan: what I'll be cutting over the next few weeks, what goes in to replace it, and the two API changes that will break your integration if you skip them.

<Callout type="info">

Short version: delete your verification instructions, trim your CLAUDE.md down to what Claude can't work out from the repo itself, cap subagent spawning, and prompt for response length because effort no longer controls it. Run `/doctor` if you'd rather have Claude Code do the trimming for you.

</Callout>

## Where Opus 5 Lands Against Fable 5 and Opus 4.8

Before any of the prompting changes, you need to know what you're tuning for.

Claude Fable 5 is the ceiling of the lineup. Opus 5's pitch is that it gets close to that ceiling at Opus pricing, which is where the interesting comparisons come from. Against Opus 4.8, the pricing is identical, so the upgrade is a model-ID swap with no budget conversation attached.

| Benchmark | Result |
|-----------|--------|
| Frontier-Bench v0.1 | More than doubles Opus 4.8's score, at a lower cost per task |
| CursorBench 3.2 (max effort) | Within 0.5% of Fable 5's peak score, at half the cost per task |
| OSWorld 2.0 | Beats Fable 5's result, at just over a third of the cost |
| ARC-AGI 3 | Three times the next-best model's score |
| Zapier AutomationBench | Around 1.5x the next-best model's pass rate for the same cost per task |
| Organic chemistry | 10.2 points above Opus 4.8 |
| Protein function prediction | 7.7 points above Opus 4.8 |

Cursor summed up the positioning in one line in [the release post](https://www.anthropic.com/news/claude-opus-5): "near Fable 5 intelligence at Opus speed and cost." Aider's take was the same shape, describing it as approaching Fable-level performance at half the cost.

Two other data points from the launch partners are worth more than the benchmark table for anyone running long agentic sessions. QuantumThinking measured Opus 5 solving their tasks with a seventh of the reasoning tokens and under half the latency of Opus 4.8. Lovable reported it as "steadier, with far less variance run to run." Peak capability makes a good chart. Low variance is what decides whether an unattended run finishes clean, and that's the part I care about when a plan doc has eight phases queued up.

Where the model is strongest, in the order it'll matter to most developers:

- **Multi-file agentic coding.** Larger refactors and end-to-end feature work, finishing tasks rather than leaving stubs and placeholders behind. It performs best when handed the complete specification up front and left alone to run.
- **Code review and bug-finding.** High precision and high recall in the same pass, and the accuracy holds at lower effort settings.
- **Long-horizon work.** A 1M token context window as both the default and the maximum, with instruction following and tool calling staying consistent across the whole window.
- **Vision and UI replication.** Chart, document, and diagram understanding improved enough that prompt-side workarounds you wrote for older models deserve a re-test before you keep carrying them.
- **Multi-agent coordination.** Writer-verifier patterns hold up, with few cases of agents clobbering each other's work.

Pricing is $5 per million input tokens and $25 per million output, unchanged from Opus 4.8 (accurate as of July 2026, check [current rates](https://platform.claude.com/docs/en/about-claude/pricing) before you budget against it). Fast mode runs roughly 2.5x quicker at twice the base price.

So the practical picture: Fable 5 stays the pick when you need the absolute ceiling and cost is not a constraint. For everything else, Opus 5 lands close enough to that ceiling that the price gap decides it. Coming from Opus 4.8, there's no tradeoff to weigh at all, which is exactly why the prompting changes below matter. The model got better, and the scaffolding you built for the old one is still sitting in your context window.

## Two API Changes Before Any Prompting Talk

One of these returns a 400, so it goes first.

**Thinking is on by default.** On Opus 4.8, requests ran without thinking unless you set `thinking: {"type": "adaptive"}`. On Opus 5 that same request thinks, and the model decides when and how much on each turn. The wire value is unchanged, so `thinking: {"type": "adaptive"}` still works and means the same thing as the default. What bites is `max_tokens`: it's a hard cap on total output, thinking plus response text. Any workload that ran thinking-free on 4.8 needs that number revisited before it starts truncating.

**Disabling thinking now depends on your effort level.** `thinking: {"type": "disabled"}` is accepted only at effort `high` or below. Pair it with `xhigh` or `max` and every request returns a 400. It's enforced per request, and it's a breaking change from 4.8 where the two settings were independent. If you disable thinking at high effort today, either drop effort to `high` or below, or keep the effort level and remove the `thinking` field.

The rest of the platform changes are upside:

- **1M token context window** as both the default and the maximum. There's no smaller variant to choose, and instruction following, tool calling, and reasoning stay consistent through the window.
- **The full effort ladder including `max`**, with no beta header.
- **Prompt cache minimum drops to 512 tokens** from 1,024 on Opus 4.8. Short system prompts that couldn't cache before now can, with no code change.
- **Mid-conversation tool changes** in beta, so you can add or remove tools between turns without throwing away the prompt cache.

## The Instructions to Delete Today

These are the ones going first, ordered by how much I expect them to be costing me.

### "Verify your work"

Opus 5 verifies its own work without being asked. If your system prompt says "include a final verification step for any non-trivial task" or "use a subagent to verify," those lines now stack on top of behavior the model already runs. Anthropic's [Opus 5 prompting guide](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5) is blunt about it: instructions like these cause over-verification, and removing them cuts wasted tokens with no loss in quality.

Same story for "double-check your answer" and "re-verify before responding." The model catches and fixes its own mistakes well. Telling it to do the thing it already does buys you a second pass you paid for and didn't need.

This is the one I'd have least expected, because verification instructions always felt free. They aren't. On a long agentic run, an extra verify loop per phase adds up to real money, which makes it the first thing I'm measuring once I've cut it.

### "Only report high-severity issues"

This one is a trap specific to code review. Opus 5 finds real bugs at a high rate per pass, and its extra findings are mostly genuine problems rather than false positives. Accuracy holds up at lower effort settings too, so you can run a fast pass at review time and a deeper one later.

But if your review prompt says "be conservative" or "only report high-severity issues," the model takes that literally and reports less than it found. Ask for everything, then filter in a separate pass. You get the model's real recall instead of its guess at where your severity bar sits.

The same logic applies to any review pass you run: different reviewers surface different classes of bug, and muzzling one of them at the prompt level defeats the point of running it.

### Uncapped subagent delegation

Opus 5 delegates to subagents more readily than earlier models. On genuinely independent tracks of work that's a win, and its writer-verifier coordination holds up with few cases of agents overwriting each other. On small tasks it multiplies cost and wall-clock time for nothing.

If your harness supports subagents, tell it when delegation earns its cost:

```text
Delegate to a subagent only for large tasks that are genuinely
independent and parallelizable, such as a wide multi-file
investigation. Do not delegate work you can finish yourself in a
handful of tool calls, and do not use subagents to verify or
double-check your own work. If one subagent can complete the task,
use one rather than several, and keep spawn counts low.
```

The decision framework for when parallel delegation beats a single context still holds. What changed is that the model now reaches for delegation on its own, so the cap earns its place in the prompt more than the encouragement does.

## Your CLAUDE.md Is Probably Costing You Quality

Everything in a checked-in CLAUDE.md loads on every single turn. That was always a token cost. On Opus 5 it's also a quality cost, because the file is where most of us stored the constraints the model no longer needs.

Anthropic's guidance is to keep CLAUDE.md lightweight: a brief description of what the repository is, plus the gotchas specific to it. Skip anything Claude can work out by reading files.

Claude Code will do the cut for you. `/doctor` (aliased as `/checkup`) starts by deduplicating your local CLAUDE.md against the checked-in one. Then it trims the checked-in file, pulling out anything Claude could derive from the codebase, and moves what survives into skills and nested CLAUDE.md files that load on demand. The split it uses is the useful part:

| Cut | Keep |
|-----|------|
| Directory layouts | Pitfalls and gotchas |
| Dependency lists | Rationale for decisions |
| Architecture overviews | Conventions that differ from tool defaults |

It reports findings first and asks before changing anything. The CLAUDE.md trim check needs Claude Code v2.1.206 or later.

My own CLAUDE.md fails this test in an obvious way. It carries a full `src/` directory tree and a stack rundown, both of which Claude reconstructs in about three tool calls.

<Callout type="warn">

The test I'm going to apply to every line in a CLAUDE.md: could Claude figure this out by reading the repo? If yes, delete it. You're paying for it on every turn and it's crowding out the lines that carry real information.

</Callout>

## Rules Become Judgment

The clearest before-and-after from Anthropic's post is their commenting instruction. Here's what Claude Code used to carry:

```text
In code: default to writing no comments. Never write
multi-paragraph docstrings or multi-line comment blocks — one short
line max. Don't create planning, decision, or analysis documents
unless the user asks for them — work from conversation context, not
intermediate files.
```

Here's what replaced it:

```text
Write code that reads like the surrounding code: match its comment
density, naming, and idiom.
```

One sentence, and it produces better results across more codebases than the rule set did. The rule version fails the moment you point it at a repository whose house style includes docstrings. The judgment version reads the room.

That same swap generalizes. The table below is the shape of the whole shift:

| Then | Now |
|------|-----|
| Give Claude explicit rules | Let Claude use judgment |
| Provide tool usage examples | Design better tool interfaces |
| Front-load all guidance upfront | Progressive disclosure |
| Repeat the rule in every context | State it once, in the tool description |
| Hand-maintained CLAUDE.md memory | Automatic memory |
| Plain markdown specifications | Rich references: code, HTML, tests |

The tool-interface row is the one most teams will sleep on. If you're writing usage examples to teach the model how to call your tool, the better fix is usually a more expressive parameter set. A well-named, well-typed interface teaches the model how to use it without spending context on demonstrations.

## The Thing You'll Notice First: It Talks More

Default responses run longer on Opus 5 than on earlier Opus models, it narrates while it works by announcing each move before making it, and the reports and summaries it writes to disk come out longer as well. All three are the same instinct showing up in different places.

The instinct is to reach for the effort parameter. That doesn't work. Effort controls how much the model *thinks*, not how much it *says*, so turning it down cuts thinking volume without reliably shortening the visible response. You have to ask for length explicitly.

For conversational verbosity:

```text
Keep responses focused, brief, and concise. Keep disclaimers and
caveats short, and spend most of the response on the main answer.
When asked to explain something, give a high-level summary unless an
in-depth explanation is specifically requested.
```

In a long system prompt, repeat a compressed version near the end. Anthropic suggests a small tagged block:

```text
<tone_preference>
Keep outputs reasonably concise.
</tone_preference>
```

For agentic narration, describe the cadence you want rather than banning the behavior:

```text
Before your first tool call, say in one sentence what you're about to
do. While working, give a brief update only when you find something
important or change direction. When you finish, lead with the
outcome: your first sentence should answer "what happened" or "what
did you find," with supporting detail after it for readers who want
it.
```

Positive examples of the style you want beat instructions about what not to do. That holds in both directions, so the same lever turns narration up if you want a chattier agent.

For written deliverables, one line does most of the work:

```text
Match the length of written documents to what the task needs: cover
the substance, but do not pad with filler sections, redundant
summaries, or boilerplate.
```

One more flavor of chattiness, and this is the one that bites in user-facing products. Opus 5 narrates corrections to its own earlier statements more than previous models, which reads as flakiness to anyone on the other side of the screen. Scope it to corrections that matter:

```text
Only correct an earlier statement when the error would change the
user's code, conclusions, or decisions. State corrections plainly and
briefly, then continue the task. For slips that change nothing for
the user, make the fix and move on without noting it.
```

## Effort Is the Cost Dial Now

The [effort parameter](https://platform.claude.com/docs/en/build-with-claude/effort) affects every token in the response: text, thinking, and tool calls. Lower effort means fewer tool calls and terser preamble, which is why it's a better cost control than trying to shorten prompts.

The recommendation for Opus 5 starts in a familiar place and then diverges:

| Effort | When to use it on Opus 5 |
|--------|--------------------------|
| `xhigh` | The starting point for coding and agentic work |
| `high` | The API default. Most other intelligence-sensitive workloads |
| `medium` | Use liberally wherever your evals show quality holds |
| `low` | Same, plus subagents and high-volume work |
| `max` | Tasks that justify unconstrained token spend |

The part to act on: `low` and `medium` are meaningfully stronger on Opus 5 than the same settings on earlier Opus models. If you carried effort defaults over from 4.8, those numbers are stale. Run a fresh sweep against your own evals rather than reusing what worked before. The same applies to any prompt-side vision workarounds you tuned for older models, since chart, document, and UI-replication performance moved as well.

Two operational notes that cost people money:

- **At `xhigh` or `max`, set a large `max_tokens`.** 64k is a reasonable starting point. The model needs room to think and act across tool calls, and `max_tokens` caps thinking plus text together.
- **Hold effort constant inside a cached conversation.** Effort shapes the rendered prompt, so changing it between requests throws away your cached prefixes. Vary effort across workloads, not within a session you're relying on cache hits for.

If you're already breaking work into token-aware phases, effort slots into that model cleanly: cheap phases run at `medium`, the phases where correctness is load-bearing run at `xhigh`.

### Don't turn thinking off to save money

Lower effort is the right lever for cost. Disabling thinking carries two failure modes beyond the 400 error covered earlier.

The model can write a tool call into its user-facing text instead of emitting a structured `tool_use` block. The turn completes, the call never runs, and in an agentic loop that leaked text stays in conversation history and poisons later turns. It shows up most on tool-heavy workloads like search. If you have to keep thinking disabled, give the model explicit permission to talk before a call: `You may say a brief sentence before using a tool.`

The second is internal XML tags leaking into visible output. If your system prompt contains a rule telling the model not to think or not to reason, delete it, because that instruction makes the leakage more likely. Use a general instruction instead: `Do not include internal or system XML tags in your response.` Naming `<thinking>` tags specifically works worse than the general form.

## What Still Earns Its Place in Context

Deleting is most of the work. A few things went the other way and got more valuable.

**Tool interfaces.** Context spent on a clearer parameter design pays off on every call. Context spent on usage examples pays off once and then sits there.

**Skills with progressive disclosure.** A skill's description stays in context so Claude knows the capability exists, while the body loads only when the task calls for it. That's the right home for procedures and reference material that are relevant sometimes. When a skill gets long, split it across multiple files so the model pulls in only the section it needs.

**References over descriptions.** For specifications, mockups, and prior art, an `@` mention of the real thing beats prose about it. Anthropic notes that code references generally work better than descriptions or screenshots, which matches how it's gone for me on earlier models: pointing at a working implementation communicates more than three paragraphs describing one.

**Curated team knowledge.** Claude Code's auto memory now writes what it learns about a project to a local file and loads it at session start, which covers a real chunk of what people were hand-maintaining in CLAUDE.md. What it doesn't cover is knowledge that needs to be shared and versioned with the codebase. That's why I still keep a checked-in knowledge base in the repo. A knowledge base survives a laptop swap and onboards the next person.

The distinction between those two is the whole game. Automatic memory replaced the tedious part of maintaining context. It didn't replace the part where a team decides what's worth remembering.

## Delete First, Then Measure

Every context-engineering habit worth having pre-July 2026 assumed a model that needed to be told. Opus 5 changes the default assumption, and the migration is mostly subtraction:

- Pull every "verify," "double-check," and "re-verify" instruction out of your prompts.
- Trim CLAUDE.md to the things Claude can't derive from the repository. Run `/doctor` and let it propose the cuts.
- Replace rule lists with judgment framing, starting with anything that dictates comment or documentation style.
- Cap subagent spawning explicitly if your harness supports delegation.
- Add explicit length and narration instructions, because effort won't do it for you.
- Re-run your effort sweep from scratch. `low` and `medium` are better than the numbers you measured on Opus 4.8.
- Check `max_tokens` on any workload that ran without thinking, and audit for `thinking: disabled` paired with `xhigh` or `max` before it 400s in production.

The 80% number is the headline, but the useful frame is what Anthropic called unhobbling. Most of us built prompt scaffolding to compensate for model limits that have since moved. That scaffolding doesn't quietly become a no-op. It stays in the context window, competes with the instructions that still matter, and compounds with behavior the model already has.

That list is my plan for the next few weeks rather than a report from the far side of it. I'm starting with this site's repo, where I already know which CLAUDE.md lines carry real information and which ones I wrote out of habit. If the token savings hold without a quality drop, the same pass goes to my other repos after.

Open your CLAUDE.md and read it as if you were the model. How much of it would you have worked out on your own?

<Callout type="success">

Start with `/doctor` in Claude Code v2.1.206 or later. It reports what it wants to cut from your CLAUDE.md before changing anything, which makes it a low-risk way to see how much of your context is doing real work. Anthropic's [Opus 5 prompting guide](https://platform.claude.com/docs/en/build-with-claude/prompt-engineering/prompting-claude-opus-5) and [context engineering post](https://claude.com/blog/the-new-rules-of-context-engineering-for-claude-5-generation-models) are both worth reading in full.

</Callout>

---

## I Open-Sourced the Engine Behind AccessHawk. Meet A11yHawk.

Source: https://charlesjones.dev/blog/a11yhawk-open-source-accessibility-scan-engine
Published: 2026-07-21
Modified: 2026-10-04
Tags: A11yHawk, AccessHawk, Accessibility, WCAG, Open Source, TypeScript, Playwright, Lighthouse, AI

> A11yHawk is the open-source, self-hostable accessibility scan engine that powers AccessHawk. Real browser capture, Lighthouse audits, and bring-your-own-key AI analysis against every WCAG criterion. Build your own accessibility tooling without the per-scan SaaS bill.

I've spent the last year building [AccessHawk](https://accesshawk.ai), a hosted accessibility scanning platform. Under the dashboards and the billing sits an engine: the code that loads a page in a real browser, audits it, has an AI model reason about what it sees, and writes the report. That engine is where all the hard problems live, and I've now extracted it and released it as open source (July 2026).

It's called [A11yHawk](https://github.com/charlesjones-dev/a11yhawk). It's on npm as [`a11yhawk`](https://www.npmjs.com/package/a11yhawk), licensed Apache-2.0, and it runs entirely on your own infrastructure. No accounts, no telemetry, nothing phoning home. If you've been looking at the accessibility tooling market and wondering why a URL scan costs what it costs, this post is for you.

<Callout type="info">

If you'd rather skip the reading: `npm install a11yhawk`, then `npx playwright install chromium` once, then `npx a11yhawk https://your-site.example`. That first scan is Lighthouse-only, needs no API key, and finishes in seconds with a JSON and markdown report. Add `--api-key` with an [OpenRouter](https://openrouter.ai/) key for full AI analysis.

</Callout>

## What a scan does

A11yHawk runs a single URL through a pipeline:

1. **Playwright capture.** The page loads in real Chromium. The engine takes a full-page screenshot (tiled to fit your AI provider's image limits), pulls the Chrome DevTools accessibility tree, and sanitizes the HTML down to its accessibility-relevant structure.
2. **Lighthouse audit.** The accessibility category runs in a subprocess against the same browser. Findings get mapped to WCAG criteria.
3. **AI analysis (optional).** The model receives the screenshot tiles, the accessibility tree, the sanitized HTML, the Lighthouse findings, and a condensed matrix of every WCAG criterion for the version and level you chose. It returns structured issues with remediation guidance for each one.
4. **Scoring.** The engine recomputes every score and statistic from the actual findings. Nothing numeric is trusted from the model.

Out the other side you get a structured JSON report, a human-readable markdown report, a self-contained HTML report page, and an annotated screenshot with issues boxed directly on the page. The HTML report is a single file with zero external dependencies, so it opens straight from `file://` and attaches to a ticket or CI artifact without a web server. It's also WCAG AA accessible itself, which felt like table stakes for an accessibility tool.

The AI layer is what automated checkers can't give you. Rule-based tools like Lighthouse and axe catch the mechanical failures: missing alt text, broken ARIA references, contrast below threshold. They can't tell you that your alt text is technically present but describes nothing, or that a visually obvious grouping has no programmatic relationship. A model looking at the rendered page, the accessibility tree, and the source together catches that second category.

## Free scans in seconds, AI depth when you want it

Both modes matter, and you pick per scan.

**Lighthouse-only mode** needs no API key and no configuration. It runs the audit and gives you a repeatable score in a few seconds. This is the mode you put in CI, run on every commit, and never think about the cost of, because there isn't one.

**AI mode** is bring-your-own-key. You hand the engine a key for OpenRouter or any OpenAI-compatible endpoint, pick any model your endpoint accepts, and pay your provider directly for the tokens. A11yHawk adds nothing on top. A full AI scan takes a few minutes and costs whatever your chosen model charges, which for most pages is a fraction of what per-page pricing on hosted scanners implies. The report even includes the token usage and cost in USD so you can see exactly what each scan cost you.

The minimal program is three lines:

```js
import { scan } from 'a11yhawk'

const report = await scan('https://example.com')
console.log(report.structured.overallScore, report.structured.issues.length)
```

And AI mode is one option away:

```js
const report = await scan('https://example.com', {
  llm: { apiKey: process.env.OPENROUTER_API_KEY },
  wcagVersion: '2.2',
  wcagLevel: 'AA',
})
```

## Why give away the engine behind a paid product

Fair question, since AccessHawk is how this engine pays for itself.

The accessibility tooling market has a pricing problem. Enterprise scanning platforms charge per page, per scan, or per seat, and the numbers climb fast once you're auditing more than a handful of pages. Meanwhile the actual scanning technology is not the moat those prices suggest. Browsers are free. Lighthouse is free. AI models are cheap and getting cheaper. What you're paying for at those price points is mostly the platform around the scan.

So I split it along that exact line. The engine, meaning capture, audits, AI analysis, scoring, and reports, is open source. AccessHawk sells what a platform genuinely adds: scheduled scans, history and trend tracking, dashboards, team access, and a managed API where you never think about browsers or infrastructure. If you want that, it's there. If what you want is the scan itself, A11yHawk gives you the whole engine to run on your own infrastructure, with nothing held back.

I'd rather compete on the platform than on artificial scarcity of the scan. And an engine that other people build on, file issues against, and harden in environments I never thought of makes the hosted product better too.

## Build your own accessibility product on it

This is the part I'm most interested to see people use. There's real demand for accessibility tooling that fits a team's own stack: an internal audit dashboard, or an accessibility feature inside a bigger product. The teams that want to build those keep running into the same wall, which is that the SaaS platforms sell dashboards, not engines.

A11yHawk is deliberately shaped like a component you embed:

- **Library API.** The `scan()` one-shot helper for scripts, and `A11yHawkEngine` when you're scanning many pages and want the browser kept warm across scans with configurable concurrency.
- **Typed failure taxonomy.** Every pipeline failure throws a `ScanError` with a `code` and a `retryable` flag. If you're building on a job queue, you map `retryable` onto your retry logic and you're done. Auth failures and malformed URLs fail fast; transient browser hiccups requeue.
- **Server mode.** `a11yhawk serve` exposes a small HTTP job API: `POST /scans` to enqueue, poll `GET /scans/:id`, fetch the rendered HTML report when it's done. Optional bearer-token auth, configurable concurrency, and in-memory jobs by design, so persistence stays your call.
- **Docker image.** Browser and system dependencies baked in. One `docker run` and you have a scanning service on your own network.

```sh
docker run --rm -p 4000:4000 ghcr.io/charlesjones-dev/a11yhawk:latest

curl -s localhost:4000/scans \
  -H 'content-type: application/json' \
  -d '{"url":"https://example.com"}'
```

That's a self-hosted accessibility scanning API in two commands. Put your own UI on it, wire it into your queue, or leave it as an internal service your other tools call.

Because it's built to sit behind services where scan URLs come from untrusted users, the security posture is default-safe: an SSRF request guard validates every request the scanned page makes, refuses private and loopback targets, re-resolves DNS per request, and blocks service workers. Scanning your own internal apps is a supported opt-in (`allowPrivateNetworks`), not a hole. The [security section of the README](https://github.com/charlesjones-dev/a11yhawk#security) covers the full posture, including the residual risks, honestly stated.

## Fail the build, not your users

Your pipeline already runs linting, tests, and probably a security scanner. Accessibility can sit in that same list instead of being an audit someone schedules after launch. The CLI has a built-in gate:

```yaml
# .github/workflows/a11y.yml
name: Accessibility
on: [push]
jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: npx playwright install --with-deps chromium
      - name: Accessibility gate
        run: npx a11yhawk https://your-site.example --fail-below 90 --format json,html --output a11y-report
      - if: always()
        uses: actions/upload-artifact@v4
        with:
          name: a11y-report
          path: a11y-report/
```

The job fails when the overall score drops below 90 and uploads the full report as an artifact either way. Lighthouse-only mode makes this free and fast enough to run on every push; add an API key from your secrets when you want the AI pass on top.

If you'd rather not install Playwright and Chromium on your CI runners, the hosted [AccessHawk API](https://accesshawk.ai/api-docs) runs the same scan over HTTP. Submit a URL, poll for the result or have a webhook call you when it finishes, and fail the build on the JSON. API access comes with AccessHawk's paid plans; the engine above stays free either way.

## Where it goes from here

A11yHawk is pre-1.0. The library API, CLI, and server mode are functional and tested, and the structured report shape is stable enough to build against, but the API may still shift between minor versions until 1.0. The [CHANGELOG](https://github.com/charlesjones-dev/a11yhawk/blob/main/CHANGELOG.md) is honest about that, and about what each release changed.

On the roadmap: a packaged GitHub Action wrapper, plus SARIF and JUnit output formats so findings land natively in code scanning dashboards and test reporters.

If you build something on it, I want to hear about it. Issues and PRs are welcome on [GitHub](https://github.com/charlesjones-dev/a11yhawk), and the request guard, URL validation, and process handling get extra review scrutiny, so security-minded contributors are especially welcome.

## Conclusion

The scan engine I spent a year building for AccessHawk is now open source. `npm install a11yhawk` gets you real-browser capture, Lighthouse audits, optional AI analysis against every WCAG criterion for the version and level you pick, and reports you can hand to a developer, a client, or a CI system. Free Lighthouse-only scans in seconds, bring-your-own-key AI depth when you want it, and a server mode plus Docker image when you'd rather build your own accessibility product than rent someone else's dashboard.

Start with one command against your own site:

```sh
npx a11yhawk https://your-site.example
```

If the score surprises you, the report will tell you exactly why, and now the tool that produced it is yours to keep.

---

## 84 Malicious TanStack Versions Hit npm. My Portfolio Pulled Zero.

Source: https://charlesjones.dev/blog/mini-shai-hulud-tanstack-locked-dependencies
Published: 2026-05-14
Modified: 2026-10-15
Tags: npm, pnpm, TanStack Start, Security, Supply Chain Attacks, Locked Dependencies, DevOps

> On May 11, 2026, the Mini Shai-Hulud worm published 84 malicious versions across 42 TanStack packages in a six-minute window. My portfolio runs on TanStack Start. None of the bad versions ever touched it. Here is why, and what every project running npm should be doing right now.

On May 11, 2026, between 19:20 and 19:26 UTC, a worm calling itself Mini Shai-Hulud published 84 malicious package versions across 42 different `@tanstack/*` packages on npm. The malware harvested cloud credentials, authentication tokens, and private keys from any machine that ran `pnpm install` or `npm install` while those versions were live.

My portfolio runs on TanStack Start, and it depended on every TanStack package family the attackers compromised. On paper, this was a perfect target.

I checked the lockfile. Zero of the 84 malicious versions resolved. The defenses I had configured held cleanly through one of the worst npm supply chain attacks of the year, and they're the same three I [have been writing about](/blog/npm-supply-chain-attacks-ci-cd-locked-dependencies) and pushing into every project I touch.

## What Mini Shai-Hulud actually did

The [TanStack postmortem](https://tanstack.com/blog/npm-supply-chain-compromise-postmortem) is worth reading in full, and [Snyk's writeup](https://snyk.io/blog/tanstack-npm-packages-compromised/) has the cleanest forensic timeline I've seen. The short version is that the attackers never stole an npm token. They never phished a maintainer. They exploited a chain of three vulnerabilities in GitHub Actions.

A pull request opened against the public TanStack repo was allowed to trigger a workflow with elevated permissions. That workflow read its dependencies from the GitHub Actions cache, which the attacker had poisoned with a malicious pnpm store on an earlier run. When the workflow restored the poisoned cache, an attacker-controlled binary extracted the OIDC token from the runner's process memory. That token had the rights to publish to npm.

Six minutes later, 84 new versions were live. Each one carried a `postinstall` script that ran on the next machine to install the package, scanning the filesystem and process environment for credentials and exfiltrating anything it found.

The version numbers looked legitimate. They followed the existing release cadence. The deprecation notices and the npm registry pulldown didn't happen until the TanStack team got paged and reacted, which took longer than the publishing window itself.

This attack didn't need a compromised developer or a typosquat. The worm exploited the build infrastructure of the package itself, published faster than humans could review, and reached every installer the moment the registry served it.

<Callout type="warn">

Any project that ran `pnpm install`, `npm install`, or `yarn install` against a TanStack range during that six-minute window without lockfile or release-age protections pulled the malicious code and ran its postinstall. The compromise was registered as `CVE-2026-45321` and tracked in [GHSA-g7cv-rxg3-hmpx](https://github.com/TanStack/router/security/advisories/GHSA-g7cv-rxg3-hmpx). If you maintain anything on TanStack, audit your build logs from that window.

</Callout>

## Why my portfolio was the perfect target

I rebuilt my portfolio on TanStack Start in April 2026. I wrote about [why I made that call](/blog/why-i-rebuilt-my-portfolio-with-tanstack-start) and what the architecture looks like. At the time, the dependency tree pulled in basically every TanStack family the worm hit:

```jsonc
{
  "dependencies": {
    // direct
    "@tanstack/react-router": "...",
    "@tanstack/react-start": "...",
    "@tanstack/react-router-devtools": "...",
    "@tanstack/react-router-ssr-query": "...",
    "@tanstack/router-plugin": "...",
    "@tanstack/react-devtools": "..."
    // and a long tail of transitive @tanstack/* packages
    // pulled in by the ones above
  }
}
```

Worse, several of those direct dependencies had been pinned to `"latest"`. I had been moving fast in the rebuild and never tightened them. On paper, the next `pnpm install` would have asked the registry "what is the newest version" for each of those entries, and during the attack window the answer would have been "the malicious one."

This is exactly the failure mode I [wrote about in the npm supply chain post](/blog/npm-supply-chain-attacks-ci-cd-locked-dependencies). Open-ended version ranges plus an automated install equals "the attacker decides what runs on your machine." It's not a hypothetical. It's what happens every time a worm like this lands.

And yet none of the bad versions resolved. Three defenses caught the attack, each at a different layer.

## Defense 1: the lockfile

The single biggest reason nothing landed is the lockfile. `pnpm-lock.yaml` records, for every direct and transitive dependency, the exact version that was installed and a cryptographic integrity hash. Every `@tanstack/*` version recorded in mine had been published well before May 11.

When you run `pnpm install` with a lockfile present, pnpm doesn't go shopping at the registry. It reads the lockfile, asks for the exact versions listed there, verifies each tarball against the recorded hash, and refuses to install if anything doesn't match. The `"latest"` specifier in `package.json` is irrelevant at that point. The lockfile is the source of truth.

This is the same defense [I wrote about for `npm ci`](/blog/npm-supply-chain-attacks-ci-cd-locked-dependencies). The pnpm equivalent is `pnpm install --frozen-lockfile`, and you can make it the default by setting the flag in `.npmrc`:

```ini
# .npmrc
frozen-lockfile=true
```

With that one line, every install in the project, on every developer machine, in CI, and in production, refuses to silently change versions. If `package.json` and the lockfile disagree, the install fails with a clear error. You go fix the lockfile intentionally, in a separate commit, with a review, and only then can the new version run.

The attacker's new versions weren't in my lockfile, so pnpm never fetched them.

<Callout type="success">

If you take one thing from this post: commit your lockfile and use the frozen-install command. `pnpm install --frozen-lockfile` for pnpm, `npm ci` for npm, `yarn install --immutable` for Yarn. Make it the default in `.npmrc` so nobody can forget. This single change is the difference between "your build pipeline is the attacker's distribution channel" and "you slept through the attack."

</Callout>

## Defense 2: minimum release age

The lockfile is the defense for installs that should reproduce. But what about installs where the lockfile itself has to change: a new dependency, a `pnpm update`, a deliberate bump to pick up a feature or a hotfix? What if I had run that update on May 11 at 19:23?

The answer is that pnpm would still have refused, because of a second defense I had configured: `minimum-release-age`.

This setting, [added in pnpm 10.16](https://pnpm.io/blog/releases/10.16) and which I wrote about as ["advanced defense" in the locked-dependencies post](/blog/npm-supply-chain-attacks-ci-cd-locked-dependencies), refuses to install any package version that was published less than N minutes ago. The number is up to you. A few common values:

```ini
# .npmrc
# Refuse to install versions younger than ...

minimum-release-age=1440    # 24 hours
minimum-release-age=4320    # 3 days
minimum-release-age=10080   # 7 days
```

The Mini Shai-Hulud window was six minutes. From the moment the malicious versions were published to the moment TanStack and npm started deprecating them was several hours. Even a 24-hour cooldown would have made every malicious version uninstallable for the entire time they were reachable on the registry.

This is the defense that protects you against the "what if my lockfile is stale and I need to update" path. When you do update a dependency, the new resolution still has to survive the cooldown. A version that's two hours old is rejected by the package manager itself, with a clear error, before it ever touches your machine. The community gets time to catch the attack and pull the tarballs. You get to install the version that has been vetted, not the version that's fresh.

Here is what the rejection looks like:

```bash
$ pnpm add @tanstack/react-router@latest

ERR_PNPM_PKG_TOO_FRESH  @tanstack/react-router@1.169.5 was published less than 10080 minutes ago.
Published: 2026-05-11T19:23:12.000Z
Minimum release age: 10080 minutes (7 days)
```

Pair it with the lockfile and you have defense in depth. The lockfile protects past installs. The cooldown protects future installs. Together they cover the entire surface where a fresh malicious version could reach your dependency tree.

If a genuine hotfix is published and you need it before the cooldown expires, you can add a single version to `minimumReleaseAgeExclude` in `pnpm-workspace.yaml`. You override one decision, with intent, in a commit that gets reviewed. You don't lower the global setting and move on.

## Defense 3: the postinstall allow list

The third layer is the one that would have caught the attack if both of the first two had somehow failed.

The Mini Shai-Hulud payload was delivered via a `postinstall` script. That's true of almost every npm worm in recent memory. The malicious package itself is usually inert; what actually runs is the lifecycle script that npm executes immediately after extracting the tarball into `node_modules`. The script reads your environment variables, walks your filesystem looking for `.npmrc` and `~/.aws/credentials` and `~/.ssh/id_*`, and POSTs anything it finds to an attacker endpoint.

pnpm 10 ships a useful default for this: lifecycle scripts only run for packages in an explicit allow list. Everything else is silently skipped. The allow list lives in `package.json`:

```jsonc
{
  "pnpm": {
    "onlyBuiltDependencies": ["esbuild", "lightningcss", "sharp"]
  }
}
```

Three packages. Each one has a legitimate native build step that has to run at install time. Every other dependency in the tree, including the entire `@tanstack/*` family, runs no install scripts at all.

Even if a malicious version had somehow slipped past the lockfile and the cooldown and made it onto disk, its postinstall payload would have been ignored. The package would have sat there as inert JavaScript files until something actually imported them. And for build-time dev tools that the SSR pipeline never bundles to the client, the practical impact of "inert files on disk" is close to nothing.

This is the same idea as the `--ignore-scripts` flag, except scoped per dependency. You opt in only the packages you trust to run native code, and the rest of the ecosystem can't run anything on your machine without you noticing.

## Defense in depth

Each of these three defenses solves a different problem. They aren't interchangeable. The lockfile assumes you have already installed once and haven't updated. The cooldown protects you when you do update. The script allow list assumes both of the first two have failed and treats the malware itself as the last line.

Together they form a defense in depth:

```text
Layer 1: pnpm-lock.yaml + frozen-lockfile=true
├─ Reinstalls reproduce the exact versions you had before.
├─ Drift triggers a hard fail, not a silent re-resolution.
└─ The "latest" specifier becomes a label, not a query.

Layer 2: minimum-release-age=10080
├─ Newly published versions are uninstallable for 7 days.
├─ Worm windows (minutes to hours) close before they can land.
└─ Community vetting happens before your machine sees the code.

Layer 3: onlyBuiltDependencies allow list
├─ Lifecycle scripts run for an explicit set of packages.
├─ A malicious postinstall in any other package is ignored.
└─ The script itself, the attack vehicle, never executes.
```

To land, the worm needed me to install during the six-minute window with no lockfile, no cooldown, and lifecycle scripts enabled. None of those conditions held, and that's the point of layering: no single failure produces a compromise.

## What I changed afterwards anyway

There was no actual exposure, and I still tightened everything I could.

The `"latest"` specifiers in `package.json` are gone, replaced by caret ranges pinned to the versions in the lockfile. The cooldown went from three days to seven, because the historical pattern is that compromised versions are caught and pulled within a day or two, and a longer window costs me very little. I added a Dependabot configuration with matching cooldown windows so update pull requests aren't even opened for versions younger than a week. I pinned the registry URL in `.npmrc` so that an injected user-level `.npmrc` can't redirect installs to a malicious mirror.

None of these were necessary, given the layers that already held. All of them tighten the margins for the next attack, which will arrive on a schedule I don't control.

The goal is a project that doesn't need you paying attention on the day of the attack.

## What every project running npm should be doing today

If you maintain a Node project that runs `pnpm install`, `npm install`, or `yarn install` anywhere, including local dev, including CI, including production builds, here is the short list:

1. **Commit your lockfile.** Whatever the package manager calls it. `pnpm-lock.yaml`, `package-lock.json`, `yarn.lock`. Without a lockfile none of the other defenses matter.
2. **Make frozen-install the default.** `pnpm install --frozen-lockfile`, `npm ci`, `yarn install --immutable`. Configure it in `.npmrc` so it's the default for every developer and every CI job. The [npm supply chain post](/blog/npm-supply-chain-attacks-ci-cd-locked-dependencies) covers the full migration step by step.
3. **Set a release-age cooldown if you're on pnpm.** Pick a value between one day and one week and put it in `.npmrc`. Use `minimumReleaseAgeExclude` for the rare hotfix you can't wait on. If you aren't on pnpm, evaluate the migration. This single feature is one of the strongest arguments for it.
4. **Allow-list your lifecycle scripts.** Configure `onlyBuiltDependencies` in `package.json` to the smallest possible set. Anything you have to add to that list is something you have explicitly trusted to run code on your machine. The rest of the ecosystem can't.
5. **Add Dependabot or Renovate cooldowns** so update pull requests aren't opened for fresh versions. The cooldown windows should match (or be shorter than) your package manager's release-age setting.

None of these need new infrastructure or cost anything to run, and together they stop the whole Mini Shai-Hulud playbook.

## Lock your dependencies

I dodged this one because the defenses I've been [pushing on every project](/blog/npm-supply-chain-attacks-ci-cd-locked-dependencies) were already in place when the attack landed.

The next supply-chain worm is no longer hypothetical (see the postscript below). It will pick a different package family, exploit a different CI vulnerability, and publish in a different window. The defenses don't care which one it is. A locked dependency tree, a release-age cooldown, and a tight allow list on lifecycle scripts work against the entire class.

Set them up before the next attack, not during it.

## Postscript: the worm is now open source

The day after the TanStack attack, TeamPCP, the group behind the worm, published the Shai-Hulud framework source to GitHub along with instructions and a paid "supply chain challenge" inviting copycats to use it ([SecurityWeek](https://www.securityweek.com/teampcp-ups-the-game-releases-shai-hulud-worms-source-code/), [Datadog Security Labs](https://securitylabs.datadoghq.com/articles/shai-hulud-open-source-framework-static-analysis/)). GitHub removed the original repos within hours. Forks proliferated faster than takedowns. The framework itself is a modular TypeScript/Bun toolkit for credential harvesting, supply-chain poisoning, and encrypted exfiltration, purpose-built for the exact pattern that just hit npm.

The next supply-chain worm doesn't have to be written from scratch anymore. The framework is a download away.

The same three layers (committed lockfile, release-age cooldown, lifecycle-script allow list) work against every variant in the framework.

---

## WordPress Was Already a Security Nightmare. AI Agents Are About to Make It Unlivable.

Source: https://charlesjones.dev/blog/wordpress-plugin-backdoor-supply-chain-ai-agents-security
Published: 2026-04-22
Modified: 2026-10-04
Tags: WordPress, Security, Supply Chain Attacks, CMS, PHP, AI, Plugin Security, Headless CMS

> Someone spent six figures on 31 trusted WordPress plugins, planted a PHP deserialization backdoor, and sat on it for eight months before lighting it up in April 2026. Nothing in WordPress malfunctioned: the plugin ecosystem worked as designed. Here's why AI agents make every outdated install a bigger target, and what to move to instead.

It's easy to run WordPress and assume you're fine. More than 40% of the internet runs on it, and that kind of scale tends to read as proof the platform has been stress-tested into stability. A recent supply chain breach has exposed that assumption as a serious liability.

On April 5th and 6th, 2026, a backdoor that had been sitting quietly in the update channel of <strong>31 trusted WordPress plugins</strong> since August 2025 woke up. WordPress.org pulled all 31 plugins off the directory on April 7th. By then, thousands of sites had already been running a PHP deserialization backdoor for eight months. The attacker didn't exploit a CVE. They didn't phish a developer. They bought the plugins on Flippa for six figures, and the first commit after the ownership transfer was the malware.

Nothing in WordPress malfunctioned here. The plugin ecosystem worked exactly as designed, and that design is the problem.

## What actually happened

The plugins belonged to a portfolio called Essential Plugin, run by a developer who listed the whole business for sale on Flippa in early 2025. A buyer calling himself "Kris," with a public background in SEO, crypto, and online gambling marketing, bought the entire catalog.

On <strong>August 8th, 2025</strong>, all 31 plugins shipped version 2.6.7 with a changelog that read "Check compatibility with WordPress version 6.8.2." Inside that release were 191 extra lines of PHP that nobody noticed. The code included a deserialization primitive, an unauthenticated REST endpoint that accepted arbitrary PHP, and a command-and-control resolver that pulled its current domain from <strong>an Ethereum smart contract</strong> so the attacker could rotate infrastructure without pushing another update.

Then it sat there for eight months, collecting auto-updates and five-star reviews. On April 5th and 6th, 2026, it activated. It started injecting cloaked SEO spam into `wp-config.php`, serving different content to Googlebot than to human visitors, and hosting the REST endpoint as a ready-made webshell.

The victim plugins included names you would recognize on any small-business WordPress stack: Countdown Timer Ultimate, Popup Anything on Click, WP Testimonial with Widget, WP Team Showcase and Slider, Responsive WP FAQ with Category, Hero Banner Ultimate, Post Grid and Filter Ultimate. The kind of plugins a freelancer installs in the first hour of a build and never thinks about again.

<Callout type="warn">

Forced updates from WordPress.org disabled the C2 channel, but they didn't remove the code already written into `wp-config.php`. Every affected install needs a manual audit. If you ran any of the 31 plugins between August 2025 and April 2026, your site has to be assumed compromised until proven otherwise.

</Callout>

## The attack vector was trust, not code

You can patch a buffer overflow. You can't patch the fact that a plugin's GitHub repo quietly changed hands, the original author signed off, and version 2.6.7 looks exactly like 2.6.6 plus a compatibility note.

Every layer of defense a typical WordPress site relies on failed here:

- <strong>WordPress.org review</strong> only screens the initial submission. Subsequent updates roll out automatically.
- <strong>Auto-updates</strong>, the single most-recommended WordPress security control, <em>was</em> the delivery mechanism.
- <strong>Security plugins</strong> (Wordfence, Sucuri, iThemes) didn't flag 2.6.7 because the signature of "new PHP function you have never seen" is indistinguishable from "new feature" on a plugin under active development.
- <strong>Site owners</strong> had no meaningful way to evaluate the change. "Check compatibility with WordPress version 6.8.2" is exactly what a legitimate maintenance release looks like.

This is the same pattern I wrote about in the [npm supply chain attack post](/blog/npm-supply-chain-attacks-ci-cd-locked-dependencies), with one critical difference. In npm, lock files and `npm ci` give you a real defense: pin the version, and a compromised update can't reach production until someone explicitly bumps the lock. WordPress has no equivalent. The plugin directory, auto-updates, and site health nags all push in the opposite direction. If you turn auto-updates off, the next security advisory becomes the thing that bites you.

You're choosing between two failure modes, and that choice is built into the product.

## XML-RPC is still on by default

`xmlrpc.php` has been shipping in every WordPress install since 2004. It exists to let you publish from old desktop blog clients nobody has used since Windows Vista. It's still enabled by default.

What that default exposes has been documented for a decade. Unauthenticated username enumeration. Batched password brute force that can try close to two thousand credentials in a single HTTP request through `system.multicall`. A pingback mechanism that doubles as a blind SSRF primitive against internal network targets. The WordPress response to every one of those findings has been the same: "disable it at the web server level if you don't need it." That advice has been in the Codex, in countless blog posts, in every hardening guide. And the default is still "on."

In 2026 that default is the problem, because the people scanning for it are no longer humans.

## AI agents raise the stakes

Anthropic's Mythos-class models are on the immediate horizon, and the frontier labs have plenty of company in that race. Open-weights releases are tracking the same curve, and state-level actors have their own pipelines. Whatever the legitimate use cases look like, rogue actors are sizing up the same capabilities as a weapon, and the public web is the test environment.

Put that next to millions of outdated WordPress installs and a plugin directory that just proved it has no meaningful defense against ownership-transfer supply chain attacks, and the ceiling on what a single campaign can touch gets very high, very fast.

<Callout type="warn">

If your site runs WordPress and you aren't willing to name, in writing, the person whose job it is to audit every plugin update within 24 hours of release, you're already behind. On almost every WordPress site I've looked at, that person doesn't exist. The Flippa backdoor sat for eight months. The attacker didn't need a zero-day, just patience.

</Callout>

## "But we use a managed host / WAF / security plugin"

Every time I bring this up, one of these four defenses comes up. Let me work through them honestly.

<strong>Managed WordPress hosting (WP Engine, Kinsta, Pantheon).</strong> These are excellent at keeping WordPress core patched and blocking obvious malicious traffic at the edge. They had zero visibility into the Essential Plugin backdoor because the backdoor came in through <em>signed updates from the official plugin directory</em>. The host trusted the source. So did everyone else.

<strong>A WAF (Cloudflare, Wordfence, Sucuri).</strong> Pattern-based WAFs match on request shapes. An unauthenticated REST endpoint that accepts a base64-encoded payload and deserializes it looks identical to any legitimate plugin's custom REST API. The false-positive rate of blocking it generically would break half the WordPress ecosystem.

<strong>A security plugin.</strong> Wordfence Premium is genuinely good. It still trusts WordPress.org as the source of truth for plugin integrity. When WordPress.org serves a backdoored release, the security plugin's integrity check passes.

<strong>"We have SOC 2."</strong> SOC 2 will ask whether you have a vendor-review process. Your answer for WordPress plugins is usually "we trust the plugin directory." Auditors have been signing off on that answer for a decade. They will stop.

None of this is the host's fault or the WAF vendor's fault. The structural problem is that WordPress sites outsource trust to a plugin directory that has no meaningful defense against ownership-transfer supply chain attacks, and the site owner has no practical mechanism to validate an update before auto-apply ships it.

## Where I'd actually move

The honest answer depends on what the site is for. I've watched enough WordPress installs get pwned, and helped enough people move off, to have strong opinions on where each kind belongs.

<strong>Content-heavy marketing sites with non-technical editors.</strong> [Umbraco](https://umbraco.com/) if you're already on .NET, [Payload](https://payloadcms.com) or [Sanity](https://www.sanity.io) if you're on Node. All three keep the CMS admin separate from the public render, which shrinks the attack surface to "the CMS API" instead of "every page of your site." The CMS binds to an internal address. The public site is static or server-rendered from a trusted build pipeline.

<strong>Portfolio and personal sites.</strong> A static generator with MDX content. [This very site](/blog/why-i-rebuilt-my-portfolio-with-tanstack-start) runs on TanStack Start with content collections. The attack surface of a pre-rendered HTML page is the attack surface of your CDN. There's no PHP process, no database, no admin panel, and no plugin directory to poison.

<strong>E-commerce.</strong> Shopify for anything below 50 million in revenue. BigCommerce if Shopify's customization model doesn't fit. A headless commerce stack (Medusa, commercetools) for teams that can staff it. WooCommerce on WordPress inherits every problem I just described, and then adds payment card data to the blast radius.

<strong>If you genuinely can't move.</strong> Disable XML-RPC at the web server level, not with a plugin. Pin plugin versions and disable auto-updates. Assign a specific person to review every plugin changelog within 24 hours of release. Run [Semgrep](/blog/semgrep-ai-assisted-development-security-scanning) against every plugin you install before activation. Put the admin behind VPN or client-cert auth. Back up daily, restore-test quarterly. Assume compromise, and design your incident response around it. This is the posture worth running if you have legitimate reasons to stay, and it costs real money to maintain. It's not the default, and it can't be made the default.

## What 40% of the web means

WordPress powers something north of 40% of the web. That number is often cited as an argument for its legitimacy. I read it the other way. It's the single largest, most uniform, most plugin-dependent attack surface on the public internet, and it's about to meet the first generation of attackers for whom "scan everything, try everything, chain everything" is cheap.

The Flippa backdoor looks like a preview of what's coming. Somebody already figured out that you don't have to exploit WordPress, you can just buy your way in, and the trust model breaks open the moment you do. Agentic AI is about to industrialize the rest.

If you run a WordPress site, have this conversation with your stakeholders this quarter.

---

## GEO is the New SEO: Optimizing for AI Answer Engines in 2026

Source: https://charlesjones.dev/blog/geo-new-seo-ai-answer-engines-2026
Published: 2026-04-17
Modified: 2026-10-04
Tags: GEO, SEO, AI, Web Development, Structured Data

> Generative Engine Optimization (GEO) is the discipline of getting cited by ChatGPT, Perplexity, Claude, and Gemini. It shares a foundation with SEO, but much of the work is new territory, and it's worth learning now.

Open ChatGPT or Perplexity and ask a question in your domain. Something a potential customer would type. Watch what gets cited at the bottom of the answer. Is your site there? If not, is it any of your direct competitors? If not, why not?

For a growing slice of your audience, that cited list is the whole search experience. They don't scroll a results page. They read the generated answer, click one or two sources, and move on. If your content isn't in the answer, that reader never sees you.

Traditional SEO was never designed for that. It optimizes for a different game: ranking higher than ten blue links on a page that fewer people are even loading. Generative Engine Optimization (GEO) is what picks up where SEO stops. It's still early, best practices are still shifting, but the shape of the work is clear enough that you can start applying it today.

## What GEO actually is

GEO is the practice of structuring web content so AI answer engines are more likely to cite it, quote it, and include it in their generated responses. The targets are ChatGPT, Perplexity, Claude, Gemini, Google's AI Overviews, and Bing Copilot. The metric that matters is citation probability, not SERP position.

SEO and GEO overlap, but not as much as you'd think. Here's the rough shape of the difference:

| Dimension            | SEO                                   | GEO                                                 |
| -------------------- | ------------------------------------- | --------------------------------------------------- |
| **Target**           | SERP rankings, organic traffic        | Citations inside AI-generated answers               |
| **Surface**          | Google, Bing results pages            | ChatGPT, Perplexity, Claude, Gemini, AI Overviews   |
| **Key metrics**      | Impressions, CTR, backlinks, keywords | Citation frequency, quote accuracy, entity linking  |
| **Key files**        | `sitemap.xml`, `robots.txt`           | `llms.txt`, `llms-full.txt`, `robots.txt` (AI bots) |
| **Preferred format** | HTML with metadata                    | Markdown-accessible, self-contained chunks          |
| **Rendering**        | HTML (JS-tolerant for most crawlers)  | SSR or static critical (many AI bots skip JS)       |
| **Structured data**  | Article, Product, LocalBusiness       | FAQPage, HowTo, Person with `sameAs`, DefinedTerm   |
| **Tone**             | Keyword-optimized                     | Conversational, question-anchored                   |

Part of the work is shared: HTTPS, semantic HTML, structured data basics, signs you're trustworthy. The rest is different work, and most of it isn't in a standard SEO playbook.

## Why it matters now

A few shifts are stacking up at once. AI-native interfaces are capturing more intent. Google's AI Overviews are eating into zero-click traffic that used to land on sites below the fold. Perplexity is positioning itself explicitly as an "answer engine" rather than a search engine. ChatGPT's browsing and search features are pulling live citations. The old funnel (impression, click, session) is getting shorter, and some of it has collapsed entirely into an answer the user reads and accepts without ever leaving the chat.

We don't have great industry stats for this yet. Most of the data that exists is either Google's own telemetry (which they aren't sharing) or early surveys with selection bias. But the shift already shows up in analytics, including on this site: a new category of referral traffic, from `chatgpt.com`, `perplexity.ai`, `gemini.google.com` and similar, is arriving alongside search.

The right stance is to treat this like mobile optimization in 2010. It's a new surface, one that's going to matter more as AI answer engines mature. Worth building habits around before they become table stakes.

## The core GEO disciplines

There's no single trick here. GEO is a grab bag of practices that collectively make your content easier to extract and attribute. Four areas are worth understanding in detail.

### llms.txt: the emerging standard

[llms.txt](https://llmstxt.org/) is a markdown-formatted index file placed at the web root. It was proposed by Jeremy Howard in 2024 and the spec is maintained at llmstxt.org. Think of it as `sitemap.xml` for LLMs, except it's curated, markdown-native, and written for direct consumption.

The minimal structure is simple:

```markdown
# Site Name

> One-sentence description of what this site is about.

## Primary content

- [Page title](https://example.com/page.md): one-line summary of the page.
- [Another page](https://example.com/another.md): one-line summary.

## Optional

- [Secondary resource](https://example.com/secondary.md): summary.
```

Rules worth knowing:

- H1 title is required.
- A blockquote description must come immediately after the H1.
- H2 section headers organize the index. `## Optional` is treated as lower priority.
- Link to `.md` companion URLs where the content exists in markdown form. AI engines quote markdown more accurately than HTML that has been extracted and reformatted.

There's also `llms-full.txt`, which is the full companion file containing full markdown content rather than just links. Use it when your licensing and bandwidth allow exposing full text to AI engines for direct retrieval.

Adoption is still early. Not every AI engine acknowledges `llms.txt` yet. But the cost of providing it is low, and the upside (being trivially indexable by engines that do support it) is real.

<Callout type="warn">

**Update (July 2026):** The lines have sharpened since this was published. Google's May 2026 AI optimization guide says Google Search, including AI Overviews and AI Mode, ignores `llms.txt` entirely; it won't help or hurt you there. Anthropic and Perplexity do consume it, and Lighthouse now audits for it. The low-cost, real-upside calculus still holds, just not for Google surfaces.

</Callout>

### AI crawler management: training vs citation

This is the section most developers haven't run into yet, and it's the highest-value one to understand.

Not all AI crawlers are the same. Broadly, there are two kinds:

**Training crawlers** scrape the web to build training corpora for future model releases. They don't directly contribute to citations you get tomorrow.

**Citation or answer crawlers** fetch content live (or from a search index built for answering) and determine whether you get cited in real answers right now.

Treating them as a single category is the most common mistake. A site owner may legitimately want to block training (so their content isn't baked into model weights) while allowing citation bots (so they can still be quoted in AI answers). A blanket `Disallow: /` for every AI-flavored user agent locks you out of both.

Here's a reference table pulled from the docs each operator publishes:

| Bot                                    | Operator     | Role                   |
| -------------------------------------- | ------------ | ---------------------- |
| `GPTBot`                               | OpenAI       | Training               |
| `ClaudeBot`                            | Anthropic    | Training               |
| `Google-Extended`                      | Google       | Training (and Gemini)  |
| `Applebot-Extended`                    | Apple        | Apple Intelligence     |
| `CCBot`                                | Common Crawl | Shared training corpus |
| `Bytespider`                           | ByteDance    | Training               |
| `Amazonbot`                            | Amazon       | Training and indexing  |
| `FacebookBot` / `meta-externalagent`   | Meta         | Training               |
| `ChatGPT-User`                         | OpenAI       | Live citation fetch    |
| `OAI-SearchBot`                        | OpenAI       | ChatGPT search index   |
| `PerplexityBot`                        | Perplexity   | Index                  |
| `Perplexity-User`                      | Perplexity   | Live citation fetch    |
| `Claude-User`                          | Anthropic    | Live citation fetch    |
| `Claude-SearchBot`                     | Anthropic    | Claude search index    |

A common intentional pattern, if you want citations without contributing to training, looks like this in `robots.txt`:

```text
# Training crawlers: blocked
User-agent: GPTBot
Disallow: /

User-agent: ClaudeBot
Disallow: /

User-agent: Google-Extended
Disallow: /

User-agent: CCBot
Disallow: /

# Citation crawlers: allowed
User-agent: ChatGPT-User
Allow: /

User-agent: OAI-SearchBot
Allow: /

User-agent: PerplexityBot
Allow: /

User-agent: Claude-User
Allow: /

User-agent: Claude-SearchBot
Allow: /
```

The official sources worth bookmarking: [OpenAI bot documentation](https://developers.openai.com/api/docs/bots), [Anthropic's ClaudeBot page](https://support.claude.com/en/articles/8896518-does-anthropic-crawl-data-from-the-web), [Google-Extended](https://developers.google.com/search/docs/crawling-indexing/overview-google-crawlers), and [Perplexity's crawler docs](https://docs.perplexity.ai/guides/bots). These pages change. Check them periodically.

<Callout type="warn">

`robots.txt` is policy, not enforcement. Some crawlers honor it rigorously, others are inconsistent, and third-party caches (which some AI engines use) may not see your directives at all. Set your policy deliberately, but don't assume it's a hard lock.

</Callout>

### Citation-worthiness signals

LLMs don't just pull text. They decide which sources to cite, and how. The signals that push those decisions look a lot like E-E-A-T (Experience, Expertise, Authoritativeness, Trustworthiness), with a few GEO-specific tweaks.

The ones that actually move the needle:

- **Visible author byline** with name, credentials, and a link to a profile page. An unsigned post on a specialized topic is a harder sell than one tied to someone who clearly knows the field.
- **Dates that are both visible and in your schema.** `dateModified` in JSON-LD, `article:modified_time` in Open Graph, and a "Last updated" line in the UI. AI engines push stale content down on many topics, and they can't tell how fresh your page is if you haven't told them when you updated it.
- **Identity links via `sameAs`.** Linking your Person schema to your LinkedIn, GitHub, ORCID, Wikipedia, or Wikidata profile tells the engine who you actually are. It also keeps you apart from anyone else who shares your name.
- **Original data and primary research.** Rehashing other people's content gets cited less than the source that produced the number or the benchmark. If you have internal data you can share, share it.

These nudge the odds in your favor. They're not guarantees. Nobody has published a reliable model of why one source gets cited over another, so treat them as solid rules of thumb, not rules.

### AI-friendly structured data

JSON-LD is the format. Microdata and RDFa are legacy. Every current AI engine I'm aware of reads JSON-LD first, and the types that line up most with AI citations are a specific subset:

- **FAQPage** for Q&A content. The visible question-and-answer structure matters more than the markup itself: Google dropped FAQ rich results in May 2026 but still parses the schema, and AI engines extract from clean Q&A content either way.
- **HowTo** for procedural content. Same story.
- **Person** and **Organization** with `sameAs` links for entity linking.
- **Article** with `dateModified` for freshness signaling.
- **DefinedTerm** and **ClaimReview** for specialized content. Still emerging in usage.

A minimal FAQPage snippet looks like this:

```html
<script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "FAQPage",
    "mainEntity": [
      {
        "@type": "Question",
        "name": "What is Generative Engine Optimization?",
        "acceptedAnswer": {
          "@type": "Answer",
          "text": "GEO is the practice of structuring web content so AI answer engines are more likely to cite it in their generated responses."
        }
      }
    ]
  }
</script>
```

And a Person schema with proper `sameAs` disambiguation:

```html
<script type="application/ld+json">
  {
    "@context": "https://schema.org",
    "@type": "Person",
    "name": "Charles Jones",
    "url": "https://charlesjones.dev",
    "sameAs": [
      "https://github.com/charlesjones-dev",
      "https://www.linkedin.com/in/charlesjonesdev"
    ]
  }
</script>
```

If you already do structured data for SEO, most of this is a small add-on. If you don't, visible Q&A sections on your top landing pages (with FAQPage markup layered on) are the easiest place to start.

## What's still unknown

A reminder that this field is young, and anyone who tells you they have a definitive playbook is selling you something.

- **Citation ranking inside AI engines is a black box.** We don't have anything like Google's guidelines for how answer engines pick and order the sources they cite. Everyone serious about GEO is guessing from what they can see, not reading from a spec.
- **Best practices today may not apply in six months.** AI engines are updating their retrieval and ranking stacks monthly. `llms.txt` could become standard, or something else could replace it. Training vs citation lines could shift as policies change.
- **Measurement is genuinely hard.** Referral tracking from AI interfaces is inconsistent, some engines don't pass referrers at all, and citations aren't captured by any analytics product I've seen.
- **Real-world data on what moves citations is thin.** Most of the rules of thumb in this post line up with citations in the data we have, but that doesn't prove they're causing them.

Build habits around the basics that are cheap and defensible: clean semantic HTML, structured data, self-contained chunks, a crawler policy that reflects what you actually want. Experiment on the edges with `llms.txt`, question-shaped headings, identity links. Measure what you can, and expect the ground under you to move.

## GEO joins SEO, it doesn't replace it

The framing that plays best on social media is "SEO is dead, GEO is the future." That framing is wrong. SEO is still doing real work, and Google is still sending real traffic. What's changing is that search is no longer a single surface. It's two surfaces and growing, and each one rewards slightly different work.

Treat GEO as an equal part of your stack, not a replacement. Keep shipping sitemaps, keep writing meta descriptions, keep the lint checks that already run in your build pipeline. Then layer in the GEO-specific work: `llms.txt`, a deliberate AI-crawler policy, structured data that an answer engine can actually use, content patterns that survive chunking. The sites that invest early will have a head start when the practices settle down.

If an AI answer engine gets asked the question your next customer would ask, you want to be in the answer.

---

## Why I Rebuilt My Portfolio with TanStack Start

Source: https://charlesjones.dev/blog/why-i-rebuilt-my-portfolio-with-tanstack-start
Published: 2026-04-15
Modified: 2026-07-09
Tags: TanStack Start, React, Performance, Architecture, TypeScript

> I previously wrote about choosing Nuxt over Next.js. Then I rewrote my entire portfolio in React. This isn't a framework war - it's about what TanStack Start gets right that Next.js doesn't, and why the rebuild was worth it.

A few months ago I published a post titled [Why I Chose Nuxt Over Next.js for AccessHawk](/blog/why-i-chose-nuxt-over-nextjs-for-accesshawk). I meant every word. Vue's reactivity model is elegant. Nuxt's developer experience is really, really good. Auto-imports, composables, Nitro server routes - the whole stack just works.

So why did I just rebuild my entire portfolio site in React?

Short answer: **TanStack Start is React done right.** The problems I had with React were never really React problems - they were Next.js problems. TanStack Start strips away the opinions I disagreed with and gives me back control over the things that matter: the build pipeline, the middleware stack, and how my code actually ships to the browser.

## What TanStack Start Actually Is

TanStack Start is a full-stack React framework built on [Vite](https://vite.dev). It no longer bundles a server engine of its own: you bring one, and I brought [Nitro](https://nitro.build) via its Vite plugin. If that name sounds familiar, it's because Nitro is the same server engine that powers Nuxt. File-based routing, server-side rendering, server functions - the feature set overlaps with Next.js in broad strokes, but the architecture underneath is different in ways that actually matter.

There's no black-box compiler. No `"use client"` directives. No middleware.ts single-file limitation. You get a Vite config you can actually read, a plugin system you can extend, and a server runtime that doesn't fight you.

<Callout type="info">
TanStack Start was in its v1.0 Release Candidate stage when this post was written (April 2026): feature-complete and API-stable, but not yet declared stable. I'm comfortable running it in production for a portfolio site, but evaluate your own risk tolerance for larger projects, and check the [TanStack Start docs](https://tanstack.com/start) for the current release status.
</Callout>

## Pre-Rendered MDX: Eliminating an Entire Vendor Bundle

This is my favorite architectural decision in the rebuild. Every blog post on this site is written in MDX - markdown with embedded JSX components, so I can mix prose with code blocks, callouts, and custom elements in the same file. The standard way to render MDX on the client uses `mdx-bundler/client`, which calls `new Function(code)` at runtime to evaluate the compiled output. That's a problem because this site runs a strict Content Security Policy with no `'unsafe-eval'` in `script-src`. CSP blocks it.

The fix: render MDX to static HTML at build time. The MDX runtime runs in Node during the build (where `eval` is allowed), and only the resulting HTML string ships to the client.

```typescript
// content-collections.ts (simplified)
import { compileMDX } from '@content-collections/mdx'
import { MDXContent } from '@content-collections/mdx/react'
import { renderToStaticMarkup } from 'react-dom/server'

const posts = defineCollection({
  name: 'posts',
  directory: 'content/blog',
  include: '**/*.mdx',
  schema: z.object({
    title: z.string(),
    slug: z.string(),
    // ... other fields
  }),
  transform: async (document, context) => {
    // Step 1: compile MDX to a runnable module (Node-side, eval OK)
    const mdx = await compileMDX(context, document, {
      remarkPlugins: [remarkGfm],
      rehypePlugins: [[rehypeShiki, { themes: { light: '...', dark: '...' } }]],
    })

    // Step 2: render to static HTML - no client-side eval needed
    const html = renderToStaticMarkup(
      React.createElement(MDXContent, {
        code: mdx,
        components: staticComponentMap,
      }),
    )

    return { ...document, html }
  },
})
```

The blog post route renders that HTML string via `dangerouslySetInnerHTML` (safe here - the HTML comes from our own MDX files at build time, not user input). The entire `vendor-mdx` chunk (the MDX runtime, the JSX evaluator, all of it) is gone from the client bundle. The MDX runtime, its dependencies, and the JSX evaluator never download on any page.

Beyond the bundle savings, this is a straight performance win over the old site. The previous Vue build hydrated blog content on the client - the browser had to parse, compile, and render the markdown on every page load. Now the server ships finished HTML. The browser just paints it.

The tradeoff: since there's no MDX runtime on the client, you can't embed interactive React components inside blog posts. For a dev blog that's mostly prose and code examples, I don't need that. The one interactive element I wanted - a copy button on code blocks - works fine as a vanilla JS enhancement that attaches after the page mounts.

## Middleware That Actually Composes

Next.js gives you one `middleware.ts` file at the root (renamed `proxy.ts` in Next.js 16, but still one file). All your middleware logic lives there. Need security headers AND compression AND rate limiting? One file, one function.

TanStack Start treats middleware as composable units:

```typescript
// start.ts
import { createStart } from '@tanstack/react-start'
import { compressionMiddleware } from './middleware/compression'
import { securityMiddleware } from './middleware/security'

export const startInstance = createStart(() => ({
  requestMiddleware: [compressionMiddleware, securityMiddleware],
}))
```

Each middleware is its own module. The array order controls execution. The `next()` pattern should feel familiar if you've used Express or Koa:

```typescript
// middleware/security.ts
import { createMiddleware } from '@tanstack/react-start'

export const securityMiddleware = createMiddleware().server(
  async ({ next }) => {
    const result = await next()

    result.response.headers.set(
      'content-security-policy',
      "default-src 'self'; script-src 'self' 'unsafe-inline'; ...",
    )
    result.response.headers.set(
      'strict-transport-security',
      'max-age=63072000; includeSubDomains; preload',
    )
    // ... other security headers

    return result
  },
)
```

This is how server middleware should work. Separate concerns, separate files, clear execution order. Adding a new middleware means adding a file and appending to an array. No weaving more conditions into a growing monolith.

## You Own the Build

The Vite config is yours. Not a wrapper around Webpack that hides the real config behind a `next.config.js` abstraction. The actual config.

This matters when you want to do things like split vendor bundles so your home page doesn't download code it doesn't need:

```typescript
// vite.config.ts
export default defineConfig({
  plugins: [
    nitro({ compressPublicAssets: { gzip: true, brotli: true } }),
    tsconfigPaths(),
    contentCollections(),
    tailwindcss(),
    tanstackStart(),
    viteReact(),
  ],
  build: {
    rollupOptions: {
      output: {
        manualChunks(id) {
          if (!id.includes('node_modules')) return undefined
          const norm = id.replace(/\\/g, '/')

          if (norm.includes('/shiki/') || norm.includes('/@shikijs/'))
            return 'vendor-shiki'
          if (norm.includes('/@mdx-js/') || norm.includes('/@content-collections/'))
            return 'vendor-mdx'
          if (norm.includes('/@tanstack/'))
            return 'vendor-tanstack'
          if (norm.includes('/react/') || norm.includes('/react-dom/'))
            return 'vendor-react'

          return undefined
        },
      },
    },
  },
})
```

The result: a visitor on the home page never downloads Shiki (syntax highlighting) or MDX vendor code. Those only load when you navigate to a blog post. Build-time brotli compression via Nitro's `compressPublicAssets` handles static assets, and a runtime middleware compresses the SSR HTML. Same approach Nuxt uses internally, because I wired in the same server engine.

<Callout type="info">
Plugin order matters in Vite. The order above is deliberate - `contentCollections()` must run before plugins that consume its generated output, and `tanstackStart()` must come before `viteReact()`. Check the docs if you reorder.
</Callout>

## How It Actually Performs

I ran Lighthouse against the production builds of both the old Vue/Nuxt site and the new TanStack Start site. Here are the home page results:

**Desktop:**

| Metric | TanStack Start | Vue/Nuxt |
|--------|:-:|:-:|
| Performance | 100 | 100 |
| Accessibility | 100 | 100 |
| SEO | 100 | 92 |
| LCP | 570 ms | 586 ms |
| Speed Index | 578 | 958 |

**Mobile:**

| Metric | TanStack Start | Vue/Nuxt |
|--------|:-:|:-:|
| Performance | 72 | 78 |
| Accessibility | 100 | 94 |
| SEO | 100 | 92 |
| LCP | 6.2 s | 5.9 s |
| FCP | 2.7 s | 1.7 s |

The TanStack Start build is **not dramatically faster** by Lighthouse numbers. Desktop is a wash at 100/100. Mobile, the Vue build actually edges ahead in raw performance score. Total byte weight is higher on the new site too.

So where does the speed *feeling* come from?

**Intent-based prefetching.** TanStack Router prefetches routes on hover and touch start - before the user clicks or taps. By the time the click fires, the data and code are already loaded. Lighthouse can't measure this because it tests cold page loads, but in actual use the navigation feels instant:

```typescript
const router = createRouter({
  routeTree,
  defaultPreload: 'intent',
  defaultPreloadStaleTime: 0,
})
```

That single config line makes every internal link anticipate the user's next action. It's not faster on paper. It's faster in the hand.

The measurable wins are elsewhere: **perfect accessibility** (100 vs 94 - six points gained through semantic HTML fixes, color contrast improvements, and proper landmark structure), **perfect SEO** (100 vs 92), and a **40% faster desktop Speed Index** (578 vs 958). The new site gets meaningful content on screen faster even though the total payload is larger.

## The Right Tool for the Job

Vue is still a great framework. Nuxt is still a great meta-framework. I'd reach for either again on the right project - especially anything with complex reactive state where Vue's proxy-based reactivity is a better fit than React's model.

But for this site - a content-heavy portfolio with a blog, strict security requirements, and a build pipeline that needs to do unusual things like pre-rendering MDX at compile time - TanStack Start was the right call. I got React's ecosystem without Next.js's opinions, full control over Vite without ejecting from a framework, and Nitro's server engine without leaving the React world.

If you're a React developer frustrated with the direction Next.js is going, TanStack Start is worth a serious look. The ecosystem was still building out as of April 2026 — confirm the current state before adopting on a larger project. But it lets you make your own architectural decisions, and for me that made all the difference.

---

## Anthropic Dropped Subscription Support for OpenClaw. OpenRouter Is the Fix.

Source: https://charlesjones.dev/blog/openclaw-openrouter-migration-anthropic-billing-change
Published: 2026-04-04
Modified: 2026-07-09
Tags: OpenClaw, OpenRouter, AI, Claude, Anthropic, Automation, DevOps, Developer Tools, Infrastructure, Cloud

> Anthropic's April 2026 billing change dropped subscription support for OpenClaw and other third-party harnesses. OpenRouter is the cleanest migration path: same models, automatic failover, and freedom to switch providers without reconfiguring anything.

<Callout type="warn">

**Update (July 2026):** The billing change this post reacts to has since been walked back. Anthropic paused the whole plan on June 15, 2026, the day it was due to take full effect: subscription usage through third-party harnesses like OpenClaw draws from normal Pro/Max limits again, with a promise of notice before any future change. The migration below still works, and two billing reversals in three months make the case for provider independence stronger, not weaker. Read this as insurance now, not a forced move.

</Callout>

Beginning April 4th at 3PM ET, Anthropic is flipping a switch. Claude subscription limits (Pro, Max) no longer cover third-party harnesses like [OpenClaw](https://openclaw.ai). If you were running Claude through OpenClaw on your subscription, your agent usage will now be billed separately through Anthropic's extra usage bundles, whether you expect it or not.

If OpenClaw was the main reason you were paying $20-200/mo for a Claude subscription, that subscription just stopped earning its keep. It only covers Anthropic's own surfaces now: claude.ai, the mobile app, and Claude Code. If you don't use any of those, you're lighting money on fire.

With that said, I decided it was probably best to migrate to a platform with some redundancy built in, especially given Anthropic's outages in the past. I moved my OpenClaw setup over to [OpenRouter](https://openrouter.ai) and it only took me a few minutes. I set a free model as my primary with Claude as an automatic fallback, so my day-to-day usage cost basically nothing. I'll walk through how I set that up and why it turned out to be an upgrade.

<Callout type="info">

Model IDs and per-token prices in this post are accurate as of April 2026 (Opus 4.7, Sonnet 4.6, etc.). Anthropic and OpenAI ship a new generation every few months; before you copy-paste any of the commands below, swap each model ID for whatever's current on the [OpenRouter models catalog](https://openrouter.ai/models). The migration pattern itself is durable — only the strings change.

</Callout>

## What actually changed

Boris Cherny, one of the execs behind Claude Code, posted the announcement on X Friday evening, April 3rd. The change went live the next day. Your Claude subscription (Pro at $20/mo, Max at $100-200/mo) used to cover API calls from third-party tools like OpenClaw and other agent harnesses. Now it doesn't.

I get it, it's a business decision. Anthropic's subscriptions weren't built for the usage patterns that tools like OpenClaw generate, and they're prioritizing capacity for their own products. Fair enough. But if you're someone who relies on OpenClaw to manage your calendar, automate your morning briefing, or [keep tabs on your RSS feeds](/blog/openclaw-rss-ai-agent-infrastructure-monitoring), this change puts you in a tough spot.

The timing stung. A tweet Friday night, a cutoff Saturday afternoon. According to [The Verge](https://www.theverge.com/ai-artificial-intelligence/907074/anthropic-openclaw-claude-subscription-ban), OpenClaw's creator Peter Steinberger (now at OpenAI) and board member Dave Morin tried to get Anthropic to delay, and only managed to buy a week.

## Why OpenRouter instead of a direct Anthropic API key

You could swap to a direct Anthropic API key and call it a day. But after going through this, I realized the real issue isn't billing. It's that my entire agent setup was dependent on one provider's decisions. If you're running tasks that actually matter to your day, you deserve something more stable than that.

I've been using [OpenRouter](https://openrouter.ai) across several of my projects, including [AccessHawk](https://accesshawk.ai). It's a unified API that sits in front of dozens of model providers. One API key, one base URL, and you can hit Claude, GPT, Gemini, or whatever else you need without managing separate credentials for each one.

### Distributed infrastructure with automatic failover

Anthropic's API has outages. Every provider does. When you're running an agent that monitors your calendar every 15 minutes, [checks RSS feeds three times a day](/blog/openclaw-rss-ai-agent-infrastructure-monitoring), and handles your morning briefing, downtime isn't just annoying. It's missed alerts.

OpenRouter maintains connections to multiple endpoints for the same model. If one Anthropic endpoint is slow or down, it routes to another. If Anthropic is entirely unreachable, you can configure fallback models from other providers. Your agent keeps running while you sleep.

### Model freedom without reconfiguration

With a direct Anthropic API key, you're locked into Claude. Want to try GPT-5 for a specific task? New API key, new provider config, new auth setup. Want to use a cheaper model for simple cron jobs? Still Anthropic's pricing tiers.

With OpenRouter, switching models is a one-line config change. Your API key doesn't change. Your auth doesn't change. You just swap the model string:

```bash
# Switch from Anthropic's premium tier to mid tier
openclaw models set openrouter/anthropic/<current-sonnet>

# Try OpenAI's flagship for a while
openclaw models set openrouter/openai/<current-gpt-flagship>

# Go back to Anthropic's premium tier
openclaw models set openrouter/anthropic/<current-opus>
```

Substitute the angle-bracketed placeholders with current model IDs from openrouter.ai/models. As of April 2026 those would be `claude-sonnet-4-6`, `gpt-5-turbo`, and `claude-opus-4-7` respectively.

If you don't want to pick a model at all, OpenRouter has an [Auto Router](https://openrouter.ai/docs/guides/routing/routers/auto-router) (`openrouter/auto`) that analyzes your prompt and picks the best model for the task. Simple prompts get routed to cheaper models, complex ones get the heavy hitters. No extra cost on top of whatever model it selects. You can also see [which models other OpenClaw users are running](https://openrouter.ai/apps?url=https%3A%2F%2Fopenclaw.ai%2F) on OpenRouter to get a sense of what works.

### Cost transparency

OpenRouter shows you what every model costs per million tokens, side by side. When you're deciding whether your daily reminder cron needs Opus ($5/$25 per M tokens) or whether Haiku ($1/$5) would do the job just fine, that visibility matters. It also means you can spot pricing changes immediately instead of getting surprised on your next invoice. (All per-million-token figures in this post are accurate as of April 2026; check OpenRouter's model page for current rates before you wire anything up.)

### Insurance against the next billing change

This is the one that sold me. Anthropic changed their billing with 18 hours notice. If you're on a direct API key and they change pricing, rate limits, or terms, you're scrambling. With OpenRouter, your worst case is changing a model string. Your agent infrastructure, auth, and configuration stay untouched.

## The migration: 5 minutes, 3 steps

If you made it this far, it may be obvious that this assumes you already have OpenClaw installed and running. If you're starting from scratch, check the [OpenClaw getting started guide](https://docs.openclaw.ai/start/getting-started) first. Otherwise, the migration from Anthropic subscription auth to OpenRouter looks like this.

### Step 1: Get an OpenRouter API key

Go to [openrouter.ai/keys](https://openrouter.ai/keys), create an account, add credits (start with $20-30), and generate an API key. It starts with `sk-or-`.

<Callout type="success">

OpenRouter's credit system is prepaid. You load a balance and draw it down with usage. No surprise invoices. When credits run low, you get an email. For most OpenClaw setups with a handful of cron jobs and casual conversation, $20 lasts a few weeks.

</Callout>

### Step 2: Add OpenRouter to your OpenClaw config

Open your `openclaw.json` and add the OpenRouter provider. Set your API key and your preferred default model:

```json
{
  "agents": {
    "defaults": {
      "model": {
        "primary": "openrouter/anthropic/<current-opus>"
      },
      "models": {
        "openrouter/anthropic/<current-opus>": {}
      }
    }
  },
  "env": {
    "OPENROUTER_API_KEY": "sk-or-..."
  }
}
```

Replace `<current-opus>` with whatever's current on OpenRouter (e.g., `claude-opus-4-7` as of April 2026, or `openrouter/auto` if you'd rather have OpenRouter pick a model per prompt).

This doesn't remove your existing Anthropic config. You can always switch back. For the full configuration reference, see the [OpenClaw OpenRouter provider docs](https://docs.openclaw.ai/providers/openrouter#openrouter).

### Step 3: Restart the gateway

```bash
# Restart the gateway to pick up the new config
openclaw gateway restart

# Verify the model is active
openclaw models status
```

That's it. Your next conversation will route through OpenRouter to Anthropic's Claude Opus. Same model, same quality.

## Optimizing costs with per-cron model selection

This is where OpenRouter really pays off. Not every task needs your most expensive model. A simple daily reminder doesn't need Opus-level intelligence. Neither does a git auto-commit script or a simple email check.

OpenClaw lets you set a model per cron job. Combine that with OpenRouter's access to every pricing tier, and you can optimize aggressively:

```bash
# List your cron jobs to get the job IDs
openclaw cron list

# Lightweight crons: use the mid tier (cheaper per token)
openclaw cron edit <job-id> --model openrouter/anthropic/<current-sonnet>

# Complex crons: keep the premium tier
openclaw cron edit <job-id> --model openrouter/anthropic/<current-opus>

# Restart the gateway to pick up the changes
openclaw gateway restart
```

After editing, you can verify which model each cron is using:

```bash
openclaw cron list --json | jq '.jobs[] | {name, model: .payload.model}'
```

The pricing difference is real. Sonnet's output tokens cost 40% less than Opus. For crons that run every 15-30 minutes and only need to parse some text or run a shell script, that adds up fast.

<Callout type="info">

You can go even cheaper. Haiku at $1/$5 per M tokens handles truly simple tasks like timed reminders and basic script execution. For crons that are basically "run this bash script and send me the output," Haiku is more than enough. OpenRouter also has a [Free Models Router](https://openrouter.ai/docs/guides/routing/routers/free-models-router) (`openrouter/free`) that picks from available free models like DeepSeek R1 and Llama. Worth experimenting with for the lowest-stakes tasks.

</Callout>

A typical setup with 5-7 cron jobs and regular conversation might look like this:

- <strong>Conversations</strong> (Opus): $20-40/month depending on how chatty
  you are
- <strong>Complex crons</strong> (Opus): $5-10/month for 2-3 jobs with
  multi-step tool orchestration
- <strong>Simple crons</strong> (Sonnet/Haiku): $3-8/month for 4-5 lightweight
  scheduled tasks
- <strong>Total</strong>: roughly $30-60/month, often less than a Max
  subscription

With prompt caching enabled (which works through OpenRouter on Anthropic models), cached input tokens cost 90% less. If your crons use similar system prompts across runs, caching alone can cut your bill significantly.

## My current setup

In April 2026 I was using Qwen 3.6 Plus as my primary model while it was free on OpenRouter (that free preview has since ended; it's a paid model now), with the [Auto Router](https://openrouter.ai/docs/guides/routing/routers/auto-router) as a fallback. I've configured the Auto Router's [Allowed Models](https://openrouter.ai/workspaces/default/routing) to only select from Anthropic models, so if the free model goes down or gets retired, my agents fall back to Claude automatically.

```json
{
  "agents": {
    "defaults": {
      "model": {
        "primary": "openrouter/<current-free-or-cheap-model>",
        "fallbacks": ["openrouter/openrouter/auto"]
      }
    }
  }
}
```

In April 2026 my primary was `openrouter/qwen/qwen3.6-plus:free`; pick whatever's free or cheap on OpenRouter when you read this. For the time being, this costs me basically nothing for day-to-day usage. When the free tier goes away, the Auto Router kicks in and picks the best Anthropic model for each prompt. That kind of setup just isn't possible when you're locked into a single provider.

## What about the other options?

OpenRouter isn't the only path forward. I looked at the alternatives before committing.

### Direct Anthropic API key

Straightforward to set up with `openclaw onboard --anthropic-api-key "$KEY"`, and the pricing is the same as going through OpenRouter for Claude models. But you're still tied to a single provider with no failover and no model flexibility. If that's fine for your use case, it works. I just didn't want to be in this same position the next time something changes.

### Claude Desktop with Cowork scheduled tasks

Claude Desktop's Cowork feature now supports scheduled tasks with `/schedule`. Sounds like a replacement for OpenClaw crons, but there are significant gaps. Your Mac has to be awake and the app running; if it sleeps, tasks get skipped (as of July 2026 this gap is closing: Cowork scheduled tasks gained cloud execution in beta, running on their cadence even with the app closed). There's no persistent memory system, no heartbeat coordination, and no way to send results to Telegram or Discord natively. Each task runs as an isolated session with no shared context. For a simple "summarize this document every Monday" workflow, it's fine. For an agent setup with interconnected crons, memory, and mobile notifications, it's not there yet.

### Switch to a different provider entirely

OpenClaw supports OpenAI, Google Gemini (API key or OAuth through the Gemini CLI), Qwen, GLM, MiniMax, and others. Some offer flat-rate coding plans. If you're open to switching away from Claude entirely, you could use your Google One AI Pro subscription for Gemini access at no extra cost. The tradeoff is that Claude's tool use and instruction following is still best-in-class for complex agent workflows. Gemini and GPT are catching up, but for multi-step tool orchestration with nuanced system prompts, Opus is hard to beat.

## The bigger takeaway: don't depend on a single provider

This billing change was a reminder of something we already know in infrastructure: single points of failure are liabilities. Your database has replicas. Your deployment has rollback. Your DNS has failover. Your AI provider should too.

OpenRouter isn't the only routing layer out there, but it's the one with the best OpenClaw integration today. The point isn't "use OpenRouter." The point is: abstract your provider dependency so that the next time a vendor changes terms on a Friday night, you're not spending your weekend reconfiguring your entire agent setup.

I run cron jobs that check my calendar, monitor RSS feeds, send me security advisories, and automate git commits. None of those should break because a billing department made a policy change. With OpenRouter in the middle, they didn't.

## Conclusion

The migration took five minutes. An API key, a config edit, a gateway restart, and everything was back. My crons kept running, my Telegram conversations kept working, and nothing broke.

If you're an OpenClaw user still running on Anthropic subscription auth, the move is simple: get an OpenRouter API key, add it to your `openclaw.json`, and restart the gateway. You can run free models day-to-day with Claude as an automatic fallback, or just use Claude directly through OpenRouter with failover built in. Either way, you're not at the mercy of one provider's billing decisions anymore.

The OpenClaw docs have a full [OpenRouter provider guide](https://docs.openclaw.ai/providers/openrouter) if you want the detailed configuration reference.

---

## That Accessibility Widget Isn't Protecting You. It's a Lawsuit Waiting to Happen.

Source: https://charlesjones.dev/blog/accessibility-overlays-not-wcag-compliance-legal-risk
Published: 2026-03-13
Modified: 2026-07-21
Tags: Accessibility, WCAG, ADA, Healthcare, Legal, Web Development, AccessHawk

> Accessibility overlays like AudioEye and accessiBe promise WCAG compliance with a single line of JavaScript. The FTC, the courts, and the disability community all disagree. I dig into why overlays fail, what legal exposure they actually create, and what it takes to build accessibility into your source code.

A family friend runs a physical therapy clinic. Good practice, solid reputation, the kind of place where patients actually get better. A few weeks ago they asked me to take a look at their website. They'd been paying for an accessibility overlay, one of those tools that drops a widget icon in the corner of your site and claims to make it WCAG-compliant. I quickly realized the site was relying entirely on an overlay for accessibility, and it wasn't doing its job. Not even close.

I hold the W3Cx WAI0.1x certification from W3C, and I built [AccessHawk](https://accesshawk.ai), an AI-powered WCAG scanner. So this is something I think about a lot. But you don't need a certification or a scanning tool to understand the problem here. These overlay companies have been selling a shortcut that doesn't work, and businesses, especially in healthcare, are the ones left holding the bag when it falls apart.

## What overlays actually do (and don't do)

An accessibility overlay is a third-party JavaScript widget that gets injected into your website. Overlay companies sell these products with a simple pitch: add one script tag, and your site becomes accessible. WCAG-compliant. ADA-ready. No code changes needed.

In practice, these widgets add a toolbar that lets users adjust font size, toggle contrast, or enable a screen reader mode. Some use AI to guess at missing alt text or infer form labels. On the surface, it looks like it's doing something. But here's the problem: none of that fixes the underlying code.

If your site has a form where the input fields aren't associated with their labels, an overlay might try to guess the association at runtime. If an image is missing alt text, the AI might generate a description. But these are band-aids applied on top of broken markup. Screen readers don't always pick them up. The fixes can conflict with assistive technology that users already have configured. And when the overlay's JavaScript fails to load, or the user has scripts blocked, everything the widget was supposedly fixing reverts to its broken state.

The [Overlay Fact Sheet](https://overlayfactsheet.com), signed by over 800 accessibility professionals, puts it plainly: overlays do not and cannot repair the underlying accessibility problems in a website's source code.

## The legal landscape has shifted

For years, overlay companies operated in a gray area. They made big claims, businesses bought in, and nobody looked too closely. That changed fast.

### The FTC stepped in

In January 2025, the FTC [announced a $1 million settlement with accessiBe](https://www.ftc.gov/news-events/news/press-releases/2025/01/ftc-order-requires-online-marketer-pay-1-million-deceptive-claims-its-ai-product-could-make-websites) for deceptive marketing. The company had claimed its AI-powered widget could make any website WCAG-compliant within 48 hours. The FTC found those claims were "false, misleading, or unsubstantiated." The final order, approved in April 2025, bars accessiBe from making compliance claims without evidence and remains in effect for 20 years.

That's not a slap on the wrist. That's the federal government saying, on the record, that these products cannot do what they advertise.

### Overlays are showing up in lawsuits as the problem, not the solution

According to [UsableNet's 2024 Year-End Report](https://info.usablenet.com/2024-year-end-report), over 4,000 ADA digital accessibility lawsuits were filed in 2024. Of those, 25% specifically cited accessibility widgets and overlays as barriers rather than solutions. Plaintiffs are pointing at the overlay itself as evidence that the site isn't accessible.

The lawsuits kept coming in 2025, with nearly 500 targeting overlay-equipped websites in just the first half of the year. Having an overlay installed isn't a legal shield. It's a target.

### Overlay companies are getting sued by their own customers

In 2024, a flower delivery company filed a class action lawsuit against UserWay in Delaware District Court after being sued by a disabled user who couldn't navigate their site despite the UserWay overlay being installed. The lawsuit alleges UserWay promoted its product as a simple, foolproof ADA compliance solution and failed to deliver. The court allowed the case to proceed.

Meanwhile, AudioEye previously sued accessibility expert Adrian Roselli for publicly criticizing overlay products. The case was widely viewed as a SLAPP suit to silence critics. AudioEye dropped it in January 2024. The National Federation of the Blind revoked accessiBe's sponsorship of its 2021 national convention, calling the company's behavior "harmful to the advancement of blind people in society."

When the disability community, the courts, and the federal government are all telling you the same thing, it's worth listening.

## Why healthcare sites carry higher risk

Every business with a public website has some level of ADA exposure. But healthcare practices face more risk than most.

Think about who visits a physical therapy clinic's website. Patients recovering from injuries. People managing chronic pain or mobility limitations. Older adults who may have vision or motor impairments. These are exactly the populations most likely to rely on assistive technology, and most likely to encounter barriers that overlays don't fix.

- Healthcare providers are places of public accommodation under ADA Title III. Courts have increasingly ruled that this extends to websites, especially when the site is used to schedule appointments, access patient information, or submit intake forms.
- A PT clinic isn't like a skateboard shop. Your patients are, by definition, dealing with physical limitations. If your appointment booking form can't be navigated with a keyboard, that's not a hypothetical problem.
- HIPAA doesn't directly mandate WCAG compliance, but a third-party overlay script running on pages that handle patient information raises data handling questions most small practices haven't thought about.
- California, New York, and Illinois have all seen aggressive ADA web accessibility litigation. Healthcare practices in these states are frequent targets.

The DOJ's April 2024 Title II rule requires WCAG 2.1 Level AA conformance for state and local government web content, with compliance deadlines in 2026 and 2027. While Title II targets government entities, it signals the direction enforcement is heading for Title III (private businesses) as well.

## What real accessibility looks like

If overlays don't work, what does? The answer isn't complicated. It's just not a shortcut. Real accessibility is built into the source code of your website. It's not bolted on after the fact with a widget.

### Semantic HTML

Use the right elements for the right purpose. A navigation menu should be inside a `<nav>` element. A page heading should be an `<h1>`, not a `<div>` styled to look like one. Buttons should be `<button>` elements, not `<div onclick>` hacks. When you use semantic HTML, screen readers and other assistive technology can understand the structure of your page without any extra work.

### Form labels and associations

Every form input needs a `<label>` element explicitly associated with it using the `for` attribute. Placeholder text is not a label. When a screen reader user tabs into an email field that has no associated label, they hear "edit text" with no context. That's the kind of issue overlays try to guess their way around, and frequently get wrong.

### Keyboard navigation and focus management

Every interactive element on your page needs to be reachable and operable with a keyboard alone. Tab order should follow a logical sequence. Focus should be visible (no `outline: none` without a replacement). Modal dialogs should trap focus and return it when closed. Dropdown menus should be navigable with arrow keys. This is basic stuff, and overlays can't retrofit it.

### Meaningful alt text

Images that convey information need alt text that describes what the image communicates, not just what it contains. A photo of your clinic's entrance might need alt text like "Front entrance with wheelchair-accessible ramp and automatic doors" rather than "building." Decorative images should have empty alt attributes (`alt=""`) so screen readers skip them entirely.

### Color contrast

WCAG 2.1 Level AA requires a contrast ratio of at least 4.5:1 for normal text and 3:1 for large text. That light gray text on a white background might look clean, but it's unreadable for users with low vision. This is a design decision, not something a runtime widget can reliably fix across every element on your site.

### ARIA attributes (used correctly)

ARIA (Accessible Rich Internet Applications) attributes provide additional context to assistive technology. But the first rule of ARIA is: don't use ARIA if native HTML can do the job. When you do need it, use it correctly. An `aria-label` on a button that says "X" can tell screen readers it means "Close dialog." But ARIA misuse, like adding `role="button"` to a `<div>` without also handling keyboard events, actually makes things worse.

### Putting it together: what accessible markup actually looks like

Here's a real-world example. An appointment request form, the kind you'd find on a healthcare website. The first version is what overlays try to patch at runtime. The second is what it looks like when you build it right from the start.

<strong>Inaccessible markup (what overlays try to fix):</strong>

```markup
<div class="form">
  <div class="field">
    <input type="text" placeholder="Full Name">
  </div>
  <div class="field">
    <input type="text" placeholder="Email">
  </div>
  <div class="field">
    <input type="text" placeholder="Phone">
  </div>
  <div class="field">
    <div class="label">Preferred Date</div>
    <input type="text" placeholder="MM/DD/YYYY">
  </div>
  <div class="field">
    <div class="label">Reason for Visit</div>
    <textarea placeholder="Describe your condition..."></textarea>
  </div>
  <div class="btn" onclick="submitForm()">Request Appointment</div>
</div>
```

No `<form>` element. No `<label>` elements. Placeholder text used as labels (which disappears on focus). A `<div>` acting as a button with no keyboard support. A screen reader user landing on this form hears a series of unlabeled edit fields with no context.

<strong>Accessible markup (built correctly from the source):</strong>

```markup
<form aria-labelledby="form-heading" method="post" action="/api/appointments">
  <h2 id="form-heading">Request an Appointment</h2>

  <div class="field">
    <label for="full-name">Full Name</label>
    <input type="text" id="full-name" name="fullName" required
           autocomplete="name">
  </div>

  <div class="field">
    <label for="email">Email Address</label>
    <input type="email" id="email" name="email" required
           autocomplete="email">
  </div>

  <div class="field">
    <label for="phone">Phone Number</label>
    <input type="tel" id="phone" name="phone"
           autocomplete="tel">
  </div>

  <div class="field">
    <label for="date">Preferred Date</label>
    <input type="date" id="date" name="preferredDate" required>
  </div>

  <div class="field">
    <label for="reason">Reason for Visit</label>
    <textarea id="reason" name="reason" required
              aria-describedby="reason-hint"></textarea>
    <p id="reason-hint" class="hint">
      Briefly describe your symptoms or the type of care you need.
    </p>
  </div>

  <button type="submit">Request Appointment</button>
</form>
```

Every input has an associated `<label>`. The form has a semantic heading. Input types are specific (`email`, `tel`, `date`) so mobile keyboards adapt and validation is built in. The submit element is a real `<button>` that works with keyboards and screen readers out of the box. The textarea has a hint linked with `aria-describedby` so assistive technology reads it in context. No overlay needed.

## The overlay pitch vs. reality

Overlay companies sell to business owners who don't have the technical background to evaluate the claims. The pitch sounds reasonable: "You don't need to rebuild your site. Just add this one script." For a small business owner who's already juggling payroll, marketing, and patient care, that's hard to say no to.

But the reality is that accessibility is a development practice, not a product you install. It's like the difference between a building that was designed with wheelchair ramps, wide doorways, and accessible restrooms versus one that bolts a "wheelchair accessible" sign on the front door without changing anything inside.

The building inspector doesn't care about the sign. And increasingly, neither do the courts.

<Callout type="warn">

If your web developer or agency installed an overlay and told you that you're compliant, ask them to show you the WCAG audit results from the actual source code. If they can't, you have a problem that the overlay is masking, not solving.

</Callout>

## What to do if your site is using an overlay right now

If you're a business owner reading this and your site currently uses an overlay, don't panic. But do take it seriously.

1. Have a qualified developer or accessibility professional evaluate your site against WCAG 2.1 Level AA. Tools like [AccessHawk](https://accesshawk.ai) can give you an automated baseline (its scan engine is also open source as [A11yHawk](https://github.com/charlesjones-dev/a11yhawk), if your developer would rather run it directly), but a thorough audit includes manual testing with screen readers and keyboard-only navigation.
2. Focus on the issues that prevent users from completing core tasks first. Can someone book an appointment? Can they navigate to your contact information? Can they read your services page? Fix these first.
3. Accessibility isn't a one-time fix. It needs to be part of how your site is built and maintained. If your current developer's answer to accessibility is an overlay, find someone who knows how to write accessible markup.
4. Once your site's source code is accessible, you don't need a widget. The overlay adds page weight, can interfere with assistive technology, and signals to informed plaintiffs that your site likely has underlying issues.
5. Maintain an accessibility statement on your site. Note what standards you're conforming to, what's been tested, and how users can report issues. This shows you're taking it seriously and staying on top of it.

## The bottom line

Accessibility overlays are not a compliance solution. The FTC has said so. The courts are saying so. The disability community has been saying so for years. These products create a false sense of security while leaving the actual problems untouched, and increasingly, they're making businesses more vulnerable to legal action, not less.

If your website was built accessible from the source code, you wouldn't need an overlay. You want a site where the HTML, the design, and the interactions work for everyone, not a widget guessing at fixes on top of broken markup.

For healthcare practices especially, this isn't optional. Your patients are the people who need accessible websites the most. Build it right, or find someone who will.

---

## I Built an API So My AI Agent Could Read My RSS Feeds

Source: https://charlesjones.dev/blog/openclaw-rss-ai-agent-infrastructure-monitoring
Published: 2026-03-08
Modified: 2026-10-22
Tags: AI, RSS, API, OpenClaw, Automation, Infrastructure, DevOps, Developer Tools, Productivity

> I follow around 35 RSS feeds for infrastructure security, DevOps, and full-stack engineering. Most of it is noise. I built a JSON API for SereneReader so my OpenClaw agent could check my feeds three times a day and tell me what actually matters.

I follow around 35 RSS feeds. Infrastructure security advisories, DevOps tooling blogs, language and framework changelogs, staff-level engineering posts from companies I respect.

On any given day, maybe 5-10 of those articles are actually relevant to what I'm working on. The rest is noise I was spending 20-30 minutes every morning scanning through, and I still missed things.

So I built an API for [SereneReader](https://serenereader.com), my RSS reader, and connected it to my [OpenClaw](https://openclaw.ai) agent. It checks my feeds three times a day (9 AM, 12 PM, 6 PM) and sends me what's worth reading. That morning scan is down to about two minutes now.

## The feeds I'm monitoring

My SereneReader account has feeds organized into folders: Infra Security, Cloud & DevOps, Node.js / TypeScript, Vue / Nuxt, .NET, and Staff+ Engineering.

On a busy day, that's 50+ new articles. Most aren't relevant to whatever I'm shipping that week. An npm advisory matters if the package is in my lockfile. A new Vue RFC matters if it affects my projects. A Stripe engineering retrospective is interesting but not urgent. I needed something that could tell the difference.

## Why I built the API instead of scraping

The obvious approach would be to have the agent scrape RSS feeds directly. Parse XML, fetch articles, deal with encoding. I tried that early on. Feeds use different XML dialects (RSS 1.0, RSS 2.0, Atom), plenty have broken encoding, some need specific User-Agent headers, and a few rate-limit aggressively. It was miserable.

SereneReader was built to deal with all of that. It fetches feeds on a schedule, parses the XML, fixes encoding, deduplicates articles, and stores structured data. I just needed to expose that as JSON.

Three endpoints: list articles (with filters for feed, folder, and date range), list feeds, and check usage. Bearer token auth, 30 requests per minute. The agent never touches RSS or XML; it queries the API and gets back titles, URLs, publish dates, snippets, and feed metadata.

I wrote a more detailed walkthrough of the API itself on the SereneReader blog: [Building automations with the SereneReader API](https://serenereader.com/blog/api-automations).

## The OpenClaw setup

[OpenClaw](https://openclaw.ai) is an AI agent platform that lets agents call external APIs as tools. Three things to configure: the API tool, the agent instructions, and a schedule.

### Defining the SereneReader tool

In the OpenClaw agent config, I pointed it at SereneReader's article endpoint. It needs the API base URL, the Bearer token, and the query parameters (`since`, `folder`, `limit`). SereneReader's settings page shows the endpoint docs, so configuring the tool was straightforward.

### The schedule

Three runs per day:

- <strong>9:00 AM</strong> - Morning briefing. Covers overnight articles.
- <strong>12:00 PM</strong> - Midday check. Catches anything published in the
  morning across US and European time zones.
- <strong>6:00 PM</strong> - End of day. Quick scan before I stop working.
  Anything urgent gets flagged for tomorrow morning.

Each run uses the `since` parameter to fetch only what's been published since the last check. The 9 AM run looks back about 15 hours, noon looks back 3, and 6 PM looks back 6.

### The agent prompt

Here's roughly what my agent instructions look like:

```text
You have access to the SereneReader API. Fetch articles published
since the last check.

For each article, evaluate whether it's relevant to:
- Infrastructure security (CVEs, advisories, breaches, patches)
- DevOps tooling I use (Docker, GitHub Actions, Cloudflare)
- Node.js/TypeScript ecosystem changes that affect production code
- Vue, Nuxt updates that require migration or unlock new patterns
- Staff+ engineering insights (architecture decisions, scaling,
  team leadership, incident management)

Ignore:
- Marketing announcements and product launches I don't use
- Beginner tutorials
- Opinion pieces without actionable takeaways
- Anything I've seen in a previous check

For relevant articles, provide:
1. The title and source feed
2. A 1-2 sentence summary of why it matters to me specifically
3. Priority: HIGH (security advisories, breaking changes) or
   NORMAL (worth reading when I have time)

If nothing relevant was published, say so. Don't pad the summary.
```

The "why it matters to me specifically" part is what makes this work. I don't want a generic summary. I want "new CVE in a package in your lockfile" or "Docker changed a default that your builds depend on." Not keyword matching; actual reasoning about my stack.

## What the briefings look like

A typical briefing might flag a CVE in a package in my lockfile as HIGH priority, a relevant infrastructure changelog as NORMAL, and skip the 40+ articles that don't apply to my current work. Each flagged item includes the source feed and a sentence or two about why it matters to me specifically. The whole thing takes about 90 seconds to read.

## Why this works better than email digests

I tried email digests before building this. They didn't work for a few reasons:

- Email digests send everything or filter by keyword. Keywords miss nuance. "Redis" matches marketing posts about Redis Cloud pricing, not just the CVE I care about.
- Once a day isn't enough. A critical security advisory at 10 AM shouldn't sit until tomorrow's digest.
- Digest emails compete with everything else in my inbox. OpenClaw sends the summary straight to Telegram, where I know every message has already been filtered.
- A keyword filter doesn't know my stack. The agent knows I use Nuxt and BullMQ. It understands that a vulnerability in a transitive dependency is still relevant to me.

## The SereneReader side

[SereneReader](https://serenereader.com) is the RSS reader I built because I was tired of bloated alternatives. Minimal UI, keyboard-driven, focused reading mode, no ads. I use it daily, and the API turns it into a data source for this kind of automation.

API access is on the Pro and Team plans (rates start around $5/mo and $25/mo respectively as of writing — see [serenereader.com](https://serenereader.com) for current pricing). JSON responses with article titles, URLs, publish dates, content snippets, and feed metadata. No XML parsing, no encoding issues on your end. Just HTTP requests.

If you want to wire this up with a different LLM tool, anything that can make authenticated HTTP requests will work. I wrote a walkthrough with a Node.js example on the SereneReader blog: [How to connect your RSS feeds to AI agents](https://serenereader.com/blog/connect-rss-feeds-to-ai-agents).

## Building it yourself

If you want to set up something like this:

1. <strong>Sign up for [SereneReader](https://serenereader.com/login)</strong>
   and subscribe to the feeds you want your agent to monitor.
2. <strong>Upgrade to Pro or Team</strong> to get API access.
3. <strong>Generate an API key</strong> in your settings. The settings page has
   the full endpoint docs and example requests.
4. <strong>Configure your agent</strong> in OpenClaw (or whatever agent platform
   you use) with the SereneReader API as a tool.
5. <strong>Write a prompt</strong> that tells the agent what you care about. Be
   specific about your stack, your role, and what counts as "relevant."
6. <strong>Set a schedule.</strong> Three times a day works well for me. Adjust
   based on how time-sensitive your feeds are.

The whole thing took about 30 minutes once the API existed. Most of that was tuning the prompt. The first version filtered too aggressively and hid things I wanted to see. Adding "why it matters to me" fixed it; the agent had to actually reason about relevance instead of just matching words.

## Conclusion

I built this because scanning headlines every morning was eating time I didn't have. SereneReader gives the agent structured feed data, OpenClaw runs the checks on a schedule, and I get a short summary three times a day.

The security monitoring alone was worth it. CVEs surface within hours now instead of whenever I happen to check the right feed. When you're responsible for the security of multiple production apps, that gap matters.

If your feeds are piling up and you want something smarter than keyword filters, this is the setup. RSS for data, an API for access, an agent for reasoning.

---

## I Built an RSS Reader Because Every Alternative Kept Getting in the Way

Source: https://charlesjones.dev/blog/serenereader-rss-reader-focused-reading-productivity
Published: 2026-02-24
Modified: 2026-10-22
Tags: SereneReader, RSS, Developer Tools, Productivity, Nuxt, Vue, TypeScript

> Most RSS readers have become bloated dashboards full of popups, AI summaries nobody asked for, and upgrade banners that follow you around. I built SereneReader to do one thing well: let you read. Keyboard-first navigation, a focused reading mode that strips away every distraction, and an interface that respects your attention.

I subscribe to a lot of RSS feeds. Security advisories, framework changelogs, engineering blogs, industry news. For years I bounced between RSS readers looking for one that didn't fight me. Every option I tried had the same problem: the app itself demanded more attention than the content I was there to read.

Popup tooltips introducing features I didn't ask for. Banners nudging me to upgrade. AI-generated summaries inserted between me and the article. Rounded corners and padded cards eating screen real estate like it was free. At some point the reader became the distraction.

So I built [SereneReader](https://serenereader.com). It's a modern RSS reader built on one idea: the content you're reading should be the only thing on screen. No noise. No gamification. No algorithm deciding what matters. Just your feeds, your way, and a reading experience that gets out of the way.

It's free to start and live at [serenereader.com](https://serenereader.com).

## Developer Tooling

I built SereneReader because I needed it. As a developer, I read a ton: release notes, RFCs, security disclosures, blog posts from people building things I care about. RSS is still the best way to keep up with all of that. The readers out there just weren't keeping pace with how I actually wanted to use them.

Here's what I ended up building, and why it works the way it does.

<MDXImage
  src="/images/blog/content/serenereader-jade-night-theme.webp"
  alt="SereneReader RSS reader interface showing the dense, terminal-inspired article list with Jade Night theme"
  width={1600}
  height={900}
  caption={
    <>
      <a
        href="https://serenereader.com"
        target="_blank"
        rel="noopener noreferrer"
      >
        SereneReader
      </a>{' '}
      - Jade Night theme, default view
    </>
  }
/>

## Focused reading mode: the feature that started everything

I looked for this in every reader I tried and never found it. Press `f` and everything disappears. The sidebar, the header, the feed list, the unread counts. All of it fades out and you're left with the article on a pure black background, centered at a comfortable reading width.

It sounds simple, and it is. That's the point. When I'm reading a long technical post or a detailed security advisory, I don't want peripheral UI competing for my attention. Focused reading mode gives me the article and nothing else. A small feed name in one corner, the author and date in another, and a subtle scroll progress indicator. That's it.

Press `f` or `Escape` to come back. I use this feature dozens of times a day and it still feels like a relief every time the chrome drops away.

<Callout type="success">

Focused reading mode works especially well at night. The pure black background (#000000) means OLED screens turn off those pixels entirely, and the contrast against the article text is easy on the eyes for extended reading sessions.

</Callout>

## Keyboard-first, not keyboard-also

I spend most of my day in a terminal or an editor. Reaching for the mouse to navigate an RSS reader always felt like a context switch I didn't need. SereneReader was designed around the keyboard from the start, not bolted on after the fact.

- `j` / `k` to move through articles in the list
- `n` / `p` for next and previous article while reading
- `f` to toggle focused reading mode
- `s` to star an article
- `b` or `[` to go back to the feed list
- `Escape` to exit focused mode or close panels

These aren't hidden shortcuts you discover in a help modal. They're the primary way to use the app. I can open [SereneReader](https://serenereader.com), scan my unread articles, read three posts in focused mode, star one for later, and get back to work without touching the mouse once. That's the kind of flow I was after.

## Dense by design, not by accident

Most modern web apps are designed for full-screen browser windows. I don't use my browser that way. I tile windows side by side: editor on the left, browser on the right. That means my browser window is usually around 1100 pixels wide. Every RSS reader I tried wasted significant chunks of that space on padding, rounded cards, and decorative whitespace.

SereneReader's interface is deliberately dense. Thin 1px borders instead of shadows. Minimal padding, usually 4 to 8 pixels instead of the 16 to 24 that's become standard. Sharp corners. Full-width layouts that use the available space instead of floating in the center of it. The aesthetic is closer to a terminal or a tiling window manager than a typical SaaS dashboard.

I'm not going for a different look just because. I want to see as many headlines as possible when I'm scanning 50 unread articles across a dozen feeds, and I don't want to scroll to do it. The dense layout gets me there.

## No dark patterns, no attention tricks

This is the hill I'll die on. SereneReader has no streaks, no badges, no notification anxiety. There are no popup modals telling you about new features. No banners asking you to rate the app. No AI-generated summaries injected between you and the content. The unread count is there if you want it, but it's not pulsing or color-coded to create urgency.

The core philosophy is simple: calm over chaos. An RSS reader should reduce your information anxiety, not contribute to it. Every design decision in SereneReader runs through that filter. If a feature creates pressure to engage, it doesn't ship.

I built SereneReader for people who are tired of apps competing for their attention. If you've ever opened a feed reader and spent the first 30 seconds dismissing tooltips and banners before you could actually read anything, you know exactly what I mean.

Sharing works the same way. You can send someone a share link and they can read it right there, no account required. [Here's one](https://serenereader.com/share/Ri4gI4Oc) from my earlier post about replacing Google Analytics with Umami. That's the actual reading experience, not a watered-down preview trying to get them to sign up.

## Real-time updates without the refresh button

SereneReader uses Server-Sent Events to push updates to your browser in real time. When new articles arrive from your subscribed feeds, the unread count updates live. You don't poll, you don't manually refresh, and you never see stale data.

Behind the scenes, a BullMQ worker handles feed fetching on a schedule, respecting each feed's Cache-Control headers and ETags so it's not hammering servers unnecessarily. When new articles come in, they're pushed through Redis pub/sub to your active SSE connection. The UI updates optimistically, so actions like marking an article as read or starring it feel instant.

Honestly, you stop thinking about it. The feeds just stay current. That's the whole idea.

## Migrate in minutes with OPML

If you're already using another RSS reader, you probably have dozens or hundreds of feed subscriptions built up over years. SereneReader supports OPML import and export, which is the standard format every major reader uses for feed lists.

Export your OPML file from your current reader, import it into [SereneReader](https://serenereader.com), and your entire feed library comes with you. Folders and organization are preserved. The whole process takes a couple of minutes, and you can export back out anytime if you want to try something else. No lock-in.

<Callout type="success">

If you're starting fresh, the Discover page has a curated catalog of feeds across categories like tech news, security, science, and business. Subscribe to anything with one click.

</Callout>

## The stack behind it

[SereneReader](https://serenereader.com) is built with Nuxt 3, TypeScript, MongoDB, Redis, and BullMQ. The web service, worker, and databases are co-located for low-latency internal communication.

The architecture uses a canonical feed model. When multiple users subscribe to the same feed, the articles are stored once and user-specific state (read, starred, saved for later) is tracked separately in a sparse collection. This keeps storage efficient and means the worker only fetches each feed once regardless of how many people subscribe to it.

Authentication is passwordless. You either sign in with GitHub or Google, or enter your email and get a one-time code. I didn't want to build a password reset flow and I didn't want users to have yet another password to manage. Sessions are cached in Redis with HMAC-signed tokens.

Styling is SCSS with CSS variables for theming. I went with that over Tailwind because I wanted full control over the density and spacing without fighting utility classes. There are eight theme presets, Jade Night being the default. Each theme touches borders, backgrounds, and accent colors so it actually feels like a different mood, not just a palette swap.

The whole project is a pnpm monorepo with Turborepo orchestration. Shared types, validators, and database schemas live in a common package so the web app, background worker, and admin dashboard all stay in sync.

## Free to start

There's a free tier that gives you enough to get started and see if the experience clicks for you. No credit card required. If you decide it fits how you work, paid tiers unlock more feeds, longer article retention, and all eight themes.

Head to [serenereader.com](https://serenereader.com) and try it. Import your OPML, grab a few feeds from the Discover page, and press `f` on the first article. That moment when the chrome drops away and it's just you and the words is why I built the whole thing.

## Conclusion

I built SereneReader because I was spending more time fighting my RSS reader than actually reading. Every alternative I tried had good intentions buried under layers of features, upsells, and UI clutter that got between me and the content.

SereneReader is the reader I wanted and couldn't find. It's opinionated about keeping things quiet and staying out of the way. If that sounds like what you've been looking for, it's probably because you've been putting up with the same stuff I was.

It's free to start and it's live. Give it a try at [serenereader.com](https://serenereader.com).

---

## I Replaced Google Analytics with Umami. I'm Not Going Back.

Source: https://charlesjones.dev/blog/umami-analytics-replace-google-analytics-enterprise
Published: 2026-02-19
Modified: 2026-10-22
Tags: Umami, Analytics, Privacy, GDPR, Open Source, Vue 3, Enterprise, Developer Tools

> I migrated all my SaaS products and personal sites from Google Analytics to a self-hosted Umami instance. No cookies, no consent banners, GDPR/CCPA compliant by default, and an API good enough that I built my own real-time multi-site dashboard around it. Here's why enterprise teams should pay attention.

I ran Google Analytics on every project I shipped for over a decade. GA4 was the breaking point.

The interface is slow. The data model forces you into dimensions and metrics that don't map to how I think about traffic. Every site needs a cookie consent banner, and the banners suppress opt-in rates so you're only seeing a fraction of your actual visitors. Google is using your visitor data to improve their own advertising products. And if you're serving EU customers, you're carrying GDPR liability for a third-party service you don't control.

I replaced Google Analytics with [Umami](https://umami.is) across all my production sites: [AccessHawk](https://accesshawk.ai), [SPConnector](https://spconnector.com), [MyPetDay](https://mypet.day), [SereneReader](https://serenereader.com), and this portfolio, all on one Umami instance I host myself. Then I built [UmamiDash](https://github.com/charlesjones-dev/umamidash), an open-source real-time dashboard that connects to any Umami instance via its API.

I'm not going back. Here's why, and why enterprise teams should take this seriously.

## No cookies. No consent banners. Full compliance by default.

Umami never collects personal information from your visitors (this describes the default pageview and event tracking; newer opt-in features like Session Replay record more, so leave them off if the zero-personal-data posture is the point). No cookies, no sessions, no fingerprinting, no IP addresses stored. The tracking script is under 2KB and identifies unique visitors using a hash of the website ID, hostname, and user agent combined with a rotating salt (the visitor salt rotates monthly, the visit salt hourly), so no persistent identifier ever touches the browser.

GDPR and CCPA compliance, out of the box. You don't need cookie consent banners, opt-in flows, or a Cookiebot/OneTrust subscription. And you stop losing 40% of your visitor data to people who clicked "reject all."

For enterprise teams, this wipes out a whole category of compliance work. Legal doesn't need to evaluate a data processor agreement with Google. Marketing gets accurate visitor counts because nobody is filtered out by consent preferences. Dev doesn't have to build and maintain consent management logic. That's three teams with fewer headaches from a single architectural change.

<Callout type="success">

Because no personal data is ever collected, there's nothing to protect and nothing to disclose in a breach. GDPR Article 15 data subject access requests? They don't apply. You can't hand over data that doesn't exist.

</Callout>

## Self-hosted: your data never leaves your infrastructure

I host Umami myself, alongside my other production services. The data sits in a PostgreSQL database I own. No third-party vendor sees my traffic data. No data processing agreements to negotiate. No risk of a vendor changing terms, sunsetting a product, or getting acquired.

Google Analytics has been through this cycle already. Universal Analytics was deprecated in favor of GA4, and the migration broke dashboards, custom reports, and integrations across millions of sites. Historical data from UA is gone unless you exported it before the cutoff. That's a vendor lock-in tax.

Umami is open source under the MIT license. If the project were abandoned tomorrow, I'd still have my running instance, my database, and the source code to maintain it. The deployment is a single Docker container with a PostgreSQL connection string. I had mine running in about 15 minutes.

Umami also offers [Umami Cloud](https://umami.is/pricing) if you don't want to self-host. Even on their hosted tier, you can export all your data at any time. No lock-in either way.

## The API is the real product

This is the thing that got me excited enough to build a whole dashboard around Umami. The REST API is well-documented and clearly designed for developers to build on. Everything you see in the Umami dashboard has a corresponding API endpoint.

Active visitors, pageviews, sessions, events, referrers, browsers, operating systems, devices, countries, regions, cities. All queryable by date range with composable filters. The response format is clean JSON that you can throw at a chart library without much transformation.

I used this API to build [UmamiDash](https://github.com/charlesjones-dev/umamidash), an open-source real-time dashboard that monitors all my sites in a single view. It connects to any self-hosted Umami v2 instance (Umami v3, released late 2025, changed some API endpoints; check the UmamiDash README for current compatibility) and streams live data to the browser.

The architecture is simple: an Express server authenticates with the Umami API, polls active visitors and pageview history, and pushes updates to the browser via Server-Sent Events.

```text
Browser  <--SSE-->  Express (:3000)  --polls-->  Umami API
```

Each website gets a card showing live active visitors, the top 5 countries with visitor counts, the top 5 active URLs, and a 24-hour sparkline bar chart. Click a country and you get a full Leaflet world map with sessions geocoded to city level. The whole thing runs on Vue 3 with shadcn-vue components. If it looks useful, [give it a star on GitHub](https://github.com/charlesjones-dev/umamidash).

Try building something like this on GA4. The Google Analytics Data API requires OAuth 2.0 service accounts, has quota limits that make real-time polling impractical, and returns data in a property/dimension/metric structure you have to wrestle into shape before it's usable. Umami? Clean JSON from REST endpoints. I had UmamiDash streaming live data within a few hours of starting.

<Callout type="success">

UmamiDash is MIT licensed and available on [GitHub](https://github.com/charlesjones-dev/umamidash). It connects to any self-hosted Umami v2 instance (see the README for Umami v3 compatibility). I built it with Vue 3, shadcn-vue, Express, and Leaflet.

</Callout>

## Features that compete with enterprise analytics platforms

People assume Umami is a lightweight alternative that trades features for simplicity. It's not. The [feature set](https://umami.is/features) covers everything I actually used in GA4, plus some things GA4 made unnecessarily hard.

### Core analytics

Page views, visitors, bounce rate, traffic sources, location (down to city level), devices, browsers, OS, and languages. All the standard metrics are there. Data is available in seconds, not the hours you sometimes wait with GA4 for standard reports to populate.

### Real-time data

Active visitors, current pages, referrers, and geographic location. Updates are actually real-time, not the "real-time" you get from GA4's Realtime report where data lags by several minutes. Both the dashboard and the API reflect what's happening right now.

### Custom events and custom data

Track any user interaction with a single function call. I track contact form submissions, blog post reads, dark mode toggles, and scroll depth across my portfolio. You can also attach custom data properties to events for deeper analysis. Here's the composable I use:

```typescript
// useUmami.ts - thin wrapper around window.umami.track()
export const useUmami = () => {
  const trackEvent = (
    name: string,
    data?: Record<string, string | number>,
  ): void => {
    if (!isUmamiAvailable()) return
    try {
      window.umami!.track(name, data)
    } catch {
      // silent fail - analytics should never break your app
    }
  }

  return { trackEvent, trackPageView, isUmamiAvailable }
}
```

Compare this to GA4's event tracking, which requires `gtag('event', ...)` calls with specific parameter schemas, enhanced measurement configuration, and custom dimension registration in the GA4 admin panel before your data shows up in reports.

### Insights: funnels, retention, goals, journeys, revenue, and attribution

This is where Umami surprised me. The Insights section goes well beyond basic metrics. Funnels show conversion and drop-off rates at each step, so you can see exactly where people bail. Retention tracks how often users come back. Goals let you set targets for pageviews and events. Journey maps show how users navigate through your site. Revenue tracking ties user behavior to spend. Attribution shows which marketing channels actually drive conversions.

You also get date-range comparison out of the box, so you can see how this week's metrics stack up against last week without exporting to a spreadsheet. Segments let you save commonly used filters so you can reapply them with a click instead of rebuilding them every time.

### UTM tracking, links, pixels, and campaigns

UTM parameters are collected automatically. Umami also provides trackable links for monitoring click-throughs and tracking pixels you can embed anywhere (emails, external content) to collect data. You get campaign attribution without relying on cookies.

### Teams and sharing

Teams let you share website access with different members securely. You can also generate unique shareable URLs for any dashboard, so stakeholders can view stats without needing an account. Umami Cloud adds scheduled email reports that send website summaries on a cadence you set.

### Filtering and segments

Filter any report by URL, referrer, browser, OS, device, country, region, city, language, or custom event data. Filters compose, so you can stack them to drill into a specific segment. Save those filters as segments to reuse later. GA4 can do similar things, but the interface for building filtered views is harder to navigate.

## The tracking script: 2KB that does the job

Adding Umami to a site is a single script tag:

```typescript
<script defer src="https://your-umami-instance.com/script.js"
  data-website-id="your-website-id"></script>
```

Under 2KB gzipped. It tracks page views automatically and handles single-page application routing out of the box. For context: as of early 2026, `gtag.js` is around 28KB, Google Tag Manager containers vary but often land at 50KB+, and consent management scripts (Cookiebot, OneTrust) add another 30-100KB on top. Exact byte counts drift release-to-release, but the order-of-magnitude gap is the durable point. Dropping all of that made a noticeable difference in my Lighthouse scores.

The script can also respect `Do Not Track` browser settings: add `data-do-not-track="true"` to the script tag and Umami skips visitors with DNT enabled. It's opt-in rather than the default, so flip it on if you want the strictest posture.

Ad blockers won't catch it either. Since it's self-hosted, tracking requests go to your own domain, not a third-party domain that blockers target. Umami also supports proxying the script through a custom path if you want to be thorough. And there's no ethical gray area here, because you're not collecting personal information regardless of whether the blocker fires or not.

## What Google Analytics is actually doing with your data

Google Analytics is free because you're the product. Google monetizes aggregate behavioral data across millions of websites to train their ad targeting algorithms. Your visitor data feeds their audience modeling and conversion optimization tools.

When you install GA on your site, you're handing Google a feed of your customers' behavior: which pages they visit, how long they stay, what they click, where they came from, what device they're on. Google cross-references this with data from Gmail, Chrome, Android, YouTube, and Search to build user profiles.

For enterprise companies, think about what that means. Your analytics vendor is using behavioral data from your traffic to help your competitors buy better-targeted ads. The data you generate makes Google's ad platform more effective for everyone, including the company bidding against you on the same keywords.

With Umami self-hosted, your analytics data stays on your infrastructure. Period. No third party sees it. No advertising network benefits from it. The data exists to serve your business, not someone else's.

## My migration: GA4 to Umami across several sites

I migrated AccessHawk, SPConnector, MyPetDay, SereneReader, and this portfolio to Umami over a single weekend. Same process for each site:

1. Deploy Umami (Docker image + PostgreSQL, 15 minutes for the initial setup)
2. Add each website in the Umami dashboard and copy the website ID
3. Replace the GA4 script tag with the Umami script tag
4. Add a `useUmami` composable for custom event tracking
5. Remove all GA4-related code: `gtag.js`, consent management, cookie banner logic
6. Update privacy policy to reflect the new, simpler data practices

The most satisfying part was deleting code. Every site had consent management logic, cookie banner components, and GA4 initialization code. All of it gone. The privacy policy page got shorter because there's less to disclose when you don't collect personal data.

After migration, I built UmamiDash to have a unified view across every site I run on Umami. Instead of opening Umami tabs for each site or switching between properties in GA4, I have a single dashboard with real-time data for everything. Each site gets a card with live visitors, top pages, geographic distribution, and a 24-hour activity sparkline.

## The enterprise case for Umami

If you're evaluating analytics for an enterprise environment, here's what the comparison actually looks like.

On compliance: Umami eliminates cookie consent banners, data processing agreements, and GDPR overhead for analytics entirely. GA4 requires all of it. On data ownership: self-hosted Umami keeps everything on your infrastructure. GA4 sends data to Google's servers where it feeds their ad business.

On accuracy: Umami sees every visitor because it doesn't need consent. GA4 only counts the ones who click "accept."

On the API: Umami gives you simple REST endpoints with clean JSON. GA4's Data API requires OAuth service accounts, has quota limits, and returns data in a dimensions/metrics model that needs transformation before it's useful.

On performance: 2KB tracking script vs. 28KB+ for GA4 plus consent management scripts. On vendor risk: MIT license, no sunsetting (remember Universal Analytics?), no forced migrations.

On cost: my self-hosted Umami instance has run for a few dollars a month. GA4 is "free" but you're paying with your data. GA360 enterprise pricing has historically started at six figures annually (Google doesn't publish a price sheet, so confirm with your rep).

On customization: the API is open, so you can build whatever you need. UmamiDash exists because I could.

## Conclusion

Google Analytics was the default for a long time because there wasn't a real alternative. Now there is.

I migrated five production sites in a weekend. The code got simpler, the privacy policy got shorter, and the data got more accurate because every visitor is counted, not just the ones who click "accept" on a cookie banner. Then I built a real-time multi-site dashboard in a few days because the API made it easy to do. That's the part I keep coming back to: Umami doesn't just replace GA, it gives you a foundation to build things GA never could.

If you're carrying GDPR compliance overhead for analytics, or you're tired of GA4's interface, or you just don't love the idea of feeding Google's ad machine with your customers' behavioral data: try it. Self-host an instance, point one site at it, and see how it feels. I think you'll delete the GA script tag pretty quickly after that.

UmamiDash is open source at [github.com/charlesjones-dev/umamidash](https://github.com/charlesjones-dev/umamidash). Umami itself is at [umami.is](https://umami.is).

---

## Secure Vibe Coding is Possible

Source: https://charlesjones.dev/blog/semgrep-ai-assisted-development-security-scanning
Published: 2026-01-21
Modified: 2026-10-04
Tags: Semgrep, Security, Claude Code, AI, MCP, Cursor, DevOps, CI/CD, SAST, Automation

> AI coding tools generate code faster than ever, but security scanning hasn't kept pace. Learn how to integrate Semgrep into your AI-assisted workflow with the Semgrep MCP server for real-time vulnerability detection, a pre-commit hook, and GitHub Actions for CI enforcement.

AI tools like Claude Code and Cursor let us ship features faster than ever. The flip side: <strong>more code flowing faster means more potential vulnerabilities shipping faster</strong>.

[Semgrep](https://semgrep.dev) calls this the "vibe coding" problem. We're generating code at a pace where the old workflow of "commit, wait for CI scan, fix issues" doesn't cut it anymore. Security scanning needs to happen while you're still in the editor, not after you've moved on to the next thing.

I run Semgrep at three points: real-time via their [MCP server](https://mcp.semgrep.ai), in a pre-commit hook, and in CI through GitHub Actions. Here's how to set it up.

## The Security Gap in AI-Assisted Development

When Claude Code generates a function, it's optimizing for "does this work?" not "is this secure?" LLMs pattern-match against training data that includes plenty of insecure code examples, and they'll happily reproduce those patterns if they solve the immediate problem.

Common issues AI-generated code can introduce:

- <strong>SQL injection:</strong> String concatenation in database queries
  instead of parameterized statements
- <strong>Hardcoded secrets:</strong> API keys and credentials placed directly
  in source files
- <strong>Insecure deserialization:</strong> Parsing untrusted input without
  validation
- <strong>Path traversal:</strong> File operations without proper input
  sanitization
- <strong>Debug mode in production:</strong> Development flags left enabled in
  generated configs

If AI is generating code in real-time, security analysis should happen in real-time too. Waiting until CI to find out you have a SQL injection vulnerability is too late.

<Callout type="warn">

AI-generated code isn't inherently less secure than human-written code. But if you're writing 10x more code, you need 10x more security coverage. The vulnerabilities pile up fast.

</Callout>

## Three Layers of Security Scanning

I don't rely on a single checkpoint. I run Semgrep at three stages:

1. <strong>Real-time:</strong> Semgrep MCP server scans code as the AI generates
   it
2. <strong>Pre-commit:</strong> a git hook scans staged files before any commit
3. <strong>CI:</strong> GitHub Actions blocks PRs with security findings

Most issues get caught at stage 1 or 2. CI is the safety net that rarely fires because the earlier layers caught everything. But when it does fire, I'm glad it's there.

## Layer 1: Semgrep MCP Server for Real-Time Scanning

Semgrep released an [open-source MCP server](https://github.com/semgrep/semgrep/tree/develop/cli/src/semgrep/mcp) that plugs directly into Claude Code and Cursor. The AI can invoke Semgrep during code generation, catch a vulnerability, fix it, and re-scan to confirm the fix, all without you doing anything.

### What the MCP Server Provides

The MCP server exposes these tools to the LLM:

- <strong>security_check:</strong> Scans code against Semgrep's rule registry
- <strong>semgrep_scan:</strong> Analyzes specific files with configurable rules
- <strong>semgrep_scan_with_custom_rule:</strong> Applies custom patterns you
  define
- <strong>get_abstract_syntax_tree:</strong> Returns AST for deeper semantic
  analysis
- <strong>semgrep_findings:</strong> Pulls issues from Semgrep's AppSec Platform
  (if authenticated)

The LLM can check its own output, spot a problem, fix it, and confirm the fix passed before it hands the code back to you.

### Setting Up Semgrep MCP in Claude Code

```bash
# macOS
brew install semgrep

# Windows/Linux (via pip)
pip install semgrep

# Windows (via pipx for isolated install)
pipx install semgrep

# Verify install. MCP support landed in 1.146.0; check the
# Semgrep release notes for the current minimum if you hit issues.
semgrep --version

# Authenticate for Pro rules (optional but recommended)
semgrep login && semgrep install-semgrep-pro
```

<Callout type="warn">

<strong>Windows users:</strong> If you installed via pip, the Semgrep executable is placed in your Python Scripts directory (typically `%APPDATA%\Python\Python3xx\Scripts`). You must add this directory to your system PATH for Claude Code's MCP server to find it. Open System Properties > Environment Variables > User variables > Path, and add the Scripts directory. Restart Claude Code after updating PATH.

</Callout>

Once Semgrep is installed and in your PATH, add the MCP server to Claude Code:

```bash
# Launch Claude Code
claude

# Add the Semgrep marketplace
/plugin marketplace add semgrep/mcp-marketplace

# Install the plugin
/plugin install semgrep-plugin@semgrep

# Run setup
/semgrep-plugin:setup_semgrep_plugin

# Enable if needed
/plugin enable semgrep-plugin@semgrep
```

### Setting Up Semgrep MCP in Cursor

For Cursor, the setup involves configuring the MCP server in settings and adding hooks for automatic scanning:

```json
// .cursor/mcp.json
{
  "mcpServers": {
    "semgrep": {
      "command": "semgrep",
      "args": ["mcp"]
    }
  }
}
```

Add hooks for automatic scanning after file edits:

```json
// .cursor/hooks.json
{
  "version": 1,
  "hooks": {
    "stop": [
      {
        "command": "semgrep mcp -k stop-cli-scan -a cursor"
      }
    ],
    "afterFileEdit": [
      {
        "command": "semgrep mcp -k record-file-edit -a cursor"
      }
    ]
  }
}
```

### Configuring LLM Behavior for Security Scanning

Installing the MCP server isn't enough. You need to tell the LLM to use it. Without explicit instructions, it won't scan consistently.

<strong>For Claude Code</strong>, add this to your project's `CLAUDE.md` or
global `~/.claude/CLAUDE.md`:

```markdown
## Security Requirements

Security is a core requirement for all code in this project. After generating or modifying any code that handles user input, authentication, data access, or external APIs, invoke Semgrep to scan for vulnerabilities. If issues are found, fix them immediately and re-scan to verify remediation before considering the task complete.
```

<strong>For Cursor</strong>, add equivalent instructions to your User Rules in Settings > Rules:

```text
Security is a core requirement. After generating or modifying code that handles user input, authentication, data access, or external APIs, invoke Semgrep to scan for vulnerabilities. Fix any issues found and re-scan to verify remediation.
```

<Callout type="success">

You need to make security scanning part of the LLM's definition of "done." Otherwise it considers the task complete when the code works, not when it's secure.

</Callout>

## Layer 2: A Pre-Commit Hook

Real-time scanning catches most issues, but it depends on the LLM remembering to call the tool. I want a checkpoint that doesn't depend on anyone remembering anything, so Semgrep also runs as a git pre-commit hook. Nothing gets committed until the staged files pass.

The [pre-commit](https://pre-commit.com) framework is the simplest way to wire that up, and Semgrep publishes a hook for it. Add a `.pre-commit-config.yaml` to the repo root:

```yaml
# .pre-commit-config.yaml
repos:
  - repo: https://github.com/semgrep/pre-commit
    rev: 'v1.172.0' # any current release tag; `pre-commit autoupdate` bumps it
    hooks:
      - id: semgrep
        entry: semgrep
        args: ['--config', 'auto', '--error', '--skip-unknown-extensions']
```

Then install the hook once per clone:

```bash
# pip or Homebrew both work
pip install pre-commit

# Writes .git/hooks/pre-commit
pre-commit install

# Optional: scan the whole repo once instead of just staged files
pre-commit run --all-files
```

`--error` makes Semgrep exit non-zero on any finding, which is what blocks the commit. The hook only scans staged files, so on a normal commit it finishes before I notice it ran. Point `--config` at the same rules your CI uses, so a commit that passes locally doesn't fail in the pipeline.

If you'd rather not add Python tooling to a Node project, a hook manager like Husky or Lefthook can run the same `semgrep scan --config auto --error` command against staged files. The point is the gate, not the tool that installs it.

## Layer 3: GitHub Actions CI Enforcement

The final layer catches anything that slipped past local scanning. Here's the workflow I use:

```yaml
# .github/workflows/security.yml
name: Security Scanning

on:
  push:
    branches: [main, develop]
  pull_request:
    branches: [main]

jobs:
  semgrep:
    name: Semgrep SAST
    runs-on: ubuntu-latest
    container:
      image: semgrep/semgrep
    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Run Semgrep
        run: semgrep ci
        env:
          SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }}

  # Add additional jobs as needed:
  # - dependency-audit (npm audit, pip-audit, etc.)
  # - secret-scanning
  # - license-compliance
```

If you use Semgrep's cloud platform, `semgrep ci` uploads findings for tracking. For open-source repos, use `semgrep scan --config auto` instead.

### Blocking PRs on Security Findings

Set up branch protection to require the security check:

1. Settings > Branches > Branch protection rules
2. Add rule for `main`
3. Enable "Require status checks to pass before merging"
4. Select "Semgrep SAST"

PRs with security findings get blocked until you fix them.

## Real-World Application: AccessHawk

I use this setup on [AccessHawk](https://accesshawk.ai), my accessibility scanner SaaS. It handles user auth, subscription billing, and scan data. Security problems would be bad.

Having Semgrep at every layer means issues get caught during development instead of code review or production. I ship faster because I'm not worried about what I might have missed.

### The Workflow in Practice

A typical feature implementation:

1. Claude Code writes the code, with the Semgrep MCP server catching issues as it goes
2. The pre-commit hook scans the staged files when I commit
3. Push to GitHub, CI runs the security workflow
4. PR blocked if findings exist

Most issues get caught at step 1 or 2. CI rarely finds anything new because the earlier layers already caught it.

## Set This Up

I run Semgrep on every project now, even without AI involvement. But when an assistant can implement a feature in minutes, a "security review before release" step can't keep up. The scanning has to run continuously instead of as a gate at the end.

Real-time MCP scanning catches issues as code is generated. The pre-commit hook stops anything that slipped through from being committed. CI blocks the main branch from anything that got past both.

The setup is straightforward: install the MCP server, add the pre-commit config, drop in the GitHub Actions workflow. You can have all three layers running in 15 minutes.

---

## Why I Chose Nuxt Over Next.js for AccessHawk

Source: https://charlesjones.dev/blog/why-i-chose-nuxt-over-nextjs-for-accesshawk
Published: 2026-01-11
Modified: 2026-10-05
Tags: Nuxt, Next.js, Vue, React, TypeScript, Developer Experience, SaaS, Framework Comparison

> I built AccessHawk with Nuxt instead of Next.js. Vue's reactivity model and auto-imports made me faster, and I didn't have to give up TypeScript or testing to get there.

When I started building [AccessHawk](https://accesshawk.ai) - an AI-powered web accessibility scanner that uses Playwright, Lighthouse, and LLMs to analyze websites for WCAG compliance - I had a choice to make. I could reach for React and Next.js, the safe, popular choice that dominates tech discussions. Or I could use Nuxt and Vue, the framework that had consistently made me more productive on personal projects.

I chose Nuxt. Not because I don't know React - I've shipped React applications on enterprise projects. I chose Nuxt because after spending too many hours debugging stale closures, memorizing hooks rules, and fighting with Next.js's App Router, I wanted to build something without the framework getting in my way.

React is a good framework with an enormous ecosystem. But after building AccessHawk - a real-time distributed system with Redis pub/sub, BullMQ job queues, SSE streaming, and full TypeScript coverage - I'm more convinced that Nuxt makes me faster.

## The React Pain Points I Left Behind

Here's what drove me away from React. These aren't theoretical concerns - they're problems I hit repeatedly in production React codebases.

### Stale Closures

React's hooks capture values at render time, creating closures that can become stale if dependencies aren't managed perfectly. I've spent hours debugging issues where a callback referenced an old state value, or an effect ran with outdated props. The mental overhead of constantly asking "is this closure stale?" is exhausting.

Vue's reactivity system doesn't have this problem. Reactive references are always current because they're proxied objects, not captured values. When I access `myRef.value` in a callback, I get the current value - not whatever it was when the function was created.

### The Rules of Hooks

React's Rules of Hooks - no conditionals, no loops, same order every render - exist because of implementation details in React's reconciler. They take getting used to, and they create a class of bugs that Vue's model doesn't have.

Vue's Composition API has no such restrictions. Call composables wherever you want, conditionally if needed. The framework doesn't care about call order because it tracks dependencies through reactive proxies, not array positions.

### The App Router

Next.js's App Router introduced React Server Components, which sounds great in theory - render on the server, ship less JavaScript. In practice, it created a maze of "use client" directives, confusing hydration errors, and an entirely new mental model for what was previously straightforward.

I watched teams struggle with which components could be server components, when to add "use client", and how to share state across the boundary. The complexity cost was real.

Server Components solve real problems for some applications. For the ones I build, the extra complexity cost more than it saved.

## What Nuxt Gets Right

Nuxt also has real advantages that made me faster on AccessHawk.

### Auto-Imports: Less Typing, More Building

In a React project, the top of every file looks the same: `import { useState, useEffect, useCallback, useMemo } from 'react'`, followed by component imports, utility imports, type imports. It's boilerplate that adds up across hundreds of files.

Nuxt auto-imports Vue's reactivity primitives, all your composables, all your components, and all your utilities. The `ref`, `computed`, and `watch` functions are just available. Your `useScan` composable is just available. Your `ScanResults` component is just available. The cognitive load of "where does this come from" disappears because the answer is always "Nuxt handles it."

### Reactivity That Makes Sense

Vue's reactivity system uses JavaScript Proxies to track dependencies automatically. When you access a reactive value, Vue knows. When you modify it, Vue knows. There's no dependency array to forget, no stale closure to debug.

```typescript
// Vue: Just works
const count = ref(0)
const doubled = computed(() => count.value * 2)

// The callback always sees current values
setInterval(() => {
  console.log(count.value) // Always current
}, 1000)
```

It's a different model. I spent zero time debugging stale closures in AccessHawk.

### Server Routes Without Ceremony

AccessHawk's backend handles complex workflows: validating URLs, creating BullMQ jobs, streaming results via SSE, managing user authentication, encrypting API keys. Nuxt's server routes made this straightforward.

```typescript
// server/api/scan/stream.get.ts
export default defineEventHandler(async (event) => {
  const { id } = getQuery(event)
  const stream = createEventStream(event)
  // Subscribe to Redis, stream results, clean up on close
  return stream.send()
})
```

The file name defines the route and method. The handler is a simple function. No ceremony, no boilerplate, no confusion about request/response types.

### Smaller Bundles, Faster Apps

Vue's compiler can analyze templates at build time, tree-shaking unused features and generating optimized render functions. That usually means smaller bundles for the same UI, though it depends a lot on what you pull in.

For a SaaS product where every kilobyte affects load time and user experience, this matters. AccessHawk's initial bundle is lean despite including a full accessibility scanning interface with real-time updates.

## Full TypeScript Without Compromise

A common criticism of Vue is that TypeScript support isn't as good as React. This was true years ago. It's not true now. AccessHawk is fully typed, and I haven't hit any typing issues that React wouldn't also have.

### Type-Safe Composables

Every composable in AccessHawk has full type inference. Return types are inferred, reactive refs are properly typed, and the IDE knows exactly what's available.

```typescript
// composables/useScan.ts
export function useScan() {
  const status = ref<ScanStatus>('idle')
  const results = ref<ScanResult | null>(null)
  const error = ref<string | null>(null)

  async function startScan(url: string): Promise<string> {
    // Full type safety throughout
  }

  return { status, results, error, startScan }
}
```

### API Route Types

Nuxt generates types for all API routes automatically. When I call `$fetch('/api/scan')`, TypeScript knows the expected request body and response type without manual type annotations.

### Shared Types Across Packages

AccessHawk is a monorepo with web, worker, and shared packages. The shared package exports TypeScript types and Zod schemas used everywhere. This pattern works identically to how it would work in a Next.js monorepo - the framework doesn't limit your architecture.

<Callout type="success">

Vue's template type checking via Volar has improved a lot. With `<script setup lang="ts">`, you get comparable type safety to TSX. Vue's compiler also catches some template errors that JSX misses.

</Callout>

## Testing with Vitest: Fast, Modern, Integrated

Testing is non-negotiable for production software. AccessHawk uses Vitest, and it's been good.

### Why Vitest Over Jest

Vitest shares Vite's config and transformation pipeline, so there's no duplicate configuration. It's fast because it uses Vite's native ES module handling instead of transforming everything through Babel.

- <strong>Native ESM:</strong> No CommonJS transformation overhead
- <strong>Watch mode:</strong> Near-instant re-runs on file changes
- <strong>Jest-compatible API:</strong> Same `describe`, `it`, `expect` you
  already know
- <strong>Built-in coverage:</strong> No separate package needed
- <strong>TypeScript native:</strong> No ts-jest configuration required

### Testing in a Monorepo

AccessHawk's tests live alongside source files (`*.test.ts`), and Turbo orchestrates running them across packages. The shared package has unit tests for validators and schemas. The web package has tests for server utilities. Everything is typed, everything is fast.

```bash
# Run all tests in watch mode
pnpm test

# Single run across all packages
pnpm test:run

# Run specific test file
pnpm --filter @accesshawk/web test url-validator
```

## Real-Time Features: Where Nuxt Shines

AccessHawk streams scan progress to the client via Server-Sent Events. The architecture looks like this: user requests a scan, the API creates a BullMQ job and returns a job ID, the client opens an SSE connection, the worker publishes progress to Redis, and Nitro streams those events to the client.

Implementing this in Nuxt was straightforward. Nitro provides utilities for handling SSE streams with minimal boilerplate. The client uses a simple composable to manage the connection.

Vue's reactivity makes the UI updates trivial. When new data arrives via SSE, I update a reactive ref, and Vue automatically re-renders the affected components. No `setState` batching concerns, no worrying about stale callbacks in event handlers.

<Callout type="info">

Real-time features benefit from Vue's reactivity model. I don't have to think about "when does this update" because the answer is always "when the data changes."

</Callout>

## The Ecosystem Tradeoff

There's a tradeoff. React's ecosystem is larger. More UI libraries, more developers, bigger talent pool if you're hiring.

But ecosystem size isn't ecosystem quality. Vue has Headless UI, Radix Vue, PrimeVue for components. Pinia for state management (I prefer it to Redux). VeeValidate and FormKit for forms. Vitest and Vue Test Utils for testing. I haven't been blocked by a missing library yet.

Occasionally I find a library that's React-only. It's a minor friction. For AccessHawk, everything I needed either had a Vue equivalent or was framework-agnostic.

## Why React Is More Popular

React's lead is as much about timing and momentum as it is about technical merit.

### First-Mover Advantage

React launched in 2013, backed by Facebook. It arrived at the right moment - when jQuery was showing its age and developers wanted something better. Vue launched a year later without corporate backing. React got enterprise adoption first, which created jobs, which attracted developers, which created more adoption.

### Corporate Adoption Begets More Adoption

Large companies (Meta, Netflix, Airbnb) standardized on React early. Their engineering blogs praised React. Their open-source tools were React-first. This created a perception that React was the "serious" choice for "real" engineering.

### Job Market Momentum

More React jobs meant more developers learned React. More React developers meant companies could hire React developers. The cycle reinforces itself.

None of this means React is bad. It means popularity isn't a technical argument. PHP is more popular than Elixir. That doesn't make it better for building concurrent, fault-tolerant systems.

<Callout type="warn">

Choosing a framework because it's popular means choosing based on other people's priorities. Evaluate tools based on what you're building.

</Callout>

## When I Would Choose React

I'm not dogmatic. There are situations where React makes sense:

- <strong>Team composition:</strong> If your team knows React and doesn't know
  Vue, the learning curve cost may not be worth it
- <strong>Specific library needs:</strong> If you need a library that's
  React-only and central to your product
- <strong>React Native:</strong> If you're building a mobile app alongside web,
  React's ecosystem is stronger here
- <strong>Hiring at scale:</strong> If you need to hire 20 frontend developers
  quickly, the larger React talent pool helps
- <strong>Company standards:</strong> If your company standardizes on React,
  you use React

I've since rebuilt this portfolio in React on TanStack Start ([here's why](/blog/why-i-rebuilt-my-portfolio-with-tanstack-start)), so this isn't a one-framework-forever position. For my own SaaS products, where I control the stack and optimize for my own speed, Nuxt has usually been the faster choice.

## The Productivity Difference Is Real

After shipping AccessHawk with Nuxt, the clearest difference is where my time went. I spent it on features: Lighthouse integration, the SSE streaming pipeline, the report UI, auth, scheduled scans. The framework stayed out of my way.

That's my argument for Nuxt: for me, it has less friction. Auto-imports mean less boilerplate. Proxy-based reactivity means no closure bugs. I don't have to think as hard about the framework.

For a solo developer shipping a SaaS product, those small savings add up.

## Build With What Makes You Productive

AccessHawk is a production application with real users, real-time features, full TypeScript coverage, and a distributed architecture. I built it with Nuxt because Nuxt made me faster.

Framework debates are mostly noise. Both React and Vue can build good software. But they're not identical, and the differences matter when you're writing code every day.

If you've lost hours to stale closures, if hooks rules feel arbitrary, if the App Router feels over-engineered, give Nuxt a try on something real, not a todo app.

If you want to see a Nuxt application handling complex requirements, check out [AccessHawk](https://accesshawk.ai).

---

## Doppler Fixed My .env Syncing Problem Across Windows and Mac

Source: https://charlesjones.dev/blog/doppler-secrets-management-cross-platform-development
Published: 2026-01-06
Modified: 2026-10-22
Tags: Doppler, Security, DevOps, Environment Variables, Secrets Management, Cross-Platform, Developer Tools, Productivity

> I develop on a Windows desktop during the day and a MacBook in the evening. Keeping .env files in sync across three projects was tedious and error-prone. Doppler stores secrets in the cloud and injects them at runtime, so I stopped thinking about it.

You're working on your desktop during the day, add a new API key to your `.env` file, push your code changes, then switch to your laptop in the evening only to discover your app crashes because that environment variable doesn't exist on this machine.

This kept happening to me. I develop on a Windows desktop during the day and a MacBook in the evening. Multiple projects, each with their own secrets. Every new API key meant manually syncing `.env` files between machines. I kept forgetting.

[Doppler](https://doppler.com) fixed this. Secrets live in the cloud and get injected at runtime regardless of which machine I'm on. I deleted my local `.env` files and haven't thought about syncing since. Here's how I set it up.

## The Problem: Environment Variables Across Multiple Machines

If you develop on a single machine, environment variables are simple. Create a `.env` file, add it to `.gitignore`, done. But the moment you add a second machine or a teammate, things get complicated:

- <strong>Sync drift:</strong> Add a variable on one machine, forget to add it
  on another. Your app works in one place and crashes in another.
- <strong>Version confusion:</strong> Which machine has the current values? Did
  I update the API key on my desktop or my laptop?
- <strong>Insecure sharing:</strong> Copying secrets via Slack, email, or cloud
  storage creates security vulnerabilities.
- <strong>Onboarding friction:</strong> New team members need secrets shared
  manually - often insecurely.
- <strong>Cross-platform quirks:</strong> Windows and macOS handle environment
  variables differently, adding another layer of complexity.

I kept losing track of which values were current. I'd develop on my Windows desktop, add a secret, then switch to my MacBook in the evening and spend 10 minutes debugging before realizing I'd forgotten to sync my `.env` file.

<Callout type="warn">

This gets worse over time. I was maintaining `.env` files across three projects on two machines. That's six files to keep in sync, each with 10-20 variables.

</Callout>

## The Solution: Centralized Secrets with Doppler

[Doppler](https://doppler.com) is a secrets management platform that centralizes all your environment variables in the cloud. Instead of managing `.env` files, you store secrets in Doppler and inject them at runtime using their CLI. The key benefits:

- Secrets live in one place, not scattered across machines
- Run `doppler run -- npm run dev` and all secrets are available to your app
- Works identically on Windows, macOS, and Linux
- Separate dev, staging, and production configs
- Base configs that child configs can extend and override
- Free tier includes unlimited projects and secrets for up to 5 team members

I deleted all my local `.env` files, ran `doppler setup` in each project, and that was it. When I add a secret on my Windows desktop, it's available on my MacBook. No syncing.

## Setting Up Doppler: A Quick Start Guide

### 1. Install the Doppler CLI

Doppler provides platform-specific installation instructions. Here's how to get started:

```bash
# macOS (using Homebrew)
brew install gnupg
brew install dopplerhq/cli/doppler

# Windows (winget is recommended)
winget install doppler.doppler

# Linux (Debian/Ubuntu)
sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curl gnupg
curl -sLf --retry 3 --tlsv1.2 --proto "=https" 'https://packages.doppler.com/public/cli/gpg.DE2A7741A397C129.key' | sudo gpg --dearmor -o /usr/share/keyrings/doppler-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/doppler-archive-keyring.gpg] https://packages.doppler.com/public/cli/deb/debian any-version main" | sudo tee /etc/apt/sources.list.d/doppler-cli.list
sudo apt-get update && sudo apt-get install doppler
```

After installation, authenticate with your Doppler account:

```bash
# Login to Doppler (opens browser for authentication)
doppler login
```

### 2. Create a Project and Add Secrets

In the Doppler dashboard, create a project for your application. Doppler automatically creates three environments: <strong>dev</strong>, <strong>staging</strong>, and <strong>prod</strong>. Add your secrets to the dev config to get started:

```bash
# Example secrets for a typical web application
RESEND_API_KEY=re_xxxxxxxxxxxx
RESEND_TO_EMAIL=contact@yourapp.com
RESEND_FROM_EMAIL=noreply@yourapp.com
DATABASE_URL=mongodb://localhost:27017/myapp
REDIS_URL=redis://localhost:6379
```

### 3. Link Your Project Directory

In your project root, run the setup command to link the directory to your Doppler project:

```bash
# Navigate to your project
cd ~/projects/my-app

# Link to Doppler project (interactive prompt)
doppler setup

# Select your project and config when prompted
```

The `doppler setup` command stores your project and config selection in a global config file (`~/.doppler/.doppler.yaml`), mapping your project directory to the selected Doppler config. This means no configuration files are added to your project - it just works.

### 4. Update Your Package Scripts

The main change is wrapping your dev scripts with `doppler run --`. This injects all secrets as environment variables before your command executes:

```json
{
  "scripts": {
    "dev": "doppler run -- vite",
    "server": "doppler run -- node server.js",
    "dev:full": "doppler run -- concurrently \"node server.js\" \"vite\"",
    "build": "vite build",
    "start": "node server.js"
  }
}
```

<Callout type="success">

Notice that `build` and `start` don't use Doppler. Build scripts typically don't need secrets (they're baked in at deploy time), and production deployments should use your hosting platform's native environment variable support.

</Callout>

## Monorepo Configuration with Config Inheritance

For monorepos, Doppler's config inheritance is useful. You can create a base config that child configs extend, overriding only the variables that differ between packages.

For example, in a monorepo with web, worker, and cron packages, you might structure your configs like this:

- <strong>dev:</strong> Base development config with shared variables
  (DATABASE_URL, REDIS_URL, etc.)
- <strong>dev_web:</strong> Inherits from dev, overrides web-specific variables
- <strong>dev_worker:</strong> Inherits from dev, overrides worker-specific
  variables
- <strong>dev_cron:</strong> Inherits from dev, overrides cron-specific
  variables

Your package.json scripts then reference the appropriate config for each package:

```json
{
  "scripts": {
    "dev:web": "doppler run --config dev_web -- pnpm --filter @myapp/web dev",
    "dev:worker": "doppler run --config dev_worker -- pnpm --filter @myapp/worker dev",
    "dev:cron": "doppler run --config dev_cron -- pnpm --filter @myapp/cron dev",
    "dev": "concurrently \"pnpm dev:web\" \"pnpm dev:worker\""
  }
}
```

This approach keeps your configuration DRY - shared variables are defined once in the base config, while package-specific overrides are isolated to their respective configs.

## Real-World Benefits: My Experience Across Three Projects

I use Doppler in all my active projects: [AccessHawk](https://accesshawk.ai), [SPConnector](https://spconnector.com), this portfolio site, and others. Here's what changed:

### No More Sync Friction

I stopped thinking about environment variables. When I add an API key on my Windows desktop, it's there when I switch to my MacBook. No copying, no debugging mysterious crashes.

### Better Security

Before Doppler, I had `.env` files that could end up in git history, cloud backups, or get shared insecurely. Now secrets never touch the filesystem. They're injected at runtime from Doppler.

- No `.env` files to accidentally commit
- No secrets stored in plain text on disk
- AI coding assistants (Copilot, Claude Code, Cursor) can't read or leak your secrets because they're not in the codebase
- Rotate secrets without touching code

### Simpler Onboarding

My READMEs no longer need sections about copying `.env.example` files. Setup is two commands:

```bash
# One-time setup
doppler login
doppler setup

# Start developing
npm run dev
```

### Team-Ready (When Needed)

I work solo, but Doppler's team features mean I'm ready for collaboration without changing anything. New team members run `doppler login` and `doppler setup`. No insecure secret sharing.

## Pricing: Free for Solo Developers

As of January 2026 the free tier includes:

- Unlimited projects
- Unlimited secrets
- 5 team members
- Core integrations (CLI, SDKs, etc.)
- Community support

For solo developers, this is plenty. I've used the free tier across all my projects for months without hitting limits. Paid plans add SSO, audit logs, and priority support, but most individual developers won't need them. Doppler updates pricing periodically, so check [doppler.com/pricing](https://www.doppler.com/pricing) for the current tier.

## Migration Tips: From .env Files to Doppler

If you're ready to make the switch, here's the migration path:

1. <strong>Install and authenticate:</strong> Get the Doppler CLI installed on
   all your machines and run `doppler login`.
2. <strong>Create your project:</strong> In the Doppler dashboard, create a
   project matching your application name.
3. <strong>Import existing secrets:</strong> Copy values from your current
   `.env` file into Doppler's dev config.
4. <strong>Update package.json:</strong> Wrap your dev scripts with `doppler run
   --`.
5. <strong>Test thoroughly:</strong> Run your app and verify all environment
   variables are injected correctly.
6. <strong>Delete local .env:</strong> Once everything works, remove the `.env`
   file from your machine.
7. <strong>Update documentation:</strong> Modify your README to reference
   Doppler setup instead of `.env.example`.
8. <strong>Repeat on other machines:</strong> Run `doppler setup` on each
   machine where you develop.

The whole process takes about 15 minutes per project.

## Production Deployments

In production, the app reads secrets from my hosting platform's native environment variables, not from the Doppler CLI. Here's why:

- Your production build doesn't need the Doppler CLI installed
- Vercel, AWS, and other platforms have built-in secret management
- Fewer external dependencies in production is better for security

Doppler does offer production integrations if you want a unified experience. They support Kubernetes secrets, AWS Parameter Store, and direct integrations with many hosting platforms. I keep production values in Doppler too, and a small script copies each config into the host's environment variables, so the container never needs the Doppler CLI.

## Conclusion

Every time I had to stop and debug a missing environment variable, or manually sync a `.env` file between machines, I lost momentum on actual work.

Doppler fixed that. I develop on my Windows desktop during the day, switch to my MacBook in the evening, and secrets are there. I don't think about `.env` files anymore.

If you develop across multiple machines, or want better security for your secrets, Doppler is worth trying. The free tier covers most solo developers, and moving a project over takes about 15 minutes.

<Callout type="success">

Head to [doppler.com](https://doppler.com) to create a free account and follow the quick start guide above.

</Callout>

---

## Stop Supply Chain Attacks: Why Your Build Pipeline Should Use Locked Dependencies

Source: https://charlesjones.dev/blog/npm-supply-chain-attacks-ci-cd-locked-dependencies
Published: 2025-10-01
Modified: 2026-10-04
Tags: npm, pnpm, Security, CI/CD, Supply Chain Attacks, DevOps, Node.js, Build Pipeline

> Switching CI from npm install to npm ci, committing your lockfile, and adding a release-age cooldown closes the window npm worms rely on. Why each layer works, and how to set them up for npm, pnpm, Yarn, and Bun.

<Callout type="info">

First published in October 2025, after the first Shai-Hulud worm. The worm came back in November 2025 ("The Second Coming") and hit hundreds more packages, and release-age cooldowns have since spread beyond pnpm. The setup below reflects both. For a real-world test of these defenses, see [how my portfolio pulled zero of 84 malicious TanStack versions](/blog/mini-shai-hulud-tanstack-locked-dependencies) in May 2026.

</Callout>

A lot of build pipelines still run `npm install` to build frontend assets during deployment. In September 2025, attackers [compromised over 180 npm packages](https://thehackernews.com/2025/09/40-npm-packages-compromised-in-supply.html) with a self-spreading worm that injected credential-stealing code. A pipeline that installs whatever the registry serves at build time is exactly where that kind of attack lands.

Three changes close most of that window:

1. Commit your lockfile.
2. Install from it with `npm ci` (or your package manager's equivalent) everywhere builds run.
3. Add a release-age cooldown, so brand-new versions can't be installed at all, even when you update dependencies locally.

Here's why each one works, and how to set it up.

## What `npm install` Actually Does in CI

Take a typical `package.json`:

```json
{
  "dependencies": {
    "lodash": "^4.17.0",
    "axios": "~1.6.0",
    "express": "*"
  }
}
```

`npm install` treats the lockfile as a starting point, not a rule. With a lockfile that matches `package.json`, it installs the locked versions. But if the lockfile is missing (or in `.gitignore`), or `package.json` has changed, npm resolves fresh versions inside those ranges, installs them along with their transitive dependencies, and rewrites the lockfile.

That's the opening. If any package anywhere in your tree publishes a malicious version inside your ranges, the next build that resolves fresh pulls it in and runs its install scripts on your build server.

## The September 2025 Worm

The September 2025 attack showed how fast this moves. The malicious code ran TruffleHog, a credential scanner, on whatever machine installed it, then sent GitHub tokens, npm tokens, AWS keys, and other secrets to attacker-controlled webhooks. It could publish public copies of private repositories, and it spread by using stolen npm tokens to publish infected versions of other packages.

<Callout type="warn">

Build environments were a prime target. Any pipeline that resolved fresh versions during the attack window pulled the compromised code and ran it on a build server, which usually holds exactly the credentials the worm was looking for.

</Callout>

The pipelines that got hit had the same thing in common: they let the registry decide what to install at build time.

## Why `npm ci` Closes the Gap

`npm ci` (clean install) was built for automated environments, and it behaves differently in the ways that matter:

- **It installs exactly what the lockfile says.** Version ranges in `package.json` don't come into it. A malicious version published after your last lockfile update can't get in until someone deliberately updates the lockfile.
- **It fails when `package.json` and the lockfile disagree.** No silent re-resolution:

  ```bash
  npm ERR! `npm ci` can only install packages when your package.json and package-lock.json are in sync.
  ```

- **It verifies integrity.** The lockfile records a hash for every package, so a tampered tarball fails the install.
- **It starts clean.** It deletes `node_modules` first, so builds are reproducible. Skipping dependency resolution usually makes it faster than `npm install`, too.

## Setting It Up

**1. Generate and commit the lockfile.** If `package-lock.json` is in `.gitignore`, take it out, run `npm install` once locally, and commit the result:

```bash
git check-ignore package-lock.json   # prints the path if it's ignored
npm install
git add package-lock.json
git commit -m "chore: commit lockfile for reproducible builds"
```

**2. Replace `npm install` with `npm ci` everywhere builds run.** Check deployment scripts, CI pipeline definitions (GitHub Actions, Azure DevOps, Jenkins), Dockerfiles, and Makefiles.

**3. Add an audit step that fails the build on serious findings:**

```yaml
# Azure DevOps example
steps:
  - script: npm ci
    displayName: 'Install dependencies (locked)'

  - script: npm audit --omit=dev --audit-level=high
    displayName: 'Security audit (fail on high/critical)'

  - script: npm run build
    displayName: 'Build application'
```

**4. Update the README** so new developers know `npm ci` installs and `npm install` is only for deliberately changing dependencies.

Other package managers have the same switch:

- **pnpm:** `pnpm install --frozen-lockfile` (you can make it the default with `frozen-lockfile=true` in `.npmrc`)
- **Yarn 2+:** `yarn install --immutable`
- **Yarn 1:** `yarn install --frozen-lockfile`

## Updating Dependencies on Purpose

A locked pipeline means updates happen when you choose. That's also the honest answer to "won't this stop me from getting security fixes?" Fixes still come in, through a reviewed change instead of a surprise at build time:

1. Find what needs updating with `npm audit`, Dependabot, or Renovate.
2. Update on a branch with `npm install <package>@<version>` or `npm update`.
3. Review the lockfile diff in the pull request. Unexpected transitive changes are worth a second look.
4. Merge, and let CI build from the new lockfile.

## Release-Age Cooldowns

A lockfile protects builds, but it doesn't protect the moment you update. If you run `npm update` while a malicious version is live, it goes into your lockfile and from there into every build. A cooldown closes that gap: the package manager refuses to install any version published less than a set time ago.

Compromised versions are usually caught and pulled fast. The September 2025 worm's versions were identified within hours to days, and the hijacked UA-Parser-JS releases in 2021 were live for about four hours. A cooldown longer than that window means you never see the bad version.

pnpm added the setting (`minimumReleaseAge`) in version 10.16, and pnpm 11 turns it on by default at 1440 minutes (24 hours). On pnpm 11 it lives in `pnpm-workspace.yaml`; on pnpm 10.x, put `minimumReleaseAge=1440` in `.npmrc` instead:

```yaml
# pnpm-workspace.yaml
# Refuse versions published in the last 24 hours
minimumReleaseAge: 1440

# Internal packages can skip the wait
minimumReleaseAgeExclude:
  - '@mycompany/*'
```

The value is in minutes. Common choices are 1440 (one day), 4320 (three days), and 10080 (a week). When a version is too new, pnpm doesn't fail the install. It quietly picks the newest version that satisfies both your range and the age rule. If you'd rather get a hard failure when someone explicitly asks for a too-new version, pnpm 11 adds `minimumReleaseAgeStrict`.

The other package managers now have equivalents, with different names and units:

- **npm 11.10+:** `min-release-age` (days)
- **Yarn 4.10+:** `npmMinimalAgeGate` (minutes)
- **Bun 1.3+:** `minimumReleaseAge` (seconds)

The tradeoff is that a genuine security patch also waits out the cooldown. When you need one immediately, add that package to the exclude list, install the specific version, then remove the exclusion. Don't lower the global setting. The lockfile keeps CI on the version you chose either way.

A cooldown isn't a guarantee. In 2018, event-stream's malicious dependency went unnoticed for about two months, which no reasonable cooldown would have covered. It's one layer, and it works best alongside the others.

## How the Layers Fit Together

```text
Layer 1: Release-age cooldown (any install, including local updates)
├─ Brand-new versions can't be installed at all
└─ Malicious releases are usually pulled before the cooldown ends

Layer 2: Locked installs (CI and production builds)
├─ npm ci / pnpm install --frozen-lockfile
├─ Exact versions and integrity hashes from the lockfile
└─ Nothing changes without a reviewed lockfile update
```

A developer updates a package, the cooldown keeps out anything too fresh, the lockfile change goes through review, and CI installs exactly what was reviewed. Production only ever gets versions that cleared both checks.

If you're on pnpm, there's a third layer worth adding: an allow list for install scripts (`onlyBuiltDependencies`), so a malicious `postinstall` script never runs even if a bad version does get onto disk. The [Mini Shai-Hulud write-up](/blog/mini-shai-hulud-tanstack-locked-dependencies) shows all three working together.

## Start With the Lockfile

If you do one thing, commit your lockfile and switch CI to `npm ci`. It takes a few minutes per project, and it means your build pipeline stops deciding which versions to trust on its own. Then add the cooldown, and the window most npm worms depend on is closed on both sides.

---

## Cut LLM Context Usage by Up to 90%: Filter Azure DevOps MCP Tools with a Proxy Server

Source: https://charlesjones.dev/blog/azure-devops-mcp-proxy-filter-context-optimization
Published: 2025-09-29
Modified: 2026-08-10
Tags: MCP, Azure DevOps, Claude, Proxy Server, Context Optimization, Node.js, Developer Tools

> The Azure DevOps MCP server exposes 70 tools consuming 55,125 tokens of Claude's context window. Learn how to build a filtering proxy server that reduces this to just the tools you need, reclaiming up to 90% of your context for actual work.

<Callout type="warn">

**Outdated as of July 2026.** This post solves a problem Claude Code no longer has. Claude Code now defers MCP tool schemas by default: only tool names load at session start, and full schemas are pulled in on demand through Tool Search. The 55k-token upfront cost this proxy was built to avoid is gone on current builds. The proxy pattern is still useful for MCP clients that load every schema upfront, or for hard-limiting which tools an agent can call at all, but if you use Claude Code you do not need it for context savings.

On top of that, the MCP specification itself moved: the 2026-07-28 release (July 2026) reworked MCP into a stateless protocol and deprecated several features from this era of servers. The proxy code below targets the pre-2026-07-28 protocol and SDK. If you build something like this today, start from the [current MCP specification](https://modelcontextprotocol.io/specification/2026-07-28).

</Callout>

[Claude Sonnet](https://www.anthropic.com/claude/sonnet) and many other LLMs ship with context windows in the 200k–1M token range, but that space fills up faster than you'd think when working with Model Context Protocol (MCP) servers. The official [Azure DevOps MCP server](https://github.com/microsoft/azure-devops-mcp) is a perfect example of this problem: it exposes 70 tools covering builds, releases, repositories, wikis, test plans, and work items - consuming 55,125 tokens just to describe available functionality. The token count was measured against the Azure DevOps MCP server in late 2025; specific numbers will drift as Microsoft adds or removes tools, but the ratio of "tools you don't use" to "tools you actually call" stays roughly the same.

On a recent project planning session, I wanted to automate the creation of features, user stories, and tasks using this MCP server, and quickly realized I was burning more than a quarter of a 200k context window on tools I'd never use for this task (still meaningful even on a 1M window — that's room for the equivalent of a mid-sized codebase you're not planning to touch). I discovered this by running the `/context` command in Claude Code before even starting a conversation. It shows a visual breakdown of context usage, and the graph revealed just how much the Azure DevOps MCP server was consuming before I'd even added my codebase or documentation. This left less room for the actual work.

This guide shows you how I built a quick MCP proxy server using Node that filters the Azure DevOps server down to only the tools you need, cutting context consumption by up to 90% while maintaining full functionality.

## The Context Window Problem

LLMs have finite context windows, and every token counts. Here's what the unfiltered Azure DevOps MCP server costs:

```text
Total Tools: 70
Total Context Tokens: 55,125

Breakdown by Category:
├─ Core (3 tools): 2,098 tokens
├─ Work Iterations (3 tools): 2,259 tokens
├─ Work Items (19 tools): 14,377 tokens
├─ Build Pipeline (9 tools): 7,957 tokens
├─ Release Pipeline (2 tools): 2,400 tokens
├─ Repositories/PRs (18 tools): 13,767 tokens
├─ Wiki (5 tools): 3,589 tokens
├─ Test Plans (6 tools): 4,367 tokens
├─ Search (3 tools): 2,412 tokens
└─ Advanced Security (2 tools): 1,899 tokens
```

By filtering to just the core project tools, work item tracking, and search functionality, you can reduce this to approximately 25 tools consuming roughly 19,000 tokens - a 66% savings in context usage.

## Architecture Overview

The proxy server architecture is straightforward:

```text
Claude Code
    ↓
MCP Proxy Server (filters tools)
    ↓
Azure DevOps MCP Server (full tool set)
    ↓
Azure DevOps API
```

The proxy acts as a transparent filter:

1. Connects to the upstream Azure DevOps MCP server
2. Retrieves the full tool list
3. Filters to only desired tools (e.g., core*\*, wit*\_, search\_\_)
4. Presents filtered tools to Claude
5. Proxies tool execution requests through to upstream server

## Implementation: Building the Proxy Server

### Project Setup

Create a new Node.js project with the MCP SDK:

```bash
mkdir azure-devops-wit-proxy
cd azure-devops-wit-proxy
npm init -y
npm install @modelcontextprotocol/sdk
```

Update package.json to enable ES modules:

```json
{
  "name": "azure-devops-wit-proxy",
  "version": "1.0.0",
  "type": "module",
  "dependencies": {
    "@modelcontextprotocol/sdk": "^1"
  }
}
```

### Core Proxy Implementation

Create ado-wit-proxy.mjs:

```javascript
import { Server } from '@modelcontextprotocol/sdk/server/index.js'
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js'
import { Client } from '@modelcontextprotocol/sdk/client/index.js'
import { StdioClientTransport } from '@modelcontextprotocol/sdk/client/stdio.js'
import {
  ListToolsRequestSchema,
  CallToolRequestSchema,
} from '@modelcontextprotocol/sdk/types.js'

// Configuration
const AZURE_DEVOPS_ORG = 'YOUR_ORG' // Replace with your organization name
const TOOL_PREFIX_FILTER = ['core_', 'wit_', 'search_']

// Create proxy server
const server = new Server(
  { name: 'azure-devops-wit-proxy', version: '1.0.0' },
  { capabilities: { tools: {} } },
)

// Connect to actual Azure DevOps MCP server
const client = new Client(
  { name: 'proxy-client', version: '1.0.0' },
  { capabilities: {} },
)

let filteredTools = []

// List tools - filter to only WIT tools
server.setRequestHandler(ListToolsRequestSchema, async () => {
  return { tools: filteredTools }
})

// Call tool - proxy through to actual server
server.setRequestHandler(CallToolRequestSchema, async (request) => {
  return await client.callTool(request.params)
})

async function main() {
  // Connect to the real Azure DevOps server
  const isWindows = process.platform === 'win32'

  let command, args
  if (isWindows) {
    command = 'cmd.exe'
    args = ['/c', 'npx', '-y', '@azure-devops/mcp', AZURE_DEVOPS_ORG]
  } else {
    command = 'npx'
    args = ['-y', '@azure-devops/mcp', AZURE_DEVOPS_ORG]
  }

  const transport = new StdioClientTransport({
    command: command,
    args: args,
    env: process.env,
  })

  await client.connect(transport)

  // Get all tools and filter
  const result = await client.listTools()
  filteredTools = result.tools.filter((tool) =>
    TOOL_PREFIX_FILTER.some((prefix) => tool.name.startsWith(prefix)),
  )

  console.error(
    `Filtered to ${filteredTools.length} tools of ${result.tools.length} total tools.`,
  )

  // Start proxy server
  const serverTransport = new StdioServerTransport()
  await server.connect(serverTransport)
}

main().catch(console.error)
```

<Callout type="success">

The proxy uses the MCP SDK's Client/Server pattern. The Client connects to the upstream Azure DevOps server, while the Server exposes the filtered interface to Claude Code.

</Callout>

### Configuration for Claude Code

Update your .claude.json to use the proxy:

```json
{
  "mcpServers": {
    "azure-devops-wit": {
      "command": "node",
      "args": ["C:/path/to/azure-devops-wit-proxy/ado-wit-proxy.mjs"]
    }
  }
}
```

The proxy automatically forwards environment variables to the upstream server, so authentication works seamlessly.

## Advanced Filtering Patterns

### Multiple Filter Categories

You can extend the proxy to support multiple tool categories:

```javascript
const TOOL_FILTERS = {
  wit: ['core_', 'wit_', 'search_'],
  repos: ['core_', 'repo_'],
  builds: ['core_', 'build_'],
}

// Get filter from environment variable or command line arg
const filterType = process.env.MCP_FILTER_TYPE || 'wit'
const TOOL_PREFIX_FILTER = TOOL_FILTERS[filterType]

filteredTools = result.tools.filter((tool) =>
  TOOL_PREFIX_FILTER.some((prefix) => tool.name.startsWith(prefix)),
)
```

Then configure which categories to enable:

```json
{
  "mcpServers": {
    "azure-devops": {
      "command": "node",
      "args": ["C:/path/to/ado-wit-proxy.mjs"],
      "env": {
        "MCP_FILTER_TYPE": "wit"
      }
    }
  }
}
```

### Tool Allowlist Configuration

For fine-grained control, implement an allowlist:

```javascript
const ALLOWED_TOOLS = [
  'core_get_projects',
  'core_get_teams',
  'wit_my_work_items',
  'wit_get_work_item',
  'wit_update_work_item',
  'wit_create_work_item',
  'search_work_items',
]

filteredTools = result.tools.filter((tool) => ALLOWED_TOOLS.includes(tool.name))
```

This reduces to just 7 essential tools, further minimizing context usage.

## Measuring the Impact

Let's compare context usage before and after implementing the proxy:

### Before (Full Azure DevOps MCP Server)

```text
Available Tools: 70
Context Tokens Used: 55,125 (~28% of a 200k window, ~5.5% of a 1M window)
```

### After (Filtered Core + WIT + Search Tools)

```text
Available Tools: 25
Context Tokens Used: 18,987 (~9.5% of a 200k window, ~1.9% of a 1M window)

Tokens Reclaimed: 36,138 — measurable on any context size, but most
impactful on smaller windows where you'd otherwise be paying overhead
on every turn.
```

## Real-World Use Cases

### Scenario 1: Sprint Planning Focus

A team using Azure DevOps primarily for sprint planning only needs:

```javascript
const SPRINT_TOOLS = [
  'core_list_projects',
  'core_list_project_teams',
  'work_list_team_iterations',
  'wit_my_work_items',
  'wit_get_work_items_for_iteration',
  'wit_update_work_item',
  'wit_create_work_item',
]
```

Context Savings: 50,263 tokens (91% reduction) - Uses only 4,862 tokens

### Scenario 2: Code Review Workflow

A team focused on pull request reviews needs:

```javascript
const CODE_REVIEW_TOOLS = [
  'core_list_projects',
  'repo_list_repos_by_project',
  'repo_list_pull_requests_by_repo',
  'repo_get_pull_request_by_id',
  'repo_list_pull_request_threads',
  'repo_list_pull_request_thread_comments',
  'repo_create_pull_request_thread',
  'repo_reply_to_comment',
  'repo_resolve_comment',
]
```

Context Savings: 48,282 tokens (88% reduction) - Uses only 6,843 tokens

### Scenario 3: Build Pipeline Management

A DevOps engineer managing builds needs:

```javascript
const BUILD_TOOLS = [
  'core_list_projects',
  'pipelines_get_build_definitions',
  'pipelines_get_builds',
  'pipelines_get_build_status',
  'pipelines_get_build_log',
  'pipelines_run_pipeline',
  'pipelines_update_build_stage',
]
```

Context Savings: 49,722 tokens (90% reduction) - Uses only 5,403 tokens

## Troubleshooting Common Issues

### Proxy Doesn't Start

Symptom: No output when running the proxy script

Solutions:

- Verify Node.js version (requires v20+, same as the Azure DevOps MCP server)
- Check package.json has "type": "module"
- Ensure MCP SDK is installed correctly
- Try running with node --trace-warnings ado-wit-proxy.mjs

### Tools Not Filtering

Symptom: Claude still sees all 70 tools

Solutions:

- Verify filter prefix matches tool names exactly
- Check console error output for filter results
- Add debug logging: console.error('Filtering:', tool.name)

### Authentication Failures

Symptom: Tools execute but return authorization errors

Solutions:

- Verify you have [authenticated using Azure CLI](https://github.com/microsoft/azure-devops-mcp/blob/main/docs/TROUBLESHOOTING.md)
- Ensure organization name is correct

## Reclaim Your Context Window

MCP tool bloat is a real problem when working with comprehensive servers like Azure DevOps.

By implementing a simple proxy like the one in this guide, you can reclaim thousands of tokens of context window space for what matters: your code, documentation, and productive conversations with your LLM of choice.

The pattern is universal - apply it to any MCP server that exposes more tools than you need, and optimize your AI development workflow for maximum efficiency.

---

## Make Sitecore 10.3 → 10.4 Upgrades Easier with Central Package Management

Source: https://charlesjones.dev/blog/sitecore-central-package-management-upgrade
Published: 2025-09-16
Modified: 2026-10-04
Tags: Sitecore, NuGet, Central Package Management, Upgrade, .NET, DevOps, Package Management, Sitecore 10.4

> Move every NuGet version in a Sitecore solution into one Directory.Packages.props file, and a 10.3 to 10.4.1 upgrade becomes a find-and-replace in one file. The setup, the project-file changes, the Sitecore feed warning to expect, and the errors you'll hit along the way.

Most of the work in a Sitecore 10.3 to 10.4.1 upgrade is version numbers. A Helix-style solution has dozens of projects, each referencing some mix of `Sitecore.Kernel`, `Sitecore.Mvc`, and the `Sitecore.XA.*` packages, and every one of those references carries its own version. Some live in `Version` attributes. Others hide in the `Update` pattern Sitecore projects tend to use. Miss one and the solution builds against two Sitecore versions at once, which shows up later as a binding error at runtime.

NuGet's Central Package Management (CPM) moves every version into a single `Directory.Packages.props` file at the solution root. Projects reference packages by name only. Once it's in place, the upgrade is a find-and-replace in one file.

Here's the setup, what changes in each project file, and what the upgrade looks like afterward.

## What CPM Needs

CPM works with any project that uses `<PackageReference>`, including older non-SDK-style `.csproj` files on .NET Framework. Projects still on `packages.config` need migrating to `PackageReference` first.

## Step 1: Create Directory.Packages.props

Create the file at the solution root, either by hand or with `dotnet new packagesprops`. It turns CPM on and declares every package version the solution uses:

```markup
<Project>
  <PropertyGroup>
    <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
  </PropertyGroup>

  <ItemGroup Label="Microsoft">
    <PackageVersion Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" Version="4.1.0" />
  </ItemGroup>

  <ItemGroup Label="Sitecore Core - keep aligned with SXA">
    <PackageVersion Include="Sitecore.Kernel" Version="10.4.1" />
    <PackageVersion Include="Sitecore.Mvc" Version="10.4.1" />
  </ItemGroup>

  <ItemGroup Label="Sitecore SXA - must match Core">
    <PackageVersion Include="Sitecore.XA.Foundation.IOC" Version="10.4.1" />
    <PackageVersion Include="Sitecore.XA.Foundation.MarkupDecorator" Version="10.4.1" />
    <PackageVersion Include="Sitecore.XA.Foundation.Multisite" Version="10.4.1" />
    <PackageVersion Include="Sitecore.XA.Foundation.Mvc" Version="10.4.1" />
    <PackageVersion Include="Sitecore.XA.Foundation.RenderingVariants" Version="10.4.1" />
    <PackageVersion Include="Sitecore.XA.Foundation.Variants.Abstractions" Version="10.4.1" />
  </ItemGroup>
</Project>
```

The `Label` attributes are optional, but they turn a long file into something you can scan. Group by vendor, and put the alignment rule in the label so the next person sees it before they bump one group without the other.

## Step 2: Strip Versions From Every Project File

This is the tedious part. Every `PackageReference` loses its `Version`, and the `Update` entries go away entirely:

```markup
<!-- BEFORE -->
<ItemGroup>
  <PackageReference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" Version="4.1.0" />
  <PackageReference Include="Sitecore.Kernel" />
  <PackageReference Include="Sitecore.Mvc" />
  <PackageReference Include="Sitecore.XA.Foundation.Mvc" Version="10.4.1" />
</ItemGroup>
<ItemGroup>
  <!-- The Update pattern common in Sitecore projects -->
  <PackageReference Update="Sitecore.Kernel" Version="10.4.1" />
  <PackageReference Update="Sitecore.Mvc" Version="10.4.1" />
</ItemGroup>

<!-- AFTER -->
<ItemGroup>
  <PackageReference Include="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" />
  <PackageReference Include="Sitecore.Kernel" />
  <PackageReference Include="Sitecore.Mvc" />
  <PackageReference Include="Sitecore.XA.Foundation.Mvc" />
</ItemGroup>
```

In each project:

- Remove every `Version` attribute from `PackageReference` elements.
- Delete the `PackageReference Update` entries.
- Add an `Include` reference for any package that only appeared as an `Update`.
- Keep other metadata such as `PrivateAssets` and `IncludeAssets`.

On a large solution, script this. [CentralisedPackageConverter](https://github.com/Webreaper/CentralisedPackageConverter) does the conversion automatically, and its output is a good starting point to review by hand.

## Step 3: Restore and Build

```shell
dotnet clean
dotnet restore
dotnet build
```

Anything you missed shows up here as a restore error, which is the point. A missed version under CPM fails loudly at restore time instead of quietly at runtime.

### Expect NU1507 on a Sitecore solution

Sitecore packages come from Sitecore's own feed, so a Sitecore solution has at least two package sources. CPM logs warning NU1507 whenever more than one source is configured, and if you treat warnings as errors, that breaks the build. The fix is package source mapping in `nuget.config`, which tells NuGet which feed each package comes from:

```markup
<!-- nuget.config -->
<configuration>
  <packageSources>
    <clear />
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
    <add key="Sitecore" value="https://nuget.sitecore.com/resources/v3/index.json" />
  </packageSources>
  <packageSourceMapping>
    <packageSource key="nuget.org">
      <package pattern="*" />
    </packageSource>
    <packageSource key="Sitecore">
      <package pattern="Sitecore.*" />
    </packageSource>
  </packageSourceMapping>
</configuration>
```

The more specific pattern wins, so `Sitecore.*` packages resolve from Sitecore's feed and everything else from nuget.org. It's also a small supply-chain win: a package named like a Sitecore package can't be pulled from the wrong feed.

## The Upgrade, Afterward

Without CPM, the 10.3 to 10.4.1 upgrade means opening every project file, finding each `10.3.0` (in `Version` attributes and `Update` entries), replacing it, and then chasing the restore errors from the ones you missed.

With CPM:

1. Open `Directory.Packages.props`.
2. Replace `10.3.0` with `10.4.1`.
3. Restore, build, and run your tests.

The pull request for the version bump is a one-file diff. Reviewers can see every version that moved in one place, and they can see that the Sitecore Core and SXA groups moved together. Security patches for third-party packages work the same way: change the version once, and every project picks it up.

## Patterns Worth Adding

**Keep all Sitecore packages on one version.** Upgrade every `Sitecore.*` and `Sitecore.XA.*` package together. Mixed versions cause binding issues that are hard to trace back to their cause, and with CPM they're easy to avoid because the whole set sits in two adjacent groups.

**Use `GlobalPackageReference` for tools every project needs.** Analyzers and versioning packages can be declared once in `Directory.Packages.props` and NuGet applies them to every project as a development-only dependency. This needs NuGet 6.4 or later (Visual Studio 2022 17.4+).

```markup
<ItemGroup Label="Global - applied to every project">
  <GlobalPackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0" />
</ItemGroup>
```

**Comment every deliberate pin.** Some packages have to stay behind for compatibility. Say why in the file, so nobody "fixes" it during the next upgrade:

```markup
<ItemGroup Label="Pinned for compatibility">
  <!-- 3.x breaks the custom serializer in Foundation.Indexing. Revisit after the 10.4 upgrade. -->
  <PackageVersion Include="LegacyLibrary" Version="2.1.0" />
</ItemGroup>
```

**Override a single project when you have to.** A project that genuinely needs a different version can use `VersionOverride` on its `PackageReference`. Use it sparingly, since every override is a version that isn't in the central file.

## Troubleshooting

**NU1008:** "Projects that use central package version management should not define the version on the PackageReference items." A project still has a `Version` attribute. Remove it and make sure the package has a `PackageVersion` entry.

**Restore can't find a version for a package.** The package has no `PackageVersion` entry in `Directory.Packages.props`. Add one, or check for a typo between the props file and the project file.

**A package disappeared after the conversion.** It was only referenced through an `Update` entry. Add an `Include` reference to the projects that need it.

**Stale results after fixing everything.** Clear the local caches with `dotnet nuget locals all --clear` and restore again.

## Do It Before the Next Upgrade

The conversion takes some time on a big solution, and most of it is the project-file pass in Step 2. After that, every later upgrade and every security patch is a change to one file. If a Sitecore upgrade is on your roadmap, do the CPM conversion first, as its own pull request, so the upgrade itself is just the version bump.

For the full reference, Microsoft's [Central Package Management documentation](https://learn.microsoft.com/en-us/nuget/consume-packages/central-package-management) covers transitive pinning, per-framework versions, and the rest of the options.

---

## Building MCP Tools on Umbraco 13 and N8N AI Chat Workflows

Source: https://charlesjones.dev/blog/mcp-tools-umbraco-13-n8n-ai-workflow
Published: 2025-09-11
Modified: 2026-10-04
Tags: MCP, Umbraco 13, N8N, AI Workflows, Multi-Agent Systems, ElasticSearch, .NET 8, Healthcare Tech, Model Context Protocol

> How I built an AI assistant over a healthcare technology vendor catalog with custom MCP tools inside an Umbraco 13 site, ElasticSearch instead of a vector database, and one n8n agent instead of several. Tool design, the system prompt, and why the multi-agent version lost.

The brief sounded simple: put an AI assistant on an existing Umbraco 13 site that catalogs healthcare technology vendors, and have it answer questions from that catalog. Thousands of vendor records, organized into categories, already indexed in ElasticSearch for the site's own search.

The constraint that shaped everything was the data. The assistant had to answer from the catalog and nothing else, with no general knowledge about vendors filling the gaps, and two people asking the same question had to get the same answer. That ruled out the quick version (send the question to a model with a big prompt). It also pushed me away from the heavy version. A RAG pipeline with a vector database would have meant a second copy of the data, an embedding job to keep in sync, and new infrastructure for a site that already had a good search index.

What I built instead: custom Model Context Protocol (MCP) tools running inside the Umbraco app, sitting on the existing ElasticSearch index, called by a single n8n agent. This post covers how the tools are put together, what went into the system prompt, and why the multi-agent design I started with lost.

<Callout type="warn">

**Heads up: this post predates the MCP 2026-07-28 specification.** That release (July 2026) reworked MCP into a stateless request/response protocol. The initialize handshake and the session management this post's transport configuration depends on are gone, and several protocol features were deprecated. The architecture patterns here (single-agent workflow, ElasticSearch-first filtering, stateless tool design) still hold up, but treat the MCP wiring and SDK setup code as a snapshot of the older protocol. Read the [current MCP specification](https://modelcontextprotocol.io/specification/2026-07-28) and the [release announcement](https://blog.modelcontextprotocol.io/posts/2026-07-28/) before starting a new build.

</Callout>

## What the Assistant Had to Do

The business defined four use cases, and every design decision traced back to them:

- **Discovery.** A user describes a need in plain language, and the assistant finds the matching categories and vendors.
- **Lookup.** Questions about a specific vendor: what it does, what it works with, and a link to its profile.
- **Recommendation.** A ranked shortlist for a need, with the reasoning shown.
- **Comparison.** One vendor against its closest competitors, attribute by attribute.

## The MCP Server Lives Inside the Umbraco App

The MCP server is a .NET 8 project that plugs into the existing Umbraco 13 solution, so the tools get the same services, configuration, and search client the website already uses. The SDK was still in preview at the time:

```markup
<!-- Key MCP dependencies. The ModelContextProtocol C# SDK was pre-1.0 when
     this was built and shipped breaking changes between previews. Check its
     NuGet page for the current version before starting a new project. -->
<PackageReference Include="ModelContextProtocol.AspNetCore" Version="0.3.0-preview.3" />
<PackageReference Include="Umbraco.Cms.Core" Version="13.*" />
<PackageReference Include="System.Text.Json" Version="9.*" />
```

Registration sits behind a config flag, so the server can be switched on per environment:

```csharp
public static IServiceCollection AddMcpServices(
    this IServiceCollection services,
    IConfiguration configuration,
    bool enableMcp = false)
{
    // Register MCP configuration from appsettings
    services.Configure<McpConfiguration>(/* configuration section */);

    if (enableMcp)
    {
        // Configure MCP server with timeouts and HTTP transport
        services.AddMcpServer(options => {
            // Set initialization timeout, request scoping
            // Configure server info and version
        })
        .WithHttpTransport(transportOptions => {
            // Set idle timeout and session management
        })
        .WithToolsFromAssembly(); // Auto-discover tools
    }

    // Register domain-specific services
    services.AddScoped<IMcpServerService, McpServerService>();
    services.AddScoped<IMcpUtilityService, McpUtilityService>();

    return services;
}
```

`WithToolsFromAssembly()` picks up every method marked as an MCP tool, so adding a tool means adding a class. The `/mcp` endpoint sits behind a small middleware that checks an API key header before a request reaches any tool:

```csharp
public class McpAuthenticationMiddleware
{
    public async Task InvokeAsync(HttpContext context, RequestDelegate next)
    {
        if (context.Request.Path.StartsWithSegments("/mcp")
            && !await ValidateApiKey(context))
        {
            context.Response.StatusCode = 401;
            return;
        }

        await next(context);
    }

    // ValidateApiKey: read the key from a request header, compare it to the
    // configured keys, and log the attempt.
}
```

## Three Tools, Built on Search Instead of Vectors

Each tool is a static method marked with `[McpServerTool]`, with a `[Description]` on the method and on every parameter. Those descriptions are what the agent reads to decide which tool to call, so they get the same care as the code. Because the methods are static, they resolve services from a fresh scope on each call instead of holding state, which keeps them safe to call concurrently.

### Category search

ElasticSearch does the first pass because it's fast and indexed: text match, status filters, pagination. Business rules that don't translate into a search query run afterward in C#. Then the result is reshaped before it goes back to the agent: consistent field names, real types instead of strings, and the URLs a user would click.

```csharp
// Trimmed skeleton of the category search tool
[McpServerTool]
[Description("Search and filter categories based on various criteria")]
public static async Task<string> SearchCategories(
    [Description("Text search across names and descriptions")] string? searchTerm,
    [Description("Filter by status, etc.")] string? filters,
    [Description("Page size, 1-100")] int limit,
    [Description("Results to skip")] int offset)
{
    using var scope = Services.CreateScope();
    var searchService = scope.ServiceProvider.GetRequiredService<ISearchService>();

    limit = Math.Clamp(limit, 1, 100);
    offset = Math.Max(0, offset);
    searchTerm = NormalizeInput(searchTerm); // n8n sends "null" as a string

    // First pass in ElasticSearch: indexed text match, filters, paging
    var searchResults = await searchService.ExecuteSearch(
        BuildSearchRequest(searchTerm, filters, limit, offset));

    // Second pass in C#: business rules that don't fit a search query,
    // then reshape each hit into the fields the agent needs
    var response = ApplyBusinessFilters(searchResults, filters)
        .Select(ToAgentShape);

    return JsonSerializer.Serialize(response, JsonOptions);
}
```

### Vendor comparison

The comparison tool finds a vendor's closest competitors by scoring candidates on four weighted factors: category overlap (40%), capability similarity (30%), market status (15%), and overall market presence (15%). It pulls up to 500 vendors from ElasticSearch, scores them, and keeps the ones above a threshold.

The part I'd repeat on any project: a model doesn't write the comparison. The tool builds the comparison matrix and the insights from templates, and the agent's job is to present them. The numbers come out the same every time, and the model never gets a chance to invent a feature a vendor doesn't have.

### Matching a plain-language question

The third tool maps a free-text question to categories without embeddings. It runs one weighted ElasticSearch query that blends direct keyword matching (40%), ElasticSearch's more-like-this similarity (30%), capability matching (20%), and market context (10%). Each match comes back with a confidence score and the reasons it matched, and a minimum score drops the weak ones so the agent sees fewer, better candidates.

For a catalog with well-written descriptions, that got close enough to semantic search without a second data store to keep in sync.

## Handling What n8n Actually Sends

Two details mattered in practice:

- n8n sometimes passes the literal string `"null"` for an empty optional parameter. Every tool turns `"null"`, empty, and whitespace-only values into a real null before using them.
- Agents send out-of-range values. Page sizes get clamped to 1 through 100, offsets can't go below zero, and search terms are capped at 500 characters.

When something fails, the tool returns structured JSON instead of throwing: what went wrong, a suggestion the agent can act on, and a retry hint. That gives the agent something to try next instead of a dead end.

```csharp
public static async Task<string> SearchVendors(/* parameters */)
{
    var stopwatch = Stopwatch.StartNew();

    try
    {
        return await ExecuteSearch(searchRequest);
    }
    catch (ElasticsearchClientException)
    {
        return CreateErrorResponse("Search service error", "Try reducing filters", retryAfterSeconds: 30);
    }
    catch (TimeoutException)
    {
        return CreateErrorResponse("Search timeout", "Try more specific terms", retryAfterSeconds: 60);
    }
    finally
    {
        LogPerformanceMetrics(stopwatch.Elapsed);
    }
}
```

## One Agent Beat Four

I started with a multi-agent design: one specialized agent per use case, with a router in front. After building and testing both versions, the single agent won on every measure I cared about:

- **Context.** Every handoff between agents dropped some of the conversation's context.
- **Cost.** Delegation burned tokens on agents briefing other agents.
- **Debugging.** A wrong answer meant tracing it across several agents instead of one.
- **Speed.** One agent calls the tools directly and answers right away.

What made one agent workable was the system prompt. It carries all four use cases, and it's strict about where answers can come from. Here's its structure with the domain details stripped out:

```markdown
# Role
Assistant for [domain]. Answer only from data the tools return.

# Rules
1. Data sources: tool output only. If the tools don't return it, say so.
2. Output format: one link format and one response structure for every answer.
3. Consistency: the same question gets the same answer.
4. Interaction limits: a fixed number of clarifying questions per conversation.
5. Quality checks: specific validation rules for each use case.

# Use cases
## Discovery
Triggers: the user describes a need or problem.
Process: match to categories, then rank vendors by relevance.
Output: structured results with the reasoning shown.

## Lookup, Recommendation, Comparison
Same trigger / process / output shape for each.
```

On the n8n side the setup is small: custom session keys so each conversation keeps its own context, a 30-message memory window to keep token use in check, and the MCP tools connected straight to the AI Agent node, so there's no custom HTTP plumbing between the agent and the server.

### When splitting agents does pay off

There's one case where I'd still reach for more than one agent: cost. n8n's AI Agent tool lets you nest one agent inside another as a tool, all within a single workflow. That makes it easy to run a premium-tier model on the parent agent for analysis and synthesis, and hand routine sub-tasks (pulling data, calling APIs, simple summaries) to a fast-tier model that costs a fraction as much per token.

That trade works when the sub-tasks are independent and their output is easy to check, and you should check what the cheaper model returns before anything acts on it. For this assistant it didn't pay. Every use case needed the full conversation context, and delegation overhead was one of the reasons the multi-agent version cost more.

## Performance

ElasticSearch requests ask only for the fields a tool needs and apply filters in the query instead of afterward wherever possible:

```csharp
var searchRequest = new VendorSearchRequest
{
    Index = elasticConfiguration.Value.VendorsIndex,
    SearchPhrase = searchTerm,
    Skip = offset,
    Take = limit,
    // Only the fields the tool returns
    SourceIncludes = new[] { "name", "description", "status", "categories", "imageUrl" },
    // Filter at query time, not after
    Filters = new VendorFilters
    {
        Statuses = statusList,
        CategoryIds = categoryGuids
    }
};
```

Category lookups go through a 15-minute in-memory cache:

```csharp
public async Task<CategoryModel?> GetCategoryByKeyAsync(Guid categoryKey)
{
    var cacheKey = $"category_{categoryKey}";

    if (_cache.TryGetValue(cacheKey, out CategoryModel? cachedCategory))
        return cachedCategory;

    var category = await FetchCategoryFromElasticSearch(categoryKey);

    if (category != null)
        _cache.Set(cacheKey, category, TimeSpan.FromMinutes(15));

    return category;
}
```

Complex questions came back in about 2 to 3 seconds end to end.

## What I'd Keep, and What I'd Change

The patterns held up:

- Start with one tool and one agent, and add more only when a real question needs it.
- Keep each tool to one job. The search tool searches, and the comparison tool compares.
- Return structured data with consistent field names, plus the metadata (confidence scores, match reasons) the agent needs to explain its answer.
- Let search and templates do the work that has to be repeatable, and let the model do the talking.

The strict data rules did their job. Answers stayed grounded in the catalog instead of the model's general knowledge, and the same question got the same answer. Building on the existing search index also made it faster to ship than a custom RAG pipeline, with one set of logs to read when something went wrong.

What I'd change is the protocol layer. The MCP wiring in this post targets the spec from before July 2026, so a new build should start from the current spec and SDK. The tool design should carry over as is.

---

## OWASP Top 10 Security Priorities for Vue.js Developers

Source: https://charlesjones.dev/blog/owasp-top-10-vuejs-security
Published: 2025-07-27
Modified: 2026-10-04
Tags: Vue.js, Security, OWASP, JavaScript, Frontend Security, Web Security

> The OWASP Top 10:2025 mapped to Vue 3: what each risk looks like in a Vue app, the Composition API patterns that help, and the parts only your backend can fix. Covers the new supply chain and exceptional-conditions categories.

The OWASP Top 10 is a list of web application risks, and most of it is about servers. That makes it an awkward fit for a frontend framework. The useful way to read it as a Vue developer is to sort each risk into one of three buckets: things you fix in your Vue code, things you can only reduce from the browser, and things that live entirely on your backend.

This guide follows the 2025 edition of the list. Each section covers what the risk looks like in a Vue 3 app, the Composition API patterns that help, and where the real control has to live. The 2025 edition reshuffled the order, folded server-side request forgery (SSRF) into access control, and added two categories that matter more to frontend teams than the old ones did: software supply chain failures and the handling of exceptional conditions.

## A01: Broken Access Control

[Broken access control](https://top10.owasp.org/2025/A01_2025-Broken_Access_Control/) is still number one. In a Vue app it usually shows up as a route or a button that's hidden from the wrong users but not actually protected.

Route guards are worth having, because they keep people out of screens they can't use. They're not a security control. Anyone can call your API with curl, so every permission check has to happen again on the server.

```javascript
// composables/useAuth.js
// SPA-only pattern. For SSR (Nuxt, Vike, etc.) move state into a per-request
// store like Pinia, because module-level refs leak across requests.
import { ref } from 'vue'

const user = ref(null)
const isAuthenticated = ref(false)

export function useAuth() {
  const hasRole = (role) => user.value?.roles?.includes(role) ?? false
  return { user, isAuthenticated, hasRole }
}
```

```javascript
// router/index.js
router.beforeEach((to) => {
  const { isAuthenticated, hasRole } = useAuth()

  if (to.meta.requiresAuth && !isAuthenticated.value) return '/login'
  if (to.meta.requiresRole && !hasRole(to.meta.requiresRole)) return '/unauthorized'
})
```

SSRF now lives in this category too, and it's a backend problem. If your app lets users submit a URL that the server later fetches (an avatar from a link, a webhook target, a link preview), the server has to validate it: resolve the hostname once, refuse private and link-local addresses in both IPv4 and IPv6, and connect to the address it checked. An allowlist in the Vue app catches typos. It doesn't stop an attacker, who will skip the browser entirely.

In practice:

- Enforce every permission on the server; treat route guards and hidden buttons as UX.
- Use relative URLs for your own API so a misconfigured base URL can't send credentials elsewhere.
- Never pass a user-supplied URL to a backend that fetches it without server-side validation.

## A02: Security Misconfiguration

[Misconfiguration](https://top10.owasp.org/2025/A02_2025-Security_Misconfiguration/) moved up to second place. For a Vue app, the common versions are a production build that ships debugging aids and secrets that end up in the bundle.

```javascript
// vite.config.js
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'

export default defineConfig(({ mode }) => ({
  plugins: [vue()],
  define: {
    // Keep Vue devtools support and verbose hydration details out of production
    __VUE_PROD_DEVTOOLS__: false,
    __VUE_PROD_HYDRATION_MISMATCH_DETAILS__: false,
  },
  build: {
    // Don't hand your source to anyone who opens devtools in production
    sourcemap: mode !== 'production',
  },
}))
```

Two things trip people up here:

- **Every `VITE_` variable is public.** Vite only exposes variables with the `VITE_` prefix to client code, and it inlines their values into the bundle in plain text. API keys, signing secrets, and database URLs never belong in one. Keep them in server-only config. (Vue CLI's `VUE_APP_` prefix is the same story with a different name.)
- **`server.headers` in the Vite config only applies to the dev server.** Your production security headers (Content-Security-Policy, HSTS, `X-Content-Type-Options`, `frame-ancestors`) come from whatever serves the built files: your CDN, Nginx, or your Node server. Skip the legacy `X-XSS-Protection` header; modern browsers ignore it, and CSP is what actually blocks XSS.

In practice:

- Check a production bundle for strings that look like keys before every release.
- Set security headers where production traffic is served, and test them against the live site.
- Show users generic error messages; keep details in server logs.

## A03: Software Supply Chain Failures

[Supply chain failures](https://top10.owasp.org/2025/A03_2025-Software_Supply_Chain_Failures/) are new to the list. The category expands 2021's "vulnerable and outdated components" to cover compromised packages, build systems, and update channels, which is exactly where npm worms like Shai-Hulud have been hitting. A Vue app pulls in hundreds of transitive dependencies, and a single malicious version can run code on every machine that installs it.

The defenses are configuration, not code:

- **Commit your lockfile and install from it.** `npm ci`, `pnpm install --frozen-lockfile`, or `yarn install --immutable` in CI, so builds never pick up a version nobody reviewed. I go through the setup in [the locked-dependencies post](/blog/npm-supply-chain-attacks-ci-cd-locked-dependencies).
- **Add a release-age cooldown.** pnpm, npm, Yarn, and Bun can all refuse versions published in the last few days, which is longer than most malicious versions stay on the registry.
- **Limit install scripts.** Most npm malware runs from a `postinstall` script. pnpm only runs lifecycle scripts for packages you allow. [Here's how those three layers held up](/blog/mini-shai-hulud-tanstack-locked-dependencies) when 84 malicious TanStack versions hit npm.
- **Audit in CI, and fail on high-severity findings.**

```yaml
# .github/workflows/security-check.yml
name: Security Check
on: [push, pull_request]

jobs:
  security:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '22'
          cache: 'npm'
      - run: npm ci
      - run: npm audit --omit=dev --audit-level=high
      - run: npm run build
```

## A04: Cryptographic Failures

[Cryptographic failures](https://top10.owasp.org/2025/A04_2025-Cryptographic_Failures/) on the frontend are mostly about where sensitive data sits. Anything in `localStorage` or `sessionStorage` is readable by any script on the page, so one XSS bug hands over every token stored there.

Keep session tokens in `HttpOnly`, `Secure`, `SameSite` cookies that JavaScript can't read, and let the browser send them:

```javascript
// The session cookie is set by the server and is HttpOnly + Secure + SameSite=Lax.
// The Vue app never sees or stores the token itself.
const response = await fetch('/api/account', {
  credentials: 'include',
})
```

In practice:

- Serve everything over HTTPS, and send `Strict-Transport-Security` from the server.
- Never put passwords, refresh tokens, or session tokens in web storage.
- Don't implement crypto in the browser to "protect" data you then store there. If the client can decrypt it, so can an attacker running code on the page.

## A05: Injection

[Injection](https://top10.owasp.org/2025/A05_2025-Injection/) in a Vue app mostly means cross-site scripting. Vue escapes text interpolation for you, so `{{ userInput }}` is safe. The [Vue security guide](https://vuejs.org/guide/best-practices/security.html) lists the places it can't protect you, and two of them come up constantly.

**`v-html` renders raw HTML.** Avoid it for anything a user wrote. When you genuinely need it, sanitize first:

```vue
<template>
  <!-- Safe: Vue escapes interpolation -->
  <p>{{ comment.author }}</p>

  <!-- Raw HTML only after sanitizing -->
  <div v-html="safeBody"></div>
</template>

<script setup>
import { computed } from 'vue'
import DOMPurify from 'dompurify'

const props = defineProps({ comment: { type: Object, required: true } })

const safeBody = computed(() =>
  DOMPurify.sanitize(props.comment.body, {
    ALLOWED_TAGS: ['b', 'i', 'em', 'strong', 'p', 'a'],
    ALLOWED_ATTR: ['href'],
  }),
)
</script>
```

**URL bindings aren't sanitized.** `<a :href="profile.website">` happily renders a `javascript:` URL, which runs when someone clicks it. Check the protocol before binding a URL a user supplied:

```javascript
// utils/safeUrl.js
const ALLOWED_PROTOCOLS = new Set(['http:', 'https:', 'mailto:'])

export function safeUrl(value) {
  try {
    const url = new URL(value, window.location.origin)
    return ALLOWED_PROTOCOLS.has(url.protocol) ? url.href : '#'
  } catch {
    return '#'
  }
}
```

In practice:

- Treat every `v-html` as a review item, and sanitize with DOMPurify or an equivalent.
- Run user-supplied URLs through a protocol check before binding them.
- Add a Content Security Policy so an injection that slips through can't load or run arbitrary scripts.
- Validate input on the server too. Client-side validation is for the user's benefit, not yours.

## A06: Insecure Design

[Insecure design](https://top10.owasp.org/2025/A06_2025-Insecure_Design/) covers flaws no amount of careful coding fixes, because the control was never designed in. For a Vue app, cross-site request forgery is the classic example: a state-changing form with no protection against being submitted from another site.

The primary defense is the session cookie's `SameSite=Lax` (or `Strict`) attribute, set by the server. A CSRF token is the second layer:

```javascript
// composables/useSecureForm.js
import { ref } from 'vue'

export function useSecureForm(endpoint) {
  const isSubmitting = ref(false)
  const errors = ref({})
  const csrfToken = ref('')

  const init = async () => {
    const response = await fetch('/api/csrf-token', { credentials: 'include' })
    csrfToken.value = (await response.json()).token
  }

  const submit = async (formData) => {
    if (isSubmitting.value) return
    isSubmitting.value = true
    errors.value = {}

    try {
      const response = await fetch(endpoint, {
        method: 'POST',
        credentials: 'include',
        headers: {
          'Content-Type': 'application/json',
          'X-CSRF-Token': csrfToken.value,
        },
        body: JSON.stringify(formData),
      })

      if (!response.ok) {
        errors.value = (await response.json()).errors ?? {}
        throw new Error('Form submission failed')
      }
      return await response.json()
    } finally {
      isSubmitting.value = false
    }
  }

  return { isSubmitting, errors, init, submit }
}
```

In practice:

- Decide where each security control lives before building the feature, not after.
- Give each role the narrowest access that works, and default new features to "off" for everyone.
- Rate-limit anything that sends email, creates accounts, or costs money per call, on the server.

## A07: Authentication Failures

[Authentication failures](https://top10.owasp.org/2025/A07_2025-Authentication_Failures/) are a server responsibility, but the Vue side can either help or get in the way. The pattern below keeps the session in an `HttpOnly` cookie and treats lockout as something the server enforces. The client only respects the server's `Retry-After` header so it stops offering a button that won't work.

```javascript
// composables/useAuthentication.js
// Client-side cooldown is a UX nicety, NOT a security control. The server
// enforces per-account and per-IP lockout; anyone using curl bypasses this.
import { computed, ref } from 'vue'
import { useRouter } from 'vue-router'

const user = ref(null)
const isLoading = ref(false)
const cooldownUntil = ref(null)

export function useAuthentication() {
  const router = useRouter()
  const isAuthenticated = computed(() => !!user.value)
  const inCooldown = computed(
    () => cooldownUntil.value !== null && Date.now() < cooldownUntil.value,
  )

  const login = async ({ email, password, captchaToken }) => {
    if (inCooldown.value) throw new Error('Too many attempts. Try again later.')
    isLoading.value = true

    try {
      const response = await fetch('/api/auth/login', {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        credentials: 'include', // session cookie: HttpOnly + Secure + SameSite=Lax
        body: JSON.stringify({ email, password, captchaToken }),
      })

      if (response.status === 429) {
        const retryAfter = Number(response.headers.get('Retry-After')) || 900
        cooldownUntil.value = Date.now() + retryAfter * 1000
        throw new Error('Too many attempts. Try again later.')
      }
      if (!response.ok) throw new Error('Invalid credentials')

      user.value = (await response.json()).user
      cooldownUntil.value = null
      router.push('/dashboard')
    } finally {
      isLoading.value = false
    }
  }

  const logout = async () => {
    try {
      await fetch('/api/auth/logout', { method: 'POST', credentials: 'include' })
    } finally {
      user.value = null
      router.push('/login')
    }
  }

  return { isAuthenticated, isLoading, inCooldown, login, logout }
}
```

In practice:

- Offer phishing-resistant MFA: passkeys where you can, TOTP as the fallback.
- Use the same error message for "no such user" and "wrong password."
- Expire sessions on the server, and clear client state on logout even if the request fails.

## A08: Software or Data Integrity Failures

[Integrity failures](https://top10.owasp.org/2025/A08_2025-Software_or_Data_Integrity_Failures/) happen when code or data is trusted without being checked. For a Vue app, the two places that matter are third-party scripts and your build pipeline.

Your bundled code is served from your own origin, so the browser trusts it as much as it trusts your server. A script loaded from someone else's CDN is different. Pin it with Subresource Integrity, so the browser refuses it if the file changes:

```html
<script
  src="https://cdn.example.com/widget/2.4.1/widget.min.js"
  integrity="sha384-REPLACE_WITH_THE_HASH_PUBLISHED_FOR_THIS_EXACT_FILE"
  crossorigin="anonymous"
></script>
```

The pipeline is the bigger risk. The worm that published malicious TanStack versions started with a pull request workflow that ran with publish rights and restored a poisoned GitHub Actions cache. Never give workflows triggered by outside pull requests access to secrets or publish tokens, and require review before anything merges to the branch you deploy from.

In practice:

- Use SRI for every script and stylesheet loaded from a third-party origin.
- Protect your main branch and require reviews.
- Keep publish and deploy credentials out of workflows that run untrusted code.

## A09: Security Logging and Alerting Failures

The 2025 edition renamed this category from "monitoring" to "[alerting](https://top10.owasp.org/2025/A09_2025-Security_Logging_and_Alerting_Failures/)," and the change is the point: a log nobody gets alerted from doesn't stop anything.

Frontend telemetry helps, but treat it as supplementary. Everything the browser reports is under the user's control, including the URL and the user agent. The authoritative security log lives on the server, where it can record the real IP and the authenticated user from the session.

```javascript
// composables/useSecurityLogger.js
// Frontend telemetry only. The server resolves the user from the session
// cookie; never trust a userId the client sends.
export function useSecurityLogger() {
  const logSecurityEvent = (type, details = {}) =>
    fetch('/api/security/log', {
      method: 'POST',
      credentials: 'include',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify({
        type,
        details,
        url: window.location.pathname,
        timestamp: new Date().toISOString(),
      }),
    }).catch(() => {
      // Logging must never break the app
    })

  return { logSecurityEvent }
}
```

In practice:

- Log authentication events and access-control failures on the server, with the real IP and user.
- Send logs somewhere durable (Sentry, Datadog, CloudWatch, Loki), not just local files.
- Alert on patterns that matter, like a burst of 401s or 403s from one account or address, and write down who responds.

## A10: Mishandling of Exceptional Conditions

[This category](https://top10.owasp.org/2025/A10_2025-Mishandling_of_Exceptional_Conditions/) is new in 2025. It covers improper error handling, logic errors, and "failing open": code that grants access, skips a check, or shows sensitive detail when something unexpected happens. Frontend code hits these conditions constantly, because every network call can fail.

Two habits cover most of it in Vue. First, fail closed. When the call that decides what a user may see fails, the answer should be "nothing privileged," not "whatever was there before":

```javascript
// composables/usePermissions.js
import { ref } from 'vue'

export function usePermissions() {
  // Empty means "no access", never "unknown"
  const permissions = ref([])
  const loadError = ref(null)

  const load = async () => {
    try {
      const response = await fetch('/api/me/permissions', { credentials: 'include' })
      if (!response.ok) throw new Error(`Permissions request failed: ${response.status}`)
      permissions.value = await response.json()
    } catch (error) {
      permissions.value = [] // fail closed: hide privileged UI on any error
      loadError.value = error
    }
  }

  const can = (permission) => permissions.value.includes(permission)

  return { permissions, loadError, load, can }
}
```

Second, catch errors in one place, report them, and show the user something generic. A global handler means an unexpected exception never leaves the app half-rendered or shows a stack trace:

```javascript
// main.js
app.config.errorHandler = (error, instance, info) => {
  // Report to your error tracker. Never render error.message to the user.
  reportError(error, { info })
}
```

For a single section of the page, `onErrorCaptured` in a wrapper component works the same way: catch the error, show a fallback, and stop it from taking down the rest of the page.

In practice:

- Default every security decision to "deny" when data is missing, late, or malformed.
- Handle rejected promises everywhere you `await`; an unhandled one is an unplanned state.
- Show generic messages to users and keep the details in your error tracker.

## The Short Version

Sorted by where the fix lives, the list gets shorter for a Vue developer. The things that are mostly yours to get right in Vue code are injection through `v-html` and URL bindings, secrets that leak through `VITE_` variables, what the UI does when a request fails, and the dependencies you install. Access control, authentication, CSRF, SSRF, and logging all need the backend to do the real work. The Vue side's job there is to stay out of the way: keep tokens out of web storage, respect the server's answers, and never pretend a route guard is a security boundary.

---
