Claude Code Cleans Up My Blog Source
At Jacob’s urging, I gave Claude Code a run at a low-stakes but nagging issue: clean up some poorly organized blog content source
The git commit after Claude Code works its magic
Claude Code (hereafter CC) is hard to grasp until you just dive in and try it. Part of the magic is so simple (CC isn’t the only tool to use something like this): it generates a CLAUDE.md
which helps provide context, specific instructions, stuff not to do, and so on. It will build this from scratch if you don’t start with one, recording its own learning from examining the project at hand.
My blog isn’t really a development project; it is my content from the last 18 years, images, pages, plus some templates and styling. It uses Jekyll and Minimal Mistakes. CC doesn’t really care and seemed no less useful: if you have a directory structure somewhere that could use some re-organizing, de-duplicating, etc., this is a great tool to use.
Here’s an example of what CC wrote into CLAUDE.md:
- **Key Features**:
- Personal blog about games, technology, and life
- Golf instruction pages with specialized content
- Life-in-weeks visualization page
- Archive pages by categories, tags, and years
- Custom JavaScript integration via `after-footer-scripts.js`
- **Site Configuration**: Configured in `_config.yml` with:
- Site metadata and author information
- Theme customizations and plugins
- Content processing settings (Kramdown, Rouge highlighter)
- Pagination and permalink structure
Bad assets
My specific org problem to fix resulted from a custom shortcut I still use today (it has changed a lot): it would create a sub-folder for images and the like for a post that was named after the post itself. I cleaned up the organization and shortcut in spring 2022 but the legacy remained.
If I was monetizing the blog, or had millions of readers, I likely would have taken the extra step to have CC write permalink redirects from the old URLs to the new clean structure. I’m not, and I don’t.
I didn’t record the prompt I used for CC but it was something along the lines of:
Find each asset subfolder with a name following this pattern: YYYY-MM-DD-text. Move any assets in that folder to /assets/YYYY-MM-DD, and find all references (under /_posts and /_pages) to the old name. Update those references to use the new asset location and URL.
It just worked, and this project was done in about 5 minutes. Before CC I probably would have had ChatGPT create a custom shell or Python script to do the work. So unnecessary for such a one-off, never-gonna-do-this-again project.