Using AI to Improve My Blog

This blog has been running on Hugo, S3 and CloudFront for a while now. I’ve written about the architecture, the monitoring and the bookmarks pipeline that feeds it. It worked - but like most side projects, it had collected a backlog of “I’ll get to that one day” jobs.
On 14 November I started using Claude Code on the repository. Ten days later, the repo had gained 200 commits, 194 of them co-written with Claude. This post walks through what changed.
As my AI Usage page says, I don’t one-shot code. Every change below was a small, focused commit that I asked for, read and reviewed before it went in.
The numbers
Between 14 and 23 November:
- 200 commits, 194 of them co-authored by Claude
- 117 files changed, with 7,640 lines added and 1,916 removed
- 139 tests across nine test files, starting from none
Tests and CI
The repo had no tests. The Python scripts - the Raindrop sync, the bookmark generator, a dead link checker and a tag sorter - only got exercised when a deploy ran them.
That was the first thing to fix. A pytest suite now covers every script, and dependencies are pinned. One reusable tests.yml workflow runs the suite before every deploy and on every pull request.
Pull requests got their own checks too:
- A full Hugo build that fails on any Hugo warning
- Internal link checks, and dead link checks for any posts the PR changes
- A check that the Content-Security-Policy’s script hashes still match the inline scripts Hugo emits
Versions are now pinned throughout, too. Every GitHub Action is pinned to a commit SHA, with Dependabot keeping the actions, the Python packages and the theme submodule up to date. The Hugo version, the Python version and the runner image are each pinned in several places, so a test fails if any of them disagree.
Security
Most of the security work went into the CloudFront distribution:
- Security headers: HSTS,
X-Content-Type-Options,X-Frame-Options, aReferrer-Policy, aPermissions-Policythat turns off browser features the blog never uses, andX-XSS-Protection: 0 - A report-only Content-Security-Policy, with violation reports sent to a small self-hosted Lambda that logs them to CloudWatch. It doesn’t log visitors’ IP addresses.
- Pinned third-party scripts: Fuse.js is vendored rather than loaded unpinned from a CDN, and the GoatCounter script is pinned with a subresource integrity hash
- Vulnerability probes (requests for
wp-login.phpand friends) get a 404 straight from CloudFront rather than reaching the origin - HTTPS-only access to the website bucket, enforced by the bucket policy
The deployment side got the same treatment. Each GitHub OIDC deploy role now trusts exactly one GitHub environment, and each environment only deploys from main. Only the jobs that assume an AWS role get id-token: write. The sync Lambda lost permissions it never used, and its S3 access now covers only the bookmark covers.
On the privacy side, CloudFront no longer logs viewers’ cookies, and the site now has a privacy policy.
Performance
- Bookmark covers are resized to WebP thumbnails, with stable, content-hashed URLs
- Featured images are served as resized WebP via
srcset, with intrinsic widths and heights to stop layout shift - Files synced to S3 get proper
Cache-Controlheaders, and fingerprinted assets aren’t re-uploaded on every deploy - The blog is served over IPv6 and HTTP/3, and
wwwredirects to the bare domain with a 301 - The bookmark search script only loads on the search page
The deploy pipeline got faster too. Hugo’s processed images and the bookmark thumbnails are cached between runs, and the nightly run skips the infrastructure deploys. The deploy itself is skipped entirely when nothing has changed.
A sturdier bookmarks pipeline
The nightly Raindrop sync got a lot of hardening:
- A guard against mass deletes, in case the Raindrop API ever returns an empty or partial collection
- Alarms for a failed sync, a sync that hasn’t run for a day, and a blog that hasn’t deployed for two days
- Cover image types detected from the image bytes rather than trusting the
Content-Typeheader - Raindrop’s floats parsed as
Decimal, which DynamoDB requires - Refusal to follow redirects away from HTTPS
- Only the fields the site actually uses are stored
The bookmark generator now fails outright rather than quietly deploying a site with no bookmarks.
Better logs
The S3 and CloudFront request logs are now delivered into date folders, and the Athena tables are partitioned by day. As a result, queries scan only the days they ask about rather than the whole bucket. CloudFront now also logs country, ASN and origin latency. Old logs expire after a year rather than sitting in cheaper storage forever.
Housekeeping
Plenty of the commits were small things that had been bugging me, or that I hadn’t noticed:
- A copy button on code blocks
- A link to my main website, maceage.com, in the About Me sidebar
- Follow Me buttons that fit on one row, rather than RSS wrapping onto a line of its own
- Hugo’s own 404 page for missing pages, rather than an S3 error
- Last-modified dates (in the sitemap and RSS) taken from each post’s git history
- UTF-8 byte-order marks stripped from posts and templates, plus an
.editorconfigto stop them coming back - A favicon config that finally points at files that exist
- A dead link checker that retries sensibly, limits requests per host and treats bot-blocking sites as warnings rather than failures
Keeping the posts honest
The part that surprised me most was the posts themselves. Several of my posts walk through the CloudFormation templates and IAM policies behind the blog. As the code changed, those posts drifted out of date.
Claude kept them in step. The architecture, monitoring and bookmarks posts were all updated to match the current templates and the live IAM roles.
It also went through every post looking for existing tags that fit but were missing: Docker and testing on the SQL Server in Docker post, Sawnoff Studios on the build server series, backups on the Recipebook backup and more. In all, 27 posts gained tags. Because last-modified dates come from git, that commit would have made every one of them look freshly updated, so each post’s existing date is now pinned in its front matter.
CLAUDE.md
The repository now has a CLAUDE.md file: project notes that Claude Code reads at the start of every session. It records my preferences (yes, I want both analytics trackers) and the traps that are easy to fall into. For example, changing a CloudFormation template can need new permissions on a deploy role that’s managed outside the repo, and Python’s version is pinned in five places that all have to change together.
It grew each time something caught us out, and it’s become useful documentation in its own right.
Wrapping up
Ten days cleared a backlog that would otherwise have taken me months of weekends. More importantly, most of it is work I’d never have prioritised on my own. Nobody gets excited about byte-order marks or pinning Actions to SHAs, but they’re exactly the jobs that bite you later.
It wasn’t all smooth sailing. Removing the S3 website configuration broke deploys until I added a permission the deploy role was missing. The Content-Security-Policy needed a couple of rounds to allow every host Google Analytics talks to. And the dead link checker took several passes before it stopped crying wolf over sites that block bots. Each of those went into CLAUDE.md, so the same mistake doesn’t happen twice.
What made it work was keeping the changes small. Each commit does one thing, so each one was quick to read, easy to review and easy to roll back. That’s no different from how I’d want a colleague to work - and it’s what separates using AI as a tool from using it to generate slop.
The blog is faster, safer and better tested than it was ten days ago, and the posts describing it are accurate again. I’ll take that.