<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Owain Williams</title>
    <description>The latest articles on DEV Community by Owain Williams (@owaincodes).</description>
    <link>https://dev.to/owaincodes</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F65179%2F6d4edfad-60c3-431a-a35f-885393a83259.jpg</url>
      <title>DEV Community: Owain Williams</title>
      <link>https://dev.to/owaincodes</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/owaincodes"/>
    <language>en</language>
    <item>
      <title>Virtual Office - a team of Claude agents in a pixel art office</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Fri, 27 Nov 2026 11:34:32 +0000</pubDate>
      <link>https://dev.to/owaincodes/virtual-office-a-team-of-claude-agents-in-a-pixel-art-office-2ikl</link>
      <guid>https://dev.to/owaincodes/virtual-office-a-team-of-claude-agents-in-a-pixel-art-office-2ikl</guid>
      <description>&lt;h1&gt;
  
  
  I built a pixel art office full of Claude agents, and I only talk to the manager
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;TL;DR.&lt;/strong&gt; Virtual Office is a small local app that runs a team of Claude Code agents on a git repository and shows them working in a pixel art office. There's a manager, two developers, a QA, a project manager and a contractor who only turns up to review pull requests. I only ever talk to the manager. She hands the work out, the team gets on with it in their own git worktrees, and I'm only pulled in when a decision is genuinely mine. It's open source, it's free, and it's about ten minutes from clone to a working office. The link is at the bottom.&lt;/p&gt;

&lt;p&gt;This setup could be super useful for anyone that finds swapping between terminal tabs and sessions really overwhelming. The past week I've been using this office and I've found it much easier to organise everything and I've felt less fatigue from context switching all the time. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2F4k2fut2f%2Fvirtual-office-working.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2F4k2fut2f%2Fvirtual-office-working.png" alt="virtual-office-working" width="799" height="491"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Why on earth did I build this?&lt;/li&gt;
&lt;li&gt;Meet the team&lt;/li&gt;
&lt;li&gt;How it actually works&lt;/li&gt;
&lt;li&gt;Worktrees, so nobody trips over anyone&lt;/li&gt;
&lt;li&gt;Who said what&lt;/li&gt;
&lt;li&gt;The guard rails&lt;/li&gt;
&lt;li&gt;Pull request reviews by a contractor&lt;/li&gt;
&lt;li&gt;Choosing the model per task&lt;/li&gt;
&lt;li&gt;Tokens, not money&lt;/li&gt;
&lt;li&gt;Talking to one agent directly&lt;/li&gt;
&lt;li&gt;The silly bits&lt;/li&gt;
&lt;li&gt;Things that bit me&lt;/li&gt;
&lt;li&gt;What it doesn't do&lt;/li&gt;
&lt;li&gt;Run your own&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a id="why"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why on earth did I build this?
&lt;/h2&gt;

&lt;p&gt;I'd got into the habit of running a few Claude Code sessions at the same time. It's brilliant, but it turns you into a switchboard operator. Which terminal is doing what? Who's waiting on me? Did that one finish, or is it sat there asking a question I haven't seen?&lt;/p&gt;

&lt;p&gt;What I actually wanted was to behave like a manager. Say what I need, once, to one person, and have them sort the rest. And I wanted to &lt;em&gt;see&lt;/em&gt; it. A wall of terminal tabs tells you nothing at a glance. A little office where somebody is visibly typing and somebody else is waiting at the meeting table tells you everything in about a second.&lt;/p&gt;

&lt;p&gt;So I built one. Yes, it's partly a toy. No, I'm not sorry.&lt;/p&gt;

&lt;p&gt;Also a special shout out to &lt;a href="https://www.linkedin.com/in/suzanne-aitchison-59aa2838/" rel="noopener noreferrer"&gt;Suzanne Aitchison&lt;/a&gt; for giving me this idea. We were chatting about how we work with agent, how we find it mentally taxing and she mentioned that her work have a virtual office for co-workers but also that she handles her agents in a similar way - speak to a manager and they look after it all. I just merged the two ideas together. &lt;/p&gt;

&lt;p&gt;&lt;a id="team"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Meet the team
&lt;/h2&gt;

&lt;p&gt;Everyone is a real Claude agent, using the Claude Agent SDK. They each have a name, a role, a usual model and a desk.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Desk&lt;/th&gt;
&lt;th&gt;Name&lt;/th&gt;
&lt;th&gt;Model&lt;/th&gt;
&lt;th&gt;What they do&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Manager&lt;/td&gt;
&lt;td&gt;Claudette&lt;/td&gt;
&lt;td&gt;Opus&lt;/td&gt;
&lt;td&gt;Takes my requests, delegates, and only asks me when a decision is mine&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Senior developer&lt;/td&gt;
&lt;td&gt;Claudius&lt;/td&gt;
&lt;td&gt;Opus&lt;/td&gt;
&lt;td&gt;The demanding stuff that needs proper reasoning&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Junior developer&lt;/td&gt;
&lt;td&gt;Claudio&lt;/td&gt;
&lt;td&gt;Haiku&lt;/td&gt;
&lt;td&gt;Easy, quick wins&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;QA&lt;/td&gt;
&lt;td&gt;Claudia&lt;/td&gt;
&lt;td&gt;Sonnet&lt;/td&gt;
&lt;td&gt;Tests the developers' work. Can't edit files&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Project manager&lt;/td&gt;
&lt;td&gt;Claudine&lt;/td&gt;
&lt;td&gt;Sonnet&lt;/td&gt;
&lt;td&gt;Lives in Jira. Can't edit files or run commands&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hot desk&lt;/td&gt;
&lt;td&gt;Claudel&lt;/td&gt;
&lt;td&gt;Opus&lt;/td&gt;
&lt;td&gt;A contractor who only comes in to review pull requests. Read only&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The names are all in a config file, so you can rename everyone. Mine are very much working titles.&lt;/p&gt;

&lt;p&gt;The important rule is this one: &lt;strong&gt;staff never message me directly.&lt;/strong&gt; Only the manager does. Everything comes back to her, and she decides what's worth bothering me with.&lt;/p&gt;

&lt;p&gt;&lt;a id="how"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How it actually works
&lt;/h2&gt;

&lt;p&gt;The app is a small Node server (Express and a websocket) that serves a canvas drawing of the office and talks to the Agent SDK. It only listens on &lt;code&gt;127.0.0.1&lt;/code&gt;, and it rejects websocket connections from any other origin, because it can direct agents on your machine and I'd rather nobody else could.&lt;/p&gt;

&lt;p&gt;When I type in the chat, the message goes to the manager. She's an agent with a very limited set of tools. She can read files, but she can't edit anything or run commands. What she &lt;em&gt;can&lt;/em&gt; do is call a handful of tools I give her:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;assign_task&lt;/code&gt; gives a task to a member of staff, with a title for the office floor, full self-contained instructions, and optionally a branch and a model&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;stop_agent&lt;/code&gt; stops somebody mid-task&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ask_owner&lt;/code&gt; puts a question card in front of me with answer buttons&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tell_owner&lt;/code&gt; sends me a short note&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;office_status&lt;/code&gt; tells her who's doing what&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;assign_task&lt;/code&gt; returns straight away. The agent goes off and works, and when they finish, their report arrives back to the manager as a message. She reads it, decides what happens next, and either assigns the next piece of work or tells me it's done. I don't have to be involved in any of that plumbing.&lt;/p&gt;

&lt;p&gt;Every agent is a proper Claude Code session in the project folder, so the repo's own &lt;code&gt;CLAUDE.md&lt;/code&gt;, rules and MCP servers all apply to them. That's the bit I like most. The office isn't a clever imitation of my setup. It &lt;em&gt;is&lt;/em&gt; my setup, with a manager on the front.&lt;/p&gt;

&lt;p&gt;&lt;a id="worktrees"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Worktrees, so nobody trips over anyone
&lt;/h2&gt;

&lt;p&gt;If both developers edit the same folder at the same time, you'll have a bad afternoon. So when the manager gives a task a branch, the office creates a git worktree for it and the agent works there.&lt;/p&gt;

&lt;p&gt;A new branch starts from the remote's default branch after a fetch, or from &lt;code&gt;HEAD&lt;/code&gt; if there's no remote. The office also adds &lt;code&gt;.claude/worktrees/&lt;/code&gt; to &lt;code&gt;.git/info/exclude&lt;/code&gt; if your project doesn't already ignore it, which is local only and never committed. When the work's merged or abandoned, the manager removes the worktree. Git refuses it if it has uncommitted changes, and the branch is always kept.&lt;/p&gt;

&lt;p&gt;There's also a rule that two people never share a folder while one of them is changing code. QA gets sent to the developer's branch &lt;em&gt;after&lt;/em&gt; the developer reports in, not while they're still typing.&lt;/p&gt;

&lt;p&gt;&lt;a id="who-said-what"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Who said what
&lt;/h2&gt;

&lt;p&gt;This one came from using it. Staff report back to Claudette, not to me, and for a while those reports were invisible. The only way I knew who had said what was if Claudette happened to name them in her reply, and when she summarised three reports in one message I couldn't tell which agent had said which part.&lt;/p&gt;

&lt;p&gt;So now every report shows up in the chat as its own card, with the agent's face, name, role, the task title and the first line of what they said. If there's more, you click the card to read the rest. Claudette's reply lands after the reports, so the order reads the way it happened.&lt;/p&gt;

&lt;p&gt;Everyone also has a colour, taken from their shirt on the office floor. It's a stripe down the side of their cards, and the little face is drawn from the same pixel art as the figure at the desk. Names in Claudette's messages are tinted to match, so "Claudius is on the bug" is easy to scan. I made sure the name and role always sit next to the face, so you never have to rely on colour alone.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Fsh2dphc4%2Fvirtual-office-chat.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Fsh2dphc4%2Fvirtual-office-chat.png" alt="virtual-office-chat" width="760" height="1608"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a id="guard-rails"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The guard rails
&lt;/h2&gt;

&lt;p&gt;Giving a team of AI agents the run of your repo deserves some respect. Every single tool call goes through a PreToolUse hook, and the hook enforces three things:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Role limits.&lt;/strong&gt; QA can't edit files. The project manager can't edit or run commands. The reviewer can't change anything. The manager can't run tools directly at all.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Always blocked.&lt;/strong&gt; A list of patterns that are refused outright: force pushes, hard resets, recursive deletes, that sort of thing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Needs my approval.&lt;/strong&gt; Pushes, pull request creation or merging, and releases pause until I click Approve or Decline.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That last one used to bother me. Early on, an approval looked like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PowerShell: git add -A; git commit -m "..."; git push origin feat/x; gh pr view 12 --json ...; python -c "..."
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That isn't a question a human can answer. So approvals are now cards. There's a plain English headline, a list of the steps with the ones that need my say-so flagged, and the exact command tucked away in a collapsible block for when I want to check it. It recognises the common git and gh shapes, and when it doesn't understand something it says so, rather than pretending.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Fnkjlprok%2Fvirtual-office-approval.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Fnkjlprok%2Fvirtual-office-approval.png" alt="virtual-office-approval" width="694" height="696"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It's a safety net, not a sandbox. Please read the cards before you click Approve.&lt;/p&gt;

&lt;p&gt;&lt;a id="reviews"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Pull request reviews by a contractor
&lt;/h2&gt;

&lt;p&gt;I didn't want the person who wrote the code marking their own homework, and I didn't want to make Claudius or Claudia do reviews on top of everything else. So I brought in a contractor.&lt;/p&gt;

&lt;p&gt;When a pull request is open, Claudel beams in, arrives at the hot desk, reviews it, and leaves. He starts completely cold every time, a fresh conversation with no memory of how the work was done, which is exactly what you want from a reviewer.&lt;/p&gt;

&lt;p&gt;He can read files, read the pull request and run tests. He can't edit, commit, push, or post anything to GitHub with &lt;code&gt;gh&lt;/code&gt;. His one way to write is a &lt;strong&gt;draft review&lt;/strong&gt;, a GitHub pending review that only my signed-in account can see until I open the pull request, read it and submit it myself (or throw it away). Nothing is published without me.&lt;/p&gt;

&lt;p&gt;&lt;a id="models"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Choosing the model per task
&lt;/h2&gt;

&lt;p&gt;Everyone has a usual model, but the manager can change it for a single task. If Claudius is on something properly gnarly, she can put him on Fable for that task. Routine work can go down to Haiku. When the task ends, they go back to their usual model.&lt;/p&gt;

&lt;p&gt;It's a &lt;code&gt;model&lt;/code&gt; option on &lt;code&gt;assign_task&lt;/code&gt;, limited to a list in the config, and each model has a one line "use it for" description that she reads when deciding. She's told to treat the most capable model as something to use sparingly, and she doesn't ask me first. It shows on the floor (the name tag says "on Fable" for the length of the task) and in the chat, so I never wonder why something's using more than it should.&lt;/p&gt;

&lt;p&gt;If the chosen model isn't available on your account, the agent just carries on with their usual one and says so in the chat. I'd rather it degraded than died.&lt;/p&gt;

&lt;p&gt;&lt;a id="tokens"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tokens, not money
&lt;/h2&gt;

&lt;p&gt;I originally showed a dollar figure per agent. Then I remembered that on a plan, it isn't real money, so the number was just noise. It's now tokens: new input, output and cache writes, per agent and per model, per day. I don't count cache reads, because re-reading cached text would swamp everything else and tell you nothing useful.&lt;/p&gt;

&lt;p&gt;It's a guide to how fast you're getting through your plan limits. It is not a bill. The header shows the day's total, and hovering gives you the split by model.&lt;/p&gt;

&lt;p&gt;&lt;a id="direct"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Talking to one agent directly
&lt;/h2&gt;

&lt;p&gt;The manager is my only point of contact, but sometimes I want to go round her. Click any agent's name tag to open their log, and there's a box at the bottom that talks straight to them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A normal message goes into their existing conversation&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/clear&lt;/code&gt; forgets it&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/model sonnet&lt;/code&gt; changes their usual model until the office restarts&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/stop&lt;/code&gt; stops them&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/plugins&lt;/code&gt; lists plugins loaded just for them&lt;/li&gt;
&lt;li&gt;Any other &lt;code&gt;/command&lt;/code&gt; is passed to their own Claude Code session, so &lt;code&gt;/compact&lt;/code&gt; or a skill's name should work&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Fqo2fsco4%2Fvirtual-office-direct.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Fqo2fsco4%2Fvirtual-office-direct.png" alt="virtual-office-direct" width="800" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also give one agent their own plugins. List local plugin folders under that agent in your config and they load for that agent only. When I talk to an agent directly, the manager gets a quiet note that I did, so she isn't surprised by work she didn't assign.&lt;/p&gt;

&lt;p&gt;&lt;a id="silly"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The silly bits
&lt;/h2&gt;

&lt;p&gt;Because it's my office and I make the rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There's an office dog, a big shaggy cream Romanian Mioritic Shepherd with a fringe over its eyes, styled on my own dog Toby, and it has a ball. Click the ball and it throws it for the dog. The first version of the dog was beige on a beige floor and vanished completely, so the floor is now a darker grey and the dog now stands out.&lt;/li&gt;
&lt;li&gt;There's a little pet Claude, drawn as the orange pixel mascot, who wanders around.&lt;/li&gt;
&lt;li&gt;Click the water cooler and it spills. The pet Claude turns up with a mop and cleans it up.&lt;/li&gt;
&lt;li&gt;When Claudel arrives or leaves, he beams in and out like a transporter. If he's got nothing on, click a plant and he'll drop in for thirty seconds anyway.&lt;/li&gt;
&lt;li&gt;My laptop has a dark lid. Everyone else's is light grey. That's the only special treatment I get.&lt;/li&gt;
&lt;li&gt;A laptop lid goes red when that agent's latest test run is failing, and shows a green light when it passes.&lt;/li&gt;
&lt;li&gt;When a pull request is merged, confetti falls and the dog gets the zoomies.&lt;/li&gt;
&lt;li&gt;The windows follow your clock and the time of year, so there's daylight, golden dusk and stars at night. Sunrise and sunset come from the date and a &lt;code&gt;latitude&lt;/code&gt; in the config (51.5 by default, which is London), so a winter afternoon in the UK is dark by about four.&lt;/li&gt;
&lt;li&gt;Staff pop to the kitchen for a coffee now and then, and everyone gathers at the meeting table for stand-up.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's Claudel mid-teleport, then the spill and the mop:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Flyxd5lw4%2Fvirtual-office-transporter.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Flyxd5lw4%2Fvirtual-office-transporter.png" alt="virtual-office-transporter" width="418" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Fugtbh5s3%2Fvirtual-office-spill.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Fugtbh5s3%2Fvirtual-office-spill.png" alt="virtual-office-spill" width="394" height="344"&gt;&lt;/a&gt; &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Fahupt4t0%2Fvirtual-office-mop.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Fahupt4t0%2Fvirtual-office-mop.png" alt="virtual-office-mop" width="394" height="344"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;All of it is decoration, and it's switched off if your system asks for reduced motion.&lt;/p&gt;

&lt;p&gt;There are also two buttons in the header. &lt;strong&gt;Stand-up&lt;/strong&gt; has the project manager triage the Jira board and the manager post the plan for the day. &lt;strong&gt;End of day&lt;/strong&gt; has her post what got finished, what's in progress and what's waiting on me. You can put them on a timer too, but they're off by default because they spend tokens without being asked.&lt;/p&gt;

&lt;p&gt;&lt;a id="bit-me"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Things that caught me out
&lt;/h2&gt;

&lt;p&gt;It didn't work first time. Obviously.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Stopping an agent was slow.&lt;/strong&gt; My first "stop Claudius" went through the manager, which meant waiting for her current turn to finish and then for a model reply. Now a plain "stop Claudius" is handled by the office at once, and each turn has its own &lt;code&gt;AbortController&lt;/code&gt;, raced against the session so a stop is instant even if the session is slow to wind down.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A stale abort signal.&lt;/strong&gt; Because the controller is per turn, you have to create a new one at the start of each turn, or a later task inherits the old, already aborted one and stops before it starts. That one took me a while.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The windows were wrong for half the year.&lt;/strong&gt; I'd hard-coded night as 8pm to 6am. It's 4:30pm in the UK in late November and properly dark, and my office was cheerfully sunny. The window colours now come from the day of the year and your latitude, with a rough equation of time and your clock's daylight saving shift thrown in. It's close enough for a window, and it gets the November gloom right.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A phantom black dot.&lt;/strong&gt; An unknown agent in an older saved state drew a name tag with nothing in it under Claudel's desk. If the server doesn't know the agent, the tag and desk are now hidden.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Running it from inside a Claude session can upset the sign-in.&lt;/strong&gt; Run it from your own terminal so the agents use your normal Claude Code login.
&lt;a id="doesnt"&gt;&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What it doesn't do
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Worktrees separate &lt;em&gt;files&lt;/em&gt;. Tasks that change the same shared thing, like a database schema or generated files, can still collide. The manager is told to run those one after another, but nothing enforces it.&lt;/li&gt;
&lt;li&gt;Each person does one task at a time.&lt;/li&gt;
&lt;li&gt;It doesn't sandbox anything. The agents run real commands in your real project folder.&lt;/li&gt;
&lt;li&gt;An approval that's pending when the app closes expires, and the agent has to be asked again.&lt;/li&gt;
&lt;li&gt;I've mostly tested it on Windows. It's plain Node, so it should be fine elsewhere, but I haven't tried macOS or Linux yet.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a id="run"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Run your own
&lt;/h2&gt;

&lt;p&gt;You'll need Node 20 or newer, Claude Code installed and signed in, and git. The GitHub CLI (&lt;code&gt;gh&lt;/code&gt;) is only needed for pull request work and the contractor's draft reviews, and you'll want a git repository for the team to work on.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/OwainWilliams/virtual-office.git
&lt;span class="nb"&gt;cd&lt;/span&gt; virtual-office
npm install
npm start
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Open &lt;code&gt;http://localhost:4700&lt;/code&gt;. The first time, the office asks for a project: a name, the full path to a git repo, and optionally a Jira key. That's it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Furdhkfbg%2Fvirtual-office-welcome.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Furdhkfbg%2Fvirtual-office-welcome.png" alt="virtual-office-welcome" width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Want to look around without spending any tokens? Start it in demo mode and the agents are fakes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;OFFICE_DEMO&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'1'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;npm&lt;/span&gt; &lt;span class="n"&gt;start&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your own settings go in a &lt;code&gt;config.local.json&lt;/code&gt; next to the shipped &lt;code&gt;config.json&lt;/code&gt;, which wins over the defaults and isn't committed. You only list what you change:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"officeName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Acme HQ"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"ownerName"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Sam"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"latitude"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;40.7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"agents"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"senior"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"name"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Ada"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"model"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"sonnet"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"routines"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"standupTime"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"09:00"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The code is here: &lt;a href="https://github.com/OwainWilliams/virtual-office" rel="noopener noreferrer"&gt;github.com/OwainWilliams/virtual-office&lt;/a&gt;. It's MIT licensed, so take it, rename everyone, and make the dog yours.&lt;/p&gt;

&lt;p&gt;To make changes to it, I point Claude Code at my local repo and prompt the changes, this is very much still a work in progress and there are loads more things I want to enable it to do, but I thought I'd share an early working example. &lt;/p&gt;

&lt;p&gt;If you build something fun on top of it, I'd love to see it or even better, make a PR to the repo and then we can all enjoy it.&lt;/p&gt;

</description>
      <category>claude</category>
      <category>ai</category>
      <category>node</category>
    </item>
    <item>
      <title>Cleaning Up After Claude Worktrees</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Fri, 27 Nov 2026 10:07:40 +0000</pubDate>
      <link>https://dev.to/owaincodes/cleaning-up-after-claude-worktrees-jon</link>
      <guid>https://dev.to/owaincodes/cleaning-up-after-claude-worktrees-jon</guid>
      <description>&lt;p&gt;&lt;strong&gt;TL;DR.&lt;/strong&gt; If you copied the one-database-per-worktree hook from &lt;a href="https://owain.codes/blog/2026/october/umbraco-features-with-claude-worktrees" rel="noopener noreferrer"&gt;my last post&lt;/a&gt;, you've probably got a few databases sitting on your SQL Server that belong to worktrees that no longer exist. A reader spotted it, I went digging, and there were two reasons. The sweep now checks &lt;code&gt;git worktree list&lt;/code&gt;, tags the databases it owns, and has a dry run. Upgrade steps are at the bottom.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The problem&lt;/li&gt;
&lt;li&gt;Why it happened&lt;/li&gt;
&lt;li&gt;The fix&lt;/li&gt;
&lt;li&gt;A word of warning&lt;/li&gt;
&lt;li&gt;How to upgrade&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;A reader (Dave Woestenborghs) got in touch to say their SQL Server was filling up with &lt;code&gt;*_wt_*&lt;/code&gt; databases. Each one was a copy of their main site database, and none of them had a worktree any more. The chats were archived, the folders were gone, and the databases were still there.&lt;/p&gt;

&lt;p&gt;I checked mine. Same story. More of them than I'd like to admit.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why it happened
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Archiving a chat doesn't fire &lt;code&gt;WorktreeRemove&lt;/code&gt;.&lt;/strong&gt; I'd assumed it did. The Claude Code &lt;a href="https://code.claude.com/docs/en/hooks#worktreeremove" rel="noopener noreferrer"&gt;hooks docs&lt;/a&gt; say &lt;code&gt;WorktreeRemove&lt;/code&gt; "Runs when Claude Code cleans up a worktree that your &lt;code&gt;WorktreeCreate&lt;/code&gt; hook created", and then list when that happens:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;you exit a worktree session and choose to remove the worktree when prompted (or it's unnamed and has no changed or untracked files)&lt;/li&gt;
&lt;li&gt;you delete a background session that runs in the worktree&lt;/li&gt;
&lt;li&gt;you ask Claude to exit and remove the worktree, and it uses the &lt;code&gt;ExitWorktree&lt;/code&gt; tool&lt;/li&gt;
&lt;li&gt;a &lt;code&gt;claude remote-control&lt;/code&gt; session in worktree mode ends without crashing, or you stop &lt;code&gt;claude remote-control&lt;/code&gt; while such sessions are running, and the worktree has no changes and no new commits&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Archiving isn't on that list. So for anyone who works the way I do (finish the feature, merge the PR, archive the chat), the remove hook never ran. That leaves the &lt;code&gt;SessionStart&lt;/code&gt; sweep as the only clean-up, which is fine, as long as the sweep works.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The sweep only looked at one prefix.&lt;/strong&gt; It matched &lt;code&gt;&amp;lt;current source db&amp;gt;_wt_*&lt;/code&gt;. If you ever renamed your main database (I did, part way through a project), every worktree database copied before the rename has the old prefix, and the sweep never looks at it again. Orphaned for good.&lt;/p&gt;

&lt;h2&gt;
  
  
  The fix
&lt;/h2&gt;

&lt;p&gt;The sweep now works like this:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;It compares against &lt;code&gt;git worktree list&lt;/code&gt;.&lt;/strong&gt; Any database with &lt;code&gt;_wt_&lt;/code&gt; in its name is a candidate. It's kept if its name ends in &lt;code&gt;_wt_&amp;lt;slug&amp;gt;&lt;/code&gt; for a worktree git still lists, or if a listed worktree's &lt;code&gt;appsettings.Local.json&lt;/code&gt; names it. A folder git no longer lists counts as gone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Databases are tagged.&lt;/strong&gt; Every worktree database the hook creates gets a SQL Server extended property, &lt;code&gt;claude_worktree_repo&lt;/code&gt;, holding the main checkout's path. Live databases that are untagged but clearly ours get tagged at session start.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;It only drops what belongs to this repo.&lt;/strong&gt; A tagged database is dropped only if the tag names this repo. An untagged one is dropped only if its prefix is the current source database or one on a legacy list you pass in with &lt;code&gt;-LegacySourceDbs&lt;/code&gt;. Anything else (another repo's tag, an unknown prefix, a tag it can't read) is skipped and logged. This matters if, like me, you reuse the script in more than one project against the same SQL Server. Without it, project B's sweep would happily drop project A's live databases.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;There's a dry run.&lt;/strong&gt; &lt;code&gt;-DryRun&lt;/code&gt; logs what would be dropped, kept and skipped, and drops nothing. &lt;code&gt;-Sweep&lt;/code&gt; runs only the sweep, so you can clean up from the main checkout by hand.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hard stops.&lt;/strong&gt; It never drops the main database or anything without &lt;code&gt;_wt_&lt;/code&gt; in the name, &lt;code&gt;Remove-Db&lt;/code&gt; refuses those even if the decision logic gets it wrong, and if &lt;code&gt;git worktree list&lt;/code&gt; comes back empty the sweep does nothing at all. Every drop, keep and skip is logged.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  A word of warning
&lt;/h2&gt;

&lt;p&gt;This one caught me out. &lt;strong&gt;A hook runs from the worktree you're in.&lt;/strong&gt; If you edit &lt;code&gt;worktree-db.ps1&lt;/code&gt; inside a worktree, the edited version runs at that worktree's next session start, before you've reviewed anything, merged anything or even thought about it. If your change to the sweep is wrong, the databases are gone at the next session start.&lt;/p&gt;

&lt;p&gt;So: change the script, run the dry run by hand, read the list, and only then start a new session. Dropped databases don't come back.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to upgrade
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;1. Grab the updated script.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The full script is on the &lt;a href="https://gist.github.com/OwainWilliams/398ed163a22692ec6944afad7328b97a" rel="noopener noreferrer"&gt;updated Gist&lt;/a&gt;. The &lt;a href="https://gist.github.com/OwainWilliams/55979636355d8a740a121a80ad91afde" rel="noopener noreferrer"&gt;original Gist&lt;/a&gt; from my last post still has the old version. If you've customised yours, these are the pieces to replace or add.&lt;/p&gt;

&lt;p&gt;Two new parameters, two new switches, and an environment variable for the dry run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="k"&gt;param&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$LegacySourceDbs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'none'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$RepoTagName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'claude_worktree_repo'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$WebProject&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'MySite'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$LocalConfigName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'appsettings.Local.json'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$ConnectionStringName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'umbracoDbDSN'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$MediaRootSetting&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'Umbraco:CMS:Global:UmbracoMediaPhysicalRootPath'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$MediaFolder&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'wwwroot\media'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;switch&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$NoMediaSetting&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$Cwd&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$Remove&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;switch&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$Sweep&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="k"&gt;switch&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$DryRun&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$NoMediaSetting&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$MediaRootSetting&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$env&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="no"&gt;WT_SWEEP_DRYRUN&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;eq&lt;/span&gt; &lt;span class="s1"&gt;'1'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$DryRun&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Get-SqlTarget&lt;/code&gt; returns one more thing, the repo id the tag is checked against:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nc"&gt;RepoId&lt;/span&gt;     &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;System&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;IO&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Path&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;GetFullPath&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$MainRoot&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;TrimEnd&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'\')
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reading and writing the tag:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;Get&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;RepoTag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$Target&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$Name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;# Returns the tag value, '' when untagged, or $null when it can't be read&lt;/span&gt;
    &lt;span class="c1"&gt;# (no access, offline, single user): the caller must then leave it alone.&lt;/span&gt;
    &lt;span class="nv"&gt;$q&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$Name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;']'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;']]'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nv"&gt;$t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$RepoTagName&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"'"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"''"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; @&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Invoke&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Sql&lt;/span&gt; &lt;span class="nv"&gt;$Target&lt;/span&gt; &lt;span class="s2"&gt;"SELECT CAST(value AS nvarchar(4000)) FROM [$q].sys.extended_properties WHERE class = 0 AND name = N'$t';"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Count&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;eq&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="s1"&gt;''&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$r&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Trim&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nv"&gt;$null&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;Set&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;RepoTag&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$Target&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$Name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$q&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$Name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;']'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;']]'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nv"&gt;$t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$RepoTagName&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"'"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"''"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nv"&gt;$v&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$Target&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;RepoId&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"'"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"''"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nc"&gt;Invoke&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Sql&lt;/span&gt; &lt;span class="nv"&gt;$Target&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"USE [$q]; IF EXISTS (SELECT 1 FROM sys.extended_properties WHERE class = 0 AND name = N'$t') "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
        &lt;span class="s2"&gt;"EXEC sys.sp_updateextendedproperty @name = N'$t', @value = N'$v'; "&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt;
        &lt;span class="s2"&gt;"ELSE EXEC sys.sp_addextendedproperty @name = N'$t', @value = N'$v';"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nc"&gt;Out&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="kc"&gt;Null&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The heart of it is one function that decides what happens to each candidate. It doesn't touch SQL Server, so it's easy to reason about:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="k"&gt;function&lt;/span&gt; &lt;span class="nc"&gt;Get&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;SweepDecision&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="c1"&gt;# Pure: decides one '_wt_' candidate. Returns Action = Drop | Keep | Skip,&lt;/span&gt;
    &lt;span class="c1"&gt;# Reason, and Tag = $true when a live, untagged, known database should be tagged.&lt;/span&gt;
    &lt;span class="k"&gt;param&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$Name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$Tag&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$RepoId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$SourceDb&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$KnownSourceDbs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$LiveSlugs&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;hashtable&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="nv"&gt;$NamedLive&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;param&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$a&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$r&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$t&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$false&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="kt"&gt;pscustomobject&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;@&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;Action&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$a&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nc"&gt;Reason&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$r&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nc"&gt;Tag&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$t&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$Name&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;ieq&lt;/span&gt; &lt;span class="nv"&gt;$SourceDb&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="s1"&gt;'Keep'&lt;/span&gt; &lt;span class="s1"&gt;'main checkout database'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$Name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;IndexOf&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'_wt_'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;StringComparison&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;OrdinalIgnoreCase&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;lt&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="s1"&gt;'Keep'&lt;/span&gt; &lt;span class="s2"&gt;"no '_wt_' in name"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$null&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;eq&lt;/span&gt; &lt;span class="nv"&gt;$Tag&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="s1"&gt;'Skip'&lt;/span&gt; &lt;span class="s2"&gt;"repo tag unreadable"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="nv"&gt;$known&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$KnownSourceDbs&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nc"&gt;Where&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Object&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$Name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;StartsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"$($_)_wt_"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;StringComparison&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;OrdinalIgnoreCase&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nc"&gt;Select&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Object&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;First&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
    &lt;span class="nv"&gt;$live&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$null&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$NamedLive&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="ow"&gt;and&lt;/span&gt; &lt;span class="nv"&gt;$NamedLive&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;ContainsKey&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$Name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$live&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"named in a listed worktree's local config"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nv"&gt;$slug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$LiveSlugs&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nc"&gt;Where&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Object&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$Name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;EndsWith&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"_wt_$_"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nc"&gt;StringComparison&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="nc"&gt;OrdinalIgnoreCase&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; &lt;span class="nc"&gt;Select&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Object&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;First&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$slug&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nv"&gt;$live&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"slug '$slug' matches a listed worktree"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$Tag&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$Tag&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;ine&lt;/span&gt; &lt;span class="nv"&gt;$RepoId&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="s1"&gt;'Skip'&lt;/span&gt; &lt;span class="s2"&gt;"tagged for another repo ($Tag)"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$live&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="s1"&gt;'Keep'&lt;/span&gt; &lt;span class="nv"&gt;$live&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="s1"&gt;'Drop'&lt;/span&gt; &lt;span class="s1"&gt;'tagged for this repo, no listed worktree'&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="ow"&gt;not&lt;/span&gt; &lt;span class="nv"&gt;$known&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="s1"&gt;'Skip'&lt;/span&gt; &lt;span class="s2"&gt;"untagged, prefix not one of this repo's ($($KnownSourceDbs -join ', '))"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$live&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="s1"&gt;'Keep'&lt;/span&gt; &lt;span class="s2"&gt;"$live; untagged"&lt;/span&gt; &lt;span class="nv"&gt;$true&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&lt;/span&gt; &lt;span class="nv"&gt;$result&lt;/span&gt; &lt;span class="s1"&gt;'Drop'&lt;/span&gt; &lt;span class="s2"&gt;"untagged, prefix '$known', no listed worktree"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Invoke-Sweep&lt;/code&gt; then lists every &lt;code&gt;*_wt_*&lt;/code&gt; database, asks &lt;code&gt;Get-SweepDecision&lt;/code&gt; about each one, and drops, keeps (tagging if asked) or skips it, or just logs it when &lt;code&gt;-DryRun&lt;/code&gt; is on:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$candidates&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; @&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;Invoke&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Sql&lt;/span&gt; &lt;span class="nv"&gt;$Target&lt;/span&gt; &lt;span class="s2"&gt;"SELECT name FROM sys.databases WHERE name LIKE '%\_wt\_%' ESCAPE '\' ORDER BY name;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Remove-Db&lt;/code&gt; loosens its guard from "starts with the current prefix" to "isn't the main database and has &lt;code&gt;_wt_&lt;/code&gt; in it", because the old prefix check is exactly what stopped the old databases being dropped.&lt;/p&gt;

&lt;p&gt;Last piece: in &lt;code&gt;Invoke-SessionStart&lt;/code&gt;, tag the worktree's own database after it's created or found. A restored copy carries whatever tag the source had, so re-set it when it's missing or different.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Set your legacy prefixes.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If you've never renamed your main database, leave &lt;code&gt;-LegacySourceDbs&lt;/code&gt; as &lt;code&gt;none&lt;/code&gt;. If you have, list the old names in the hook command in &lt;code&gt;settings.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"powershell -NoProfile -ExecutionPolicy Bypass -File \"$env:CLAUDE_PROJECT_DIR\\.claude\\hooks\\worktree-db.ps1\" -LegacySourceDbs oldsite,oldersite"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you run the script in more than one project against the same SQL Server, give each project only its own old names. Two projects claiming the same prefix is how you lose someone else's database.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Dry-run it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;From the main checkout, not a worktree:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;powershell&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;NoProfile&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;ExecutionPolicy&lt;/span&gt; &lt;span class="nc"&gt;Bypass&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;File&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;claude&lt;/span&gt;\&lt;span class="n"&gt;hooks&lt;/span&gt;\&lt;span class="n"&gt;worktree&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ps1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Sweep&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;DryRun&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You'll get a line per database, "would drop", "kept" or "skipped", each with a reason, and a total at the end. Read every line. Anything in the "would drop" list that you want to keep, stop here and work out why.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Clean up the orphans.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;When the list looks right, run it for real:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;powershell&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;NoProfile&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;ExecutionPolicy&lt;/span&gt; &lt;span class="nc"&gt;Bypass&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;File&lt;/span&gt; &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;claude&lt;/span&gt;\&lt;span class="n"&gt;hooks&lt;/span&gt;\&lt;span class="n"&gt;worktree&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ps1&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nc"&gt;Sweep&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then check for folders under &lt;code&gt;.claude/worktrees/&lt;/code&gt; that &lt;code&gt;git worktree list&lt;/code&gt; doesn't show. Those are leftovers from archived chats too, and can be deleted by hand.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Commit it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;From then on, every session start does the same sweep. Archive away.&lt;/p&gt;

&lt;p&gt;That's it. The reader who reported it saved me a fair bit of disk space, so thank you. If your server still has a few strays after this, the dry run will tell you why it kept them, which is more than the old version ever did.&lt;/p&gt;

</description>
      <category>umbraco</category>
      <category>claude</category>
    </item>
    <item>
      <title>umbPublisher 1.7.4</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Fri, 06 Nov 2026 13:14:16 +0000</pubDate>
      <link>https://dev.to/owaincodes/umbpublisher-174-3dml</link>
      <guid>https://dev.to/owaincodes/umbpublisher-174-3dml</guid>
      <description>&lt;h1&gt;
  
  
  umbPublisher 1.7.4: descriptions, settings search and a tidy up
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;TL;DR.&lt;/strong&gt; Two releases in one post. 1.6.0 added an optional &lt;strong&gt;Description property&lt;/strong&gt;, so the &lt;code&gt;description:&lt;/code&gt; in your note's frontmatter lands in the Umbraco property of your choice. 1.7.4 rebuilds the settings tab so every setting shows up in Obsidian's settings search, signs the release files, and tidies up a handful of things the Obsidian plugin review flagged. It needs Obsidian 1.14.4 or later. This post was published with it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Ffmyhlttu%2Fumbpublisher-170-mapping.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Ffmyhlttu%2Fumbpublisher-170-mapping.png" alt="umbPublisher 1.7.0 mapping" width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why
&lt;/h2&gt;

&lt;p&gt;For anyone who hasn't come across it, &lt;a href="https://github.com/OwainWilliams/umbPublisher" rel="noopener noreferrer"&gt;umbPublisher&lt;/a&gt; is an Obsidian plugin that pushes your notes into Umbraco 15+ as content, using the Management API. I write everything in Obsidian, so being able to publish from there rather than copy and paste into the backoffice is the whole point.&lt;/p&gt;

&lt;p&gt;Back in 1.5.0 I added tags. The tags in your frontmatter get mapped to an Umbraco Tags property, and that's been working nicely. But most blog document types have another field that's crying out for the same treatment: a description. Whether it's used for a listing page, search results or the meta description, it's a short summary that I'd already written in my note and then had to copy into Umbraco by hand after publishing. Not any more.&lt;/p&gt;

&lt;h2&gt;
  
  
  Descriptions (1.6.0)
&lt;/h2&gt;

&lt;p&gt;Add a &lt;code&gt;description&lt;/code&gt; to your note's frontmatter:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;My&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;post"&lt;/span&gt;
&lt;span class="na"&gt;description&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;A&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;short&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;summary&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;of&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;the&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;post."&lt;/span&gt;
&lt;span class="na"&gt;tags&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="s"&gt;Umbraco&lt;/span&gt;
&lt;span class="nn"&gt;---&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then in &lt;strong&gt;Settings &amp;gt; umbPublisher&lt;/strong&gt;:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Fetch properties&lt;/strong&gt; to load the properties from your document type.&lt;/li&gt;
&lt;li&gt;Pick your property from the &lt;strong&gt;Description property&lt;/strong&gt; dropdown. It sits right under &lt;strong&gt;Tags property&lt;/strong&gt;, in the Optional properties section.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's it. Next time you publish, the description goes along with the note.&lt;/p&gt;

&lt;p&gt;If you don't want to use it, leave the dropdown on &lt;code&gt;[None]&lt;/code&gt; and nothing changes. Notes without a description are fine too. The property just gets left empty.&lt;/p&gt;

&lt;h3&gt;
  
  
  Your property, your choice
&lt;/h3&gt;

&lt;p&gt;Tags were easy because Umbraco only has one way of storing them. Descriptions aren't like that. Some sites use a plain text area, some use a markdown editor and some use a rich text editor. So rather than forcing one, the plugin looks at the property you picked and sends the value in the shape that editor expects:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Property editor&lt;/th&gt;
&lt;th&gt;What gets sent&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Text area or text box&lt;/td&gt;
&lt;td&gt;the description, exactly as written&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Markdown editor&lt;/td&gt;
&lt;td&gt;the description, exactly as written&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rich text editor&lt;/td&gt;
&lt;td&gt;the description, HTML escaped and wrapped in a paragraph&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;One thing to be aware of is that the description is always treated as &lt;strong&gt;plain text&lt;/strong&gt;. If you write markdown or HTML in it, it isn't converted. Sent to a rich text property, a &lt;code&gt;&amp;lt;&lt;/code&gt; or an &lt;code&gt;&amp;amp;&lt;/code&gt; shows up as exactly that, rather than breaking your markup. A description is meant to be a sentence or two, so I kept it simple on purpose.&lt;/p&gt;

&lt;p&gt;It works whether you're using &lt;strong&gt;Property Editor&lt;/strong&gt;, &lt;strong&gt;Block List&lt;/strong&gt; or &lt;strong&gt;Block Grid&lt;/strong&gt; mode. It always goes on the document itself, never inside a block, the same as the title and tags.&lt;/p&gt;

&lt;h3&gt;
  
  
  A couple of gotchas
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Text box length.&lt;/strong&gt; Umbraco's text box property has a 512 character limit by default. If your descriptions run long, map them to a text area instead, otherwise Umbraco will reject the document.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don't double up.&lt;/strong&gt; You can't choose the same property for the description as you've used for the title, content or tags. The plugin checks this before publishing and tells you if you have.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Settings you can actually search for (1.7.4)
&lt;/h2&gt;

&lt;p&gt;Obsidian 1.13 introduced a new way for plugins to describe their settings, and with it came a warning on umbPublisher: its settings wouldn't appear in Obsidian's settings search. Fair enough. Type "client secret" into the search box and you'd get nothing, which isn't great when that's exactly the thing you're hunting for.&lt;/p&gt;

&lt;p&gt;So I rebuilt the settings tab on the new API. Every setting is now searchable, including a few extra search words so "credentials", "frontmatter" or "description" all find the right row. The settings are also grouped under headings now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Umbraco connection.&lt;/strong&gt; Website URL, client ID and client secret.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content location.&lt;/strong&gt; The parent node and the document type to create.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Content mode.&lt;/strong&gt; Property Editor, Block List or Block Grid.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The settings for your mode.&lt;/strong&gt; Title and content for Property Editor, or the block property, element type and content property for Block List and Block Grid.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Optional properties.&lt;/strong&gt; Tags and description.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Everything works the way it did before. The Fetch buttons, the dropdowns and your saved settings are all exactly where you left them, just easier to find.&lt;/p&gt;

&lt;h2&gt;
  
  
  A tidy up from the plugin review (1.7.4)
&lt;/h2&gt;

&lt;p&gt;The Obsidian plugin review turned up a few things worth fixing, so I fixed them.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Signed release files.&lt;/strong&gt; Each release now comes with GitHub artifact attestations for &lt;code&gt;main.js&lt;/code&gt;, &lt;code&gt;manifest.json&lt;/code&gt; and &lt;code&gt;styles.css&lt;/code&gt;. If you like to check what you're installing, you can verify a download with &lt;code&gt;gh attestation verify main.js --repo OwainWilliams/umbPublisher&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No more scanning your vault.&lt;/strong&gt; To find the images in a note, the plugin used to fall back to listing every file in your vault. It now asks Obsidian to resolve the link, the same way Obsidian does when it displays the image, and only ever looks at the images you've actually embedded.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Better GUIDs.&lt;/strong&gt; The IDs for new documents and blocks are now generated from proper cryptographic randomness rather than &lt;code&gt;Math.random&lt;/code&gt;. There was even a helper sitting in the code for this that was never used. Oops.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Housekeeping.&lt;/strong&gt; I swapped out a deprecated Obsidian API and cleared out some unused code, so the linter is finally happy too.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Upgrading
&lt;/h2&gt;

&lt;p&gt;Update the plugin and you're done. Your existing settings are kept, and the Description property starts off as &lt;code&gt;[None]&lt;/code&gt;, so nothing changes until you pick one.&lt;/p&gt;

&lt;p&gt;The one thing to know is that 1.7.4 needs &lt;strong&gt;Obsidian 1.14.4 or later&lt;/strong&gt;. If you're on an older version of Obsidian, you'll stay on umbPublisher 1.6.0, which still has the description feature. Update Obsidian and 1.7.4 will be waiting for you.&lt;/p&gt;

&lt;h2&gt;
  
  
  Thanks
&lt;/h2&gt;

&lt;p&gt;If you're using umbPublisher, I'd love to hear how and please give it a star on GitHub . If there's another field you'd like mapped from your frontmatter, or something isn't working, open an &lt;a href="https://github.com/OwainWilliams/umbPublisher/issues" rel="noopener noreferrer"&gt;issue on GitHub&lt;/a&gt;. That's genuinely how features like this one end up getting built.&lt;/p&gt;

</description>
      <category>umbraco</category>
      <category>obsidian</category>
      <category>umbpublisher</category>
    </item>
    <item>
      <title>Less Coding, More Big Dreaming</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Thu, 05 Nov 2026 10:38:57 +0000</pubDate>
      <link>https://dev.to/owaincodes/less-coding-more-big-dreaming-3mdp</link>
      <guid>https://dev.to/owaincodes/less-coding-more-big-dreaming-3mdp</guid>
      <description>&lt;h1&gt;
  
  
  Less Coding, More Big Dreaming
&lt;/h1&gt;

&lt;p&gt;Earlier this week I read &lt;a href="https://medium.com/@abhijitrana.dev/i-can-fix-the-bug-i-cant-fix-the-fear-of-becoming-irrelevant-ac0dbaaa8899" rel="noopener noreferrer"&gt;I Can Fix the Bug. I Can't Fix the Fear of Becoming Irrelevant&lt;/a&gt; by Abhijit Rana, and it's stuck with me ever since.&lt;/p&gt;

&lt;p&gt;As developers, we're used to adjusting. New frameworks, new tools, new ways of working. It's pretty much constant. But what happens when the adjustment means you don't actually write code any more?&lt;/p&gt;

&lt;p&gt;Remember that thrill when you finally got something working? No more errors. You spin it up and it just works. Where's that gone?&lt;/p&gt;

&lt;h2&gt;
  
  
  The thrill has moved
&lt;/h2&gt;

&lt;p&gt;I've been thinking about this a lot, and I reckon the thrill hasn't gone. It's moved.&lt;/p&gt;

&lt;p&gt;I've hardly written any code recently. I've reviewed thousands of lines of it, but none of it was written by me. Claude does the heavy lifting.&lt;/p&gt;

&lt;p&gt;So what do I actually do now?&lt;/p&gt;

&lt;p&gt;I learn how to make Claude the best fit for whatever I'm trying to do. I look for ways to make it faster and better, to get the most out of it, and I chat to other folks who are trying to do exactly the same thing.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding the right tools
&lt;/h2&gt;

&lt;p&gt;I'm also trying out different tools to see what works for me and the team I work in.&lt;/p&gt;

&lt;p&gt;I started off with the Claude CLI and a load of tabs. Now I'm swapping between Claude Desktop and Kepler from GitKraken. Both are really good at what I need, which is a way to organise my worktrees and keep track of what the heck I'm actually doing. I just haven't settled on a favourite yet.&lt;/p&gt;

&lt;h2&gt;
  
  
  Making life easier for the team
&lt;/h2&gt;

&lt;p&gt;On top of the tools, I'm trying to make life easier for myself and my team.&lt;/p&gt;

&lt;p&gt;I've now got Jira and GitHub connected to Claude. Claude reads my tickets and moves them across the board as the work gets done. It writes test scripts for QA, so they've got detailed manual tests that tell them exactly how to test that specific new feature. PRs get created automatically too, and the descriptions are kept up to date so whoever is reviewing hopefully understands the changes better.&lt;/p&gt;

&lt;p&gt;Sounds great, right? It is. But there's a lot of work going into making it all genuinely useful while keeping it feeling human, if that makes sense.&lt;/p&gt;

&lt;p&gt;The PR descriptions are kept human readable. I'm putting things in place so there's consistency across the team in how Claude writes and reads our spec documentation. Harrie and I have put a load of work into the initial spec files, and that's turning out to make a massive difference to how Claude works on the project.&lt;/p&gt;

&lt;h2&gt;
  
  
  So, should I be scared?
&lt;/h2&gt;

&lt;p&gt;Maybe being a developer isn't about the code we write any more. Maybe it's about building better solutions, ones we could only have dreamt of in the past, in half the time.&lt;/p&gt;

&lt;p&gt;Does the future scare me? Possibly, a bit. But I'm also excited to see what's possible. I think I just need to change how I see my job.&lt;/p&gt;

&lt;p&gt;Less coding. More big dreaming.&lt;/p&gt;

&lt;h2&gt;
  
  
  The point
&lt;/h2&gt;

&lt;p&gt;If you're feeling that same fear Abhijit wrote about, here's what I'd say. The skill hasn't disappeared, it's moved. The code matters less. What matters now is everything around it: the specs, the context, the conventions, making sure what comes out the other end is something a human actually wants to read.&lt;/p&gt;

&lt;p&gt;The single biggest improvement I've seen didn't come from a clever prompt or a new tool. It came from Harrie and me sitting down and writing decent spec files. That's still developer work. It's just a different kind.&lt;/p&gt;

&lt;p&gt;So don't fight it. Learn it, shape it, and make it work the way your team works.&lt;/p&gt;

&lt;p&gt;And it's been a lot of fun. I recently built two new projects that I'd never have dreamt of taking on before. Both of them, combined, in less than a week.&lt;/p&gt;

&lt;p&gt;I'll write about them both soon.&lt;/p&gt;

</description>
      <category>personal</category>
      <category>ai</category>
      <category>thoughts</category>
      <category>claude</category>
    </item>
    <item>
      <title>Umbraco Features with Claude Worktrees</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Thu, 29 Oct 2026 17:26:42 +0000</pubDate>
      <link>https://dev.to/owaincodes/umbraco-features-with-claude-worktrees-5b3e</link>
      <guid>https://dev.to/owaincodes/umbraco-features-with-claude-worktrees-5b3e</guid>
      <description>&lt;h1&gt;
  
  
  One database per git worktree: building Umbraco features in parallel with Claude Code
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;TL;DR.&lt;/strong&gt; I run several Claude Code sessions against the same Umbraco 17 site at once, one feature per session. Claude Code gives each session its own git worktree, so the code is isolated. The database isn't, and uSync happily imports whichever branch started last. So I wrote a PowerShell hook that copies the dev database for every new worktree, points the worktree at that copy, keeps media working, picks ports that don't clash, and drops the lot when the worktree goes. It's about twenty seconds of SQL Server work on session start and then you never think about it again. Install steps are at the bottom.&lt;/p&gt;

&lt;h2&gt;
  
  
  Contents
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;The problem&lt;/li&gt;
&lt;li&gt;Why not just spin up a fresh database?&lt;/li&gt;
&lt;li&gt;Hooking into Claude Code&lt;/li&gt;
&lt;li&gt;What happens on SessionStart&lt;/li&gt;
&lt;li&gt;What happens on WorktreeRemove&lt;/li&gt;
&lt;li&gt;Things that bit me&lt;/li&gt;
&lt;li&gt;What it doesn't do&lt;/li&gt;
&lt;li&gt;Would it work on your project?&lt;/li&gt;
&lt;li&gt;How to install it&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a id="the-problem"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The problem
&lt;/h2&gt;

&lt;p&gt;I've got into the habit of running a few Claude Code sessions at the same time, each one working on a different feature of the same Umbraco site. It's brilliant. One session is building a new block, another is fixing a bug in a controller, and I'm sat in the middle reviewing diffs with a coffee.&lt;/p&gt;

&lt;p&gt;Claude Code makes this possible with git worktrees. A worktree is a second checkout of the same repo in a different folder, on its own branch. Two sessions can edit, build and commit without ever touching each other's files. Perfect.&lt;/p&gt;

&lt;p&gt;Except an Umbraco site isn't just files.&lt;/p&gt;

&lt;p&gt;Our &lt;code&gt;appsettings.Local.json&lt;/code&gt; points at one SQL Server database, and the project has uSync set up like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"uSync"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"Settings"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"ImportAtStartup"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"All"&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That means every time you start the site from a worktree, uSync imports &lt;em&gt;that branch's&lt;/em&gt; document types, data types and compositions into the shared database. Start the site from worktree A, then from worktree B, and B's schema stomps all over A's. Start A again and it stomps right back. The backoffice flips between two versions of the content model and neither session can trust what it's looking at.&lt;/p&gt;

&lt;p&gt;Ports are a second, smaller headache. &lt;code&gt;launchSettings.json&lt;/code&gt; pins the site to &lt;code&gt;https://localhost:44373&lt;/code&gt;, so two worktrees can't even run at the same time. Not ideal when the whole point is running things in parallel.&lt;/p&gt;

&lt;p&gt;&lt;a id="why-not-fresh"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why not just spin up a fresh database?
&lt;/h2&gt;

&lt;p&gt;My first thought was an empty database per worktree and let Umbraco's unattended install do the rest. That falls over almost immediately on this site. uSync here only exports schema (content types, data types, languages, media types), not content, and &lt;code&gt;wwwroot/media&lt;/code&gt; is gitignored. So a fresh install gives you a beautifully empty site with nothing to click on. Not much use for testing a feature.&lt;/p&gt;

&lt;p&gt;What you actually want is a &lt;em&gt;copy&lt;/em&gt; of the main dev database with the branch's schema applied on top. uSync does the second half for free at startup. The first half is a &lt;code&gt;BACKUP ... WITH COPY_ONLY&lt;/code&gt; followed by a &lt;code&gt;RESTORE ... WITH MOVE&lt;/code&gt;, which on a dev sized database takes about twenty seconds. I can live with twenty seconds.&lt;/p&gt;

&lt;p&gt;&lt;a id="hooks"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Hooking into Claude Code
&lt;/h2&gt;

&lt;p&gt;Claude Code has lifecycle hooks, configured in &lt;code&gt;.claude/settings.json&lt;/code&gt;. That file is committed, so once it's in the repo the whole team gets the hooks for free. Two events do everything I need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;SessionStart&lt;/code&gt;&lt;/strong&gt; fires when a session starts, resumes or compacts. Its &lt;code&gt;cwd&lt;/code&gt; is the worktree root. This is where the database gets provisioned.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;WorktreeRemove&lt;/code&gt;&lt;/strong&gt; fires when Claude removes a worktree. This is where the database gets dropped.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There's no hook for "pull request created", and honestly I didn't want one. After the PR goes up you still need the site running to deal with review comments. The lifetime of the worktree is the right lifetime for the database.&lt;/p&gt;

&lt;p&gt;Both events run the same PowerShell script. It reads the event JSON from stdin and branches on &lt;code&gt;hook_event_name&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"SessionStart"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"shell"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"powershell"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"powershell -NoProfile -ExecutionPolicy Bypass -File &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;$env:CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;.claude&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;hooks&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;worktree-db.ps1&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"timeout"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;300&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"WorktreeRemove"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="nl"&gt;"hooks"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"type"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"shell"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"powershell"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"powershell -NoProfile -ExecutionPolicy Bypass -File &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;$env:CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;.claude&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;hooks&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;worktree-db.ps1&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
            &lt;/span&gt;&lt;span class="nl"&gt;"timeout"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mi"&gt;120&lt;/span&gt;&lt;span class="w"&gt;
          &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
        &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a id="session-start"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens on SessionStart
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Work out if this is a worktree, and where the main checkout lives.&lt;/strong&gt; Git will tell you both. In a worktree, &lt;code&gt;--git-dir&lt;/code&gt; is &lt;code&gt;&amp;lt;main&amp;gt;/.git/worktrees/&amp;lt;name&amp;gt;&lt;/code&gt; while &lt;code&gt;--git-common-dir&lt;/code&gt; is &lt;code&gt;&amp;lt;main&amp;gt;/.git&lt;/code&gt;. If they're the same, we're in the main checkout and there's nothing to do.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$gitDir&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-C&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$Path&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;rev-parse&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--path-format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;absolute&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--git-dir&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nv"&gt;$common&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-C&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$Path&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;rev-parse&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--path-format&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;absolute&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--git-common-dir&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nv"&gt;$isWorktree&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$gitDir&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-ne&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$common&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="nv"&gt;$mainRoot&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;Split-Path&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-Parent&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$common&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Read the connection string from the main checkout's &lt;code&gt;appsettings.Local.json&lt;/code&gt;.&lt;/strong&gt; That file is gitignored and specific to each machine, which is exactly why the script reads it rather than hardcoding a server name. Server, database and credentials all come from there, so nothing in the committed script is tied to my laptop.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Sweep.&lt;/strong&gt; Before provisioning anything, list every database named &lt;code&gt;&amp;lt;db&amp;gt;_wt_*&lt;/code&gt; and compare it against &lt;code&gt;git worktree list&lt;/code&gt;. Anything without a matching worktree gets dropped. This runs on every session, including ones in the main checkout, so worktrees that were removed by hand or by the desktop app still get tidied up eventually.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Copy the database.&lt;/strong&gt; The target name comes from the worktree folder, so a worktree at &lt;code&gt;.claude/worktrees/multi-feature-workflow-c09980&lt;/code&gt; gets a database called &lt;code&gt;tgp_wt_multi_feature_workflow_c09980&lt;/code&gt;. The copy uses SQL Server's own default paths, which the server reports through &lt;code&gt;SERVERPROPERTY&lt;/code&gt;, so it works against a remote instance just as well as a local one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;BACKUP&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tgp&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;DISK&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'&amp;lt;InstanceDefaultBackupPath&amp;gt;&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s1"&gt;gp_worktree_seed.bak'&lt;/span&gt;
  &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;COPY_ONLY&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;INIT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;FORMAT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;RESTORE&lt;/span&gt; &lt;span class="n"&gt;FILELISTONLY&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;DISK&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'...'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;  &lt;span class="c1"&gt;-- to get the logical file names&lt;/span&gt;

&lt;span class="n"&gt;RESTORE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tgp_wt_&lt;/span&gt;&lt;span class="p"&gt;...]&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;DISK&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'...'&lt;/span&gt;
  &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="k"&gt;MOVE&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'tgp'&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'&amp;lt;InstanceDefaultDataPath&amp;gt;&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s1"&gt;gp_wt_....mdf'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="k"&gt;MOVE&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'tgp_log'&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="n"&gt;N&lt;/span&gt;&lt;span class="s1"&gt;'&amp;lt;InstanceDefaultLogPath&amp;gt;&lt;/span&gt;&lt;span class="se"&gt;\t&lt;/span&gt;&lt;span class="s1"&gt;gp_wt_..._log.ldf'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
       &lt;span class="k"&gt;REPLACE&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;RECOVERY&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;COPY_ONLY&lt;/code&gt; matters here. It doesn't disturb the backup chain if your dev database happens to be in full recovery mode.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Write the worktree's own &lt;code&gt;appsettings.Local.json&lt;/code&gt;.&lt;/strong&gt; It's a copy of the main one with the database name swapped out, plus one extra Umbraco setting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"Umbraco"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"CMS"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="nl"&gt;"Global"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
      &lt;/span&gt;&lt;span class="nl"&gt;"UmbracoMediaPhysicalRootPath"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"C:&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;...&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;TGP&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;TGP&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;wwwroot&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;media"&lt;/span&gt;&lt;span class="w"&gt;
    &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Media files aren't in git, so without this the worktree would show broken images everywhere. &lt;code&gt;UmbracoMediaPhysicalRootPath&lt;/code&gt; points Umbraco at the main checkout's media folder instead. I'd originally planned a directory junction for this and bottled it. &lt;code&gt;git worktree remove --force&lt;/code&gt; deletes the worktree directory, and I really didn't fancy finding out whether it follows junctions into the real media folder. A config setting can't delete anything. Much safer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Pick some ports and tell Claude.&lt;/strong&gt; A hash of the worktree name gives a stable pair of ports in the 45000 range. The script checks they're free and saves them into the generated config, so later sessions print the same pair even while the site is running. Then it writes one line to stdout:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Worktree database 'tgp_wt_multi_feature_workflow_c09980' on INI-WIN-066 is ready
(copy of 'tgp'; media served from the main checkout). Run the site from TGP with:
dotnet run --urls "https://localhost:45980;http://localhost:45981"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Whatever a &lt;code&gt;SessionStart&lt;/code&gt; hook prints to stdout gets added to Claude's context. So every session starts already knowing which database it owns and how to run the site. Nobody has to type anything.&lt;/p&gt;

&lt;p&gt;&lt;a id="worktree-remove"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens on WorktreeRemove
&lt;/h2&gt;

&lt;p&gt;Drop the database, then remove the worktree:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tgp_wt_&lt;/span&gt;&lt;span class="p"&gt;...]&lt;/span&gt; &lt;span class="k"&gt;SET&lt;/span&gt; &lt;span class="n"&gt;SINGLE_USER&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="k"&gt;ROLLBACK&lt;/span&gt; &lt;span class="k"&gt;IMMEDIATE&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;DROP&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;tgp_wt_&lt;/span&gt;&lt;span class="p"&gt;...];&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;-C&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$mainRoot&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;worktree&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;remove&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--force&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;$worktreePath&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That second step caught me out. Registering a &lt;code&gt;WorktreeRemove&lt;/code&gt; hook &lt;em&gt;replaces&lt;/em&gt; Claude Code's default removal. So if your script only drops the database, the worktree folder just sits there. The hook has to do the &lt;code&gt;git worktree remove&lt;/code&gt; itself, and exit with an error code if the folder is still around afterwards.&lt;/p&gt;

&lt;p&gt;&lt;a id="things-that-bit-me"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Things that bit me
&lt;/h2&gt;

&lt;p&gt;I'd love to say this all worked first time. It did not.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;$result[0]&lt;/code&gt; on a single row from sqlcmd.&lt;/strong&gt; PowerShell unrolls an array with one element into a plain string, and &lt;code&gt;[0]&lt;/code&gt; on a string gives you its first character. My backup path became &lt;code&gt;C&lt;/code&gt;, which SQL Server helpfully resolved relative to its default backup folder as &lt;code&gt;...\Backup\C\tgp_worktree_seed.bak&lt;/code&gt;. Wrap it in &lt;code&gt;@(...)[0]&lt;/code&gt; and move on with your life.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;$ErrorActionPreference = 'Stop'&lt;/code&gt; and native commands.&lt;/strong&gt; In Windows PowerShell 5.1, a native exe writing anything to stderr under &lt;code&gt;Stop&lt;/code&gt; becomes a terminating error. The script runs with &lt;code&gt;Continue&lt;/code&gt; and checks &lt;code&gt;$LASTEXITCODE&lt;/code&gt; explicitly instead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;$env:CLAUDE_PROJECT_DIR&lt;/code&gt; is the main checkout, not the worktree.&lt;/strong&gt; Use it to find the script. Use the event's &lt;code&gt;cwd&lt;/code&gt; for the worktree.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The port probe sees your own site.&lt;/strong&gt; On a resumed session the hook ran while the worktree's site was already up, saw its own ports as busy, and cheerfully printed a different pair. Hence persisting the ports in the generated config.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Builds touch tracked files.&lt;/strong&gt; Umbraco regenerates &lt;code&gt;umbraco-package-schema.json&lt;/code&gt; on every build. Not a hook problem, but it shows up in &lt;code&gt;git status&lt;/code&gt; after you've tested, so keep an eye out.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a id="what-it-doesnt-do"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What it doesn't do
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;It's Windows PowerShell plus &lt;code&gt;sqlcmd&lt;/code&gt;. No bash version yet. Sorry Mac folks.&lt;/li&gt;
&lt;li&gt;It needs a SQL Server you can &lt;code&gt;BACKUP&lt;/code&gt; and &lt;code&gt;RESTORE&lt;/code&gt; against: a local instance, Express, LocalDB or a dev server. Azure SQL has no &lt;code&gt;BACKUP DATABASE&lt;/code&gt;, so that's out.&lt;/li&gt;
&lt;li&gt;It assumes one worktree runs one site. Two sites in the same worktree would still collide.&lt;/li&gt;
&lt;li&gt;The desktop app's own worktree cleanup may not fire &lt;code&gt;WorktreeRemove&lt;/code&gt;. The sweep on the next session start covers it, so the worst case is a stale database hanging around for a few hours.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a id="your-project"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Would it work on your project?
&lt;/h2&gt;

&lt;p&gt;Yes, if you're on Windows with a SQL Server you can back up. All the bits that are specific to my project are parameters with sensible defaults. Another Umbraco site needs at most the web project folder name. A .NET site that isn't Umbraco adds the connection string name and switches the media setting off:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"command"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"powershell -NoProfile -ExecutionPolicy Bypass -File &lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt;$env:CLAUDE_PROJECT_DIR&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;.claude&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;hooks&lt;/span&gt;&lt;span class="se"&gt;\\&lt;/span&gt;&lt;span class="s2"&gt;worktree-db.ps1&lt;/span&gt;&lt;span class="se"&gt;\"&lt;/span&gt;&lt;span class="s2"&gt; -WebProject MySite -ConnectionStringName DefaultConnection -NoMediaSetting"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything else (server, credentials, source database) is read from your own local config at runtime. You can also run the script by hand with &lt;code&gt;-Cwd &amp;lt;worktree&amp;gt;&lt;/code&gt; or &lt;code&gt;-Remove &amp;lt;worktree&amp;gt;&lt;/code&gt; to try it outside Claude Code.&lt;/p&gt;

&lt;p&gt;It took about an hour to build, and the combination is what makes it worth it. A copy of the real database. The branch's schema applied by uSync on first run. Media still visible. Ports that don't clash. The whole thing torn down when the worktree goes. Parallel sessions stop being something you manage and become something that just happens.&lt;/p&gt;

&lt;p&gt;&lt;a id="install"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  How to install it
&lt;/h2&gt;

&lt;p&gt;Here's the step by step. This assumes Windows, Windows PowerShell 5.1, and Claude Code with worktrees turned on.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Check the prerequisites.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A SQL Server you can &lt;code&gt;BACKUP&lt;/code&gt; and &lt;code&gt;RESTORE&lt;/code&gt; against (local instance, Express, LocalDB or a dev server).&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sqlcmd&lt;/code&gt; on your PATH. Open a terminal and run &lt;code&gt;sqlcmd -?&lt;/code&gt; to make sure it's there.&lt;/li&gt;
&lt;li&gt;An &lt;code&gt;appsettings.Local.json&lt;/code&gt; in your main checkout with a working connection string. The script reads this, so if the site already runs from your main checkout you're good.&lt;/li&gt;
&lt;li&gt;If it's an Umbraco site, uSync with &lt;code&gt;ImportAtStartup&lt;/code&gt; turned on, otherwise the branch's schema won't land in the copied database.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Grab the script.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gist.github.com/OwainWilliams/55979636355d8a740a121a80ad91afde" rel="noopener noreferrer"&gt;Full script is on Gist&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Drop it into your repo at &lt;code&gt;.claude/hooks/worktree-db.ps1&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Register the hooks.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open &lt;code&gt;.claude/settings.json&lt;/code&gt; (create it if it doesn't exist) and add the &lt;code&gt;SessionStart&lt;/code&gt; and &lt;code&gt;WorktreeRemove&lt;/code&gt; entries from the hooks section above. Both point at the same script.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Adjust the parameters if you need to.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The defaults assume an Umbraco site with the standard Umbraco connection string name. If your web project folder has a different name, add &lt;code&gt;-WebProject YourFolder&lt;/code&gt; to the command. If it's not an Umbraco site, add &lt;code&gt;-ConnectionStringName YourConnectionString -NoMediaSetting&lt;/code&gt; as well.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Test it by hand first.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a worktree and run the script against it directly, so you're not debugging through Claude:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git worktree add .claude/worktrees/test-db &lt;span class="nt"&gt;-b&lt;/span&gt; test-db
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;powershell &lt;span class="nt"&gt;-NoProfile&lt;/span&gt; &lt;span class="nt"&gt;-ExecutionPolicy&lt;/span&gt; Bypass &lt;span class="nt"&gt;-File&lt;/span&gt; .claude&lt;span class="se"&gt;\h&lt;/span&gt;ooks&lt;span class="se"&gt;\w&lt;/span&gt;orktree-db.ps1 &lt;span class="nt"&gt;-Cwd&lt;/span&gt; .claude&lt;span class="se"&gt;\w&lt;/span&gt;orktrees&lt;span class="se"&gt;\t&lt;/span&gt;est-db
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should see the "Worktree database ... is ready" line and a new &lt;code&gt;&amp;lt;db&amp;gt;_wt_test_db&lt;/code&gt; database on your server. Then tear it down:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;powershell &lt;span class="nt"&gt;-NoProfile&lt;/span&gt; &lt;span class="nt"&gt;-ExecutionPolicy&lt;/span&gt; Bypass &lt;span class="nt"&gt;-File&lt;/span&gt; .claude&lt;span class="se"&gt;\h&lt;/span&gt;ooks&lt;span class="se"&gt;\w&lt;/span&gt;orktree-db.ps1 &lt;span class="nt"&gt;-Remove&lt;/span&gt; .claude&lt;span class="se"&gt;\w&lt;/span&gt;orktrees&lt;span class="se"&gt;\t&lt;/span&gt;est-db
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The database and the worktree folder should both be gone.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Start a Claude Code session in a worktree.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Open the project in Claude Code with worktrees enabled and start a new session. The first thing in Claude's context should be the "Worktree database ... is ready" line with your &lt;code&gt;dotnet run&lt;/code&gt; command. Run the site on the ports it gives you and check the backoffice loads with your content and media intact.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7. Commit it.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Commit &lt;code&gt;.claude/settings.json&lt;/code&gt; and &lt;code&gt;.claude/hooks/worktree-db.ps1&lt;/code&gt; so the rest of the team gets the same setup. Leave &lt;code&gt;appsettings.Local.json&lt;/code&gt; gitignored as it always was.&lt;/p&gt;

&lt;p&gt;That's it. From now on every worktree gets its own database on the way in and loses it on the way out, and you can get back to running three features at once with a coffee in hand.&lt;/p&gt;

&lt;p&gt;Update 30/10/2026&lt;br&gt;&lt;br&gt;
Since posting this last night, I've had a number of people either comment on my socials, posted comments below or DM me.&lt;br&gt;&lt;br&gt;
I thought I'd add a couple of updates.   &lt;/p&gt;

&lt;p&gt;One possible way to get around the backoffice token issue is to setup an &lt;a href="https://umbraco.com" rel="noopener noreferrer"&gt;Umbraco&lt;/a&gt; API user in the backoffice, setup a local .env file with the credentials and then get your agent to use the Umbraco CLI Skill so it doesn't need to log in anymore. (thanks &lt;a href="https://github.com/Matthew-Wise" rel="noopener noreferrer"&gt;Matt Wise&lt;/a&gt;).  &lt;/p&gt;

&lt;p&gt;Kevin jump also read this blog and dusted off a previous idea he had and he's now released a uSync.Treebranch package - &lt;a href="https://github.com/KevinJump/uSync.TreeBranch" rel="noopener noreferrer"&gt;https://github.com/KevinJump/uSync.TreeBranch&lt;/a&gt; its still in early development but it could be worth a look at.&lt;/p&gt;

</description>
      <category>umbraco</category>
      <category>claude</category>
    </item>
    <item>
      <title>Stop apologising for using AI</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Fri, 23 Oct 2026 07:48:54 +0000</pubDate>
      <link>https://dev.to/owaincodes/stop-apologising-for-using-ai-39hf</link>
      <guid>https://dev.to/owaincodes/stop-apologising-for-using-ai-39hf</guid>
      <description>&lt;h1&gt;
  
  
  Stop apologising for using AI
&lt;/h1&gt;

&lt;p&gt;How long do you think it'll be until we stop saying "with 's help" or "I wrote this with " as if it's a bad thing? Let's admit it, if you aren't using AI in some way in your job, you're one of the very few.&lt;/p&gt;

&lt;p&gt;Take my recent code contributions to H5YR.com. Every single one of them is coauthored by me and Claude. Is that something I should be hiding? Or apologising for?&lt;/p&gt;

&lt;p&gt;I feel like we, as developers, are almost guilty that we're no longer handwriting code, so we have to caveat everything with "well, I say I wrote it, but actually AI did".&lt;/p&gt;

&lt;h2&gt;
  
  
  Did I ever really write it?
&lt;/h2&gt;

&lt;p&gt;Even in my time in this industry, things have moved along pretty quickly. The first program I wrote was in BASIC on a ZX Spectrum. It printed a hello world message to the screen. Simple, but I wrote it. Or did I? I copied it from a book. So does that count as me writing it?&lt;/p&gt;

&lt;p&gt;I then moved on from my trusty ZX Spectrum and got a PC. Now I was running MS-DOS, writing .bat files and, again, learning from magazines and books. No internet was available to me back then. Wow, I'm old.&lt;/p&gt;

&lt;p&gt;Then I got a PC that ran Windows 95 and all of a sudden a world of colour appeared before my eyes. Instead of using the command line, I had a GUI and I could code in Notepad! This was a massive step forward for me and it's when my interest in coding really started to grow.&lt;/p&gt;

&lt;p&gt;I went from Notepad to Dreamweaver, then from Dreamweaver back to Notepad because I didn't like not having control. I then started coding at school, where I was introduced to Visual Basic (and I still hacked around in the actual files in Notepad when I couldn't get the GUI to do what I wanted!).&lt;/p&gt;

&lt;p&gt;Can you see where I'm going with this? Then we got Visual Studio with IntelliSense and autocomplete, another step forward in making a developer's life easier.&lt;/p&gt;

&lt;p&gt;And let's not forget Stack Overflow. How many of us have copied an answer straight from there into our code? Plenty. But I don't remember anyone writing "I wrote this with Stack Overflow's help" in their commit messages.&lt;/p&gt;

&lt;h2&gt;
  
  
  AI is just the next step
&lt;/h2&gt;

&lt;p&gt;I see AI as the next step forward, but this time it hasn't taken years for people to adopt it. It's happened, what feels like, overnight. I think this is why people feel guilty or apologetic about it.&lt;/p&gt;

&lt;p&gt;What we should be apologetic about is using it as an excuse for bad code.&lt;/p&gt;

&lt;p&gt;"Oh, I didn't write that, Claude did." Nope, sorry, you prompted it. You brought it into this world, so you own it now. It's still your code. You should understand it and you should know why it's doing what it's doing.&lt;/p&gt;

&lt;h2&gt;
  
  
  With great power
&lt;/h2&gt;

&lt;p&gt;The models available to us now are super powerful, but we control that power. "With great power comes great responsibility." We owe it to ourselves, and our future selves, to still be proud of the code we create.&lt;/p&gt;

&lt;p&gt;Today's models learned from the code we all put out into the world, and tomorrow's will too. If the internet fills up with sloppy AI code that nobody checked, guess what the next models learn from? But if we publish code that AI helped write and we've actually reviewed and refined, the next lot of tools get better. That's on us.&lt;/p&gt;

&lt;h2&gt;
  
  
  So what does owning it actually look like?
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Read your own PR before anyone else reviews it.&lt;/strong&gt; If you haven't read it, why should they?&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Be able to explain your own code.&lt;/strong&gt; If someone asks why it works the way it does, "Claude did it" isn't an answer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Make sure your tests are actually useful.&lt;/strong&gt; If you use tests, check they're testing something meaningful and not just passing for the sake of it. Better yet, write the tests yourself.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Own your code
&lt;/h2&gt;

&lt;p&gt;So, all I ask of you as a developer in 2026 is this. Own your code. Don't use Claude as an excuse. Stop even saying "Oh, I made this with Claude / Copilot / whatever you use". We all know you have. So let's just get back to building the stuff we only dreamt of in the past, and embrace the change.&lt;/p&gt;

&lt;h2&gt;
  
  
  A small confession
&lt;/h2&gt;

&lt;p&gt;Yes, I see the irony. I've just spent a whole post telling you to stop saying it, so here goes. I wrote this post myself, then I asked Claude to read it, fix my grammar and help me improve it. It found more than I'd like to admit. But it's still my post, and I'm owning it.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>development</category>
      <category>opinion</category>
      <category>personal</category>
    </item>
    <item>
      <title>Umbraco UK Conference</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Wed, 21 Oct 2026 13:18:02 +0000</pubDate>
      <link>https://dev.to/owaincodes/umbraco-uk-conference-11l</link>
      <guid>https://dev.to/owaincodes/umbraco-uk-conference-11l</guid>
      <description>&lt;h2&gt;
  
  
  Umbraco UK Conference: A Few Days in London
&lt;/h2&gt;

&lt;p&gt;Coffee. Code. Repeat. And this week, a fair bit of whisky and doughnuts too.&lt;/p&gt;

&lt;p&gt;I've just got back from London after the Umbraco UK Partner Summit and the Umbraco UK Conference. It was a packed few days, and I learnt a lot, so let's get into it. Fair warning, the journey home was a bit of an adventure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Wednesday: Trains and Whisky
&lt;/h3&gt;

&lt;p&gt;I jumped on the train from Edinburgh down to London on Wednesday. I arrived in time for lunch and then met up with a couple of friends, Matt Wise and Ollie Picton. We headed to the Scotch Malt Whisky Society on Greville Street in Hatton Garden.&lt;/p&gt;

&lt;p&gt;Very enjoyable afternoon. Great company, a good catch up and a chance to try the latest offerings from the SMWS. Perfect.&lt;/p&gt;

&lt;p&gt;Then an early night back at the hotel. I knew what was coming.&lt;/p&gt;

&lt;h3&gt;
  
  
  Thursday: Umbraco UK Partner Summit
&lt;/h3&gt;

&lt;p&gt;Up early, breakfast, and off to the Partner Summit.&lt;/p&gt;

&lt;p&gt;I'll be honest. I've been to Partner Summits before and they were always a bit, meh. Lots of promises, not much action. I'm very pleased to say this year was different. I went along as the Initials Labs rep and came away with pages and pages of notes. I'm really looking forward to working with the Umbraco partner team (Aaron, Jacob and Gemma) to see what's possible over the next year.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Fc5wjh15k%2Fpartnersummitcoffee.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Fc5wjh15k%2Fpartnersummitcoffee.jpeg" alt="partnerSummitCoffee" width="480" height="542"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Some highlights:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Jenny Bradshaw from Moriyama and Kirstie Buchanan from Cantarus&lt;/strong&gt; gave really great talks about their own experiences with Umbraco and as partners.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Aaron Green (Partner Manager, UK) and Jacob Howell (Regional Manager, UK)&lt;/strong&gt; delivered great business talks. The passion these guys have for Umbraco is refreshing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rune Strand (Product Manager, Cloud)&lt;/strong&gt; talked about the future of Umbraco Cloud. It finally feels like a product you can use in the real world.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mats Persson (CEO) and Filip Bruun Bech-Larsen (Umbraco CTO)&lt;/strong&gt; also gave great talks about Umbraco and its products, and brought all the partners up to date.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All in all, a brilliant day. Not something I thought I'd ever say about a business summit!&lt;/p&gt;

&lt;h3&gt;
  
  
  Thursday Evening: Flight Club
&lt;/h3&gt;

&lt;p&gt;That evening was all about socialising at Flight Club. I got to make new friends within the community and chat with fellow Umbracians I hadn't seen since Codegarden.&lt;/p&gt;

&lt;p&gt;It was great to see my old pals from Gibe too. Always a pleasure, especially when you end the night drinking whisky with Tristan. Hmm, there might be a theme here.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2F0ctn3psc%2Fumbraco-conference.js" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2F0ctn3psc%2Fumbraco-conference.js" alt="Umbraco Conference" width="" height=""&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Friday: Umbraco UK Conference
&lt;/h3&gt;

&lt;p&gt;Friday started with breakfast, then I met up with my colleague Jack and we walked over to CodeNode, where the conference was being hosted. We collected our swag, grabbed a coffee (the first of many) and the day kicked off.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Fm2ajluwl%2Fnamebadge.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Fm2ajluwl%2Fnamebadge.jpeg" alt="NameBadge" width="480" height="853"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The new Umbraco Conference brand was announced, and having the rebrand explained was really interesting. After that, Bolette Kern (Head of Products at Umbraco) gave the keynote and product update, and she did it on her birthday! Happy birthday Bolette!&lt;/p&gt;

&lt;p&gt;Here are the talks I attended:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automate in Minutes, Not Sprints: Introducing Umbraco Automate, by Rick Butterfield&lt;/li&gt;
&lt;li&gt;Beyond the Happy Path: Non-Functional Requirements in the Age of AI-Assisted Engineering, by Carole Rennie Logan&lt;/li&gt;
&lt;li&gt;CSI: Umbraco, Forensic Tools for Catching Performance Killers, by Jason Elkin&lt;/li&gt;
&lt;li&gt;Ghosts of Umbraco Past: Coding Practices to Lay to Rest in 2027, by Joe Glombek&lt;/li&gt;
&lt;li&gt;The Great Umbraco Search Shake-Up: Examine, Algolia &amp;amp; Azure Compared, by Busra Sengul&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;They were all great talks and I don't want to pick a favourite. I got something from every one of them.&lt;/p&gt;

&lt;p&gt;The time and effort that goes into preparing a talk is always appreciated, so #h5yr (that's high five, for the uninitiated. More details at &lt;a href="https://h5yr.com" rel="noopener noreferrer"&gt;H5YR.com&lt;/a&gt;) to everyone who spoke at the event.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Flo3pco5t%2Flego.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2Flo3pco5t%2Flego.jpeg" alt="lego" width="480" height="853"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The QR code on our badges was for a fun game of The Traitors. You had to scan other people's QR codes, and if you were a Traitor, you "killed" them and they were out of the game. If you were a Faithful, your aim was to stay alive and scan as many people as you could. The more scans you got, the better the prize. The first tier was a Lego minifigure, which, thankfully, I managed to get. The top prize was a ticket to Codegarden!&lt;/p&gt;

&lt;p&gt;It was a lot of fun and a great way to get people talking to each other.&lt;/p&gt;

&lt;p&gt;Now, the food. The food at the event was great and the snacks were immense. The doughnuts were so good I could have eaten the entire box. Biscoff doughnuts. Yum!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2F5vlpu1ez%2Fdonuts.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2F5vlpu1ez%2Fdonuts.jpeg" alt="donuts" width="480" height="853"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The closing keynote came from Lotte Pitcher and Sebastiaan Janssen, and it was really good. Funny but informative. Oh, and did you know that backoffice menu separators are back? Yes, really.&lt;/p&gt;

&lt;p&gt;I spent the evening socialising with new and old friends and called it a night around 10pm. Back to the hotel to pack my bag.&lt;/p&gt;

&lt;h3&gt;
  
  
  Saturday: Board Games and a Very Long Way Home
&lt;/h3&gt;

&lt;p&gt;On Saturday I met up with a few friends and headed to Arcanists Tavern, a table top game cafe. A great selection of games and a really nice way to spend a few hours before heading back to Edinburgh.&lt;/p&gt;

&lt;p&gt;Then came the journey home, which was eventful. I got within 15 minutes of Edinburgh station and the train stopped. Then it started going in the opposite direction. We couldn't go any further because the signals on the track had gone out! I ended up having to ask my wife to come and pick me up, which was a 45 minute drive each way. Not great at 11pm!&lt;/p&gt;

&lt;h3&gt;
  
  
  Wrapping Up
&lt;/h3&gt;

&lt;p&gt;A fantastic few days in London, signal failure aside. I learnt a lot, made some new connections and caught up with old friends.&lt;/p&gt;

&lt;p&gt;Until next time!&lt;/p&gt;

</description>
      <category>umbraco</category>
      <category>conference</category>
      <category>london</category>
    </item>
    <item>
      <title>Beta Blast: A Bouldering Bubble Shooter Built with Claude</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Mon, 12 Oct 2026 16:30:40 +0000</pubDate>
      <link>https://dev.to/owaincodes/beta-blast-a-bouldering-bubble-shooter-built-with-claude-323b</link>
      <guid>https://dev.to/owaincodes/beta-blast-a-bouldering-bubble-shooter-built-with-claude-323b</guid>
      <description>&lt;h1&gt;
  
  
  I asked Claude for a Puzzle Bobble clone. It built a climbing game with a global leaderboard.
&lt;/h1&gt;

&lt;p&gt;&lt;strong&gt;Beta Blast&lt;/strong&gt;: shoot coloured climbing holds at a wall, pop three or more, send the route. Playable in your browser right now, free, no install.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9nt4eraiwcqnwj7qyvwd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F9nt4eraiwcqnwj7qyvwd.png" alt="Beta Blast gameplay" width="540" height="720"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It started with one question: &lt;em&gt;"What's a good tech stack to make a replica of Puzzle Bobble?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A few hours of chatting later I had a finished, deployed game. I wrote none of the code and that's OK. &lt;/p&gt;

&lt;h2&gt;
  
  
  What's in it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🧗 &lt;strong&gt;Endless grades.&lt;/strong&gt; V0, V1, V2 and on, getting harder with no ceiling&lt;/li&gt;
&lt;li&gt;📅 &lt;strong&gt;Daily Boulder.&lt;/strong&gt; One route a day, the same for everyone&lt;/li&gt;
&lt;li&gt;⏱️ &lt;strong&gt;Survival.&lt;/strong&gt; The wall keeps dropping, the music speeds up, and the stages ramp up&lt;/li&gt;
&lt;li&gt;🛠️ &lt;strong&gt;Route Setter.&lt;/strong&gt; Build your own wall and share it as a link&lt;/li&gt;
&lt;li&gt;👥 &lt;strong&gt;2-player over the internet.&lt;/strong&gt; Pop holds to send rows to your opponent&lt;/li&gt;
&lt;li&gt;🏆 &lt;strong&gt;A global leaderboard&lt;/strong&gt;, with a climber icon next to every score&lt;/li&gt;
&lt;li&gt;🧢 &lt;strong&gt;Customisable climber.&lt;/strong&gt; Beanie, shirt and chalk bag colours unlock as you play&lt;/li&gt;
&lt;li&gt;🔌 &lt;strong&gt;A public API and a one-line embed&lt;/strong&gt;, so any website can show the leaderboard&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flvht715u76h4f0o6ig5q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Flvht715u76h4f0o6ig5q.png" alt="The leaderboard" width="540" height="720"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The stack
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Part&lt;/th&gt;
&lt;th&gt;What it uses&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Game&lt;/td&gt;
&lt;td&gt;TypeScript, &lt;a href="https://phaser.io" rel="noopener noreferrer"&gt;Phaser 3&lt;/a&gt;, Vite&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Art and sound&lt;/td&gt;
&lt;td&gt;Drawn and synthesised in code. &lt;strong&gt;There are no image or audio files.&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;2-player&lt;/td&gt;
&lt;td&gt;PeerJS (WebRTC), so no game server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Leaderboard&lt;/td&gt;
&lt;td&gt;Cloudflare Workers + D1 (SQLite), on the free plan&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Hosting&lt;/td&gt;
&lt;td&gt;GitHub Pages and a custom domain, deployed by GitHub Actions&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Quality&lt;/td&gt;
&lt;td&gt;236 tests, a bot that plays every grade to check the difficulty, and CI on every pull request&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Why it was fun
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;I made the creative calls, Claude did the typing.&lt;/strong&gt; I picked the theme (climbers shooting holds), the name, and which feature came next. Claude proposed options, built them, and opened the pull requests. I mostly said "yes, do that."&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It checked its own work.&lt;/strong&gt; It ran the game in a headless browser, looked at its own screenshots and fixed what looked wrong. When I asked for a full review it found real bugs, such as a network blip that ended live matches, and fixed them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It handled the boring, essential parts.&lt;/strong&gt; Tests, CI, deploys, the Cloudflare setup, the README and the screenshots in it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Anti-cheat was a good problem.&lt;/strong&gt; Scores come from the browser, so anyone can fake one. The game now records every shot and can replay a run on the server through the same engine to check the score. It's off on the free plan, because a replay costs more CPU than the free tier allows. Claude measured that, told me, and let me pick. That kind of trade-off is what I'd want from a human colleague too.&lt;/p&gt;

&lt;h2&gt;
  
  
  The honest bits
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;It wasn't one prompt. It was a long conversation, with me playing the game and steering.&lt;/li&gt;
&lt;li&gt;Things broke along the way: a deploy that needed Pages switched on, a leaderboard that looked empty because it opened on the wrong board. We fixed each one.&lt;/li&gt;
&lt;li&gt;Claude can't tap a real phone screen or feel whether a shot is satisfying. That part is still me.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;🎮 &lt;strong&gt;Play:&lt;/strong&gt; &lt;a href="https://thesecretstage.vip/Beta-Blast/" rel="noopener noreferrer"&gt;https://thesecretstage.vip/Beta-Blast/&lt;/a&gt;&lt;br&gt;
💻 &lt;strong&gt;Code:&lt;/strong&gt; &lt;a href="https://github.com/OwainWilliams/Beta-Blast" rel="noopener noreferrer"&gt;https://github.com/OwainWilliams/Beta-Blast&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add the leaderboard to your own site with one line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;script &lt;/span&gt;&lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;"https://thesecretstage.vip/Beta-Blast/embed.js"&lt;/span&gt; &lt;span class="na"&gt;data-board=&lt;/span&gt;&lt;span class="s"&gt;"daily"&lt;/span&gt; &lt;span class="na"&gt;async&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you've been sitting on a "wouldn't it be cool if" project, this is your sign. Open a conversation, describe it, and see how far an afternoon goes.&lt;/p&gt;

&lt;p&gt;I've a load of other features I want to add to this, one will be an Umbraco themed version, a 4 player version and maybe some other features that I liked from old online games such as TetriNet (anyone else remember that?)&lt;/p&gt;

&lt;p&gt;If you have a feature you'd like to see, create an issue on the repo and we can chat about it.&lt;/p&gt;

</description>
      <category>claude</category>
      <category>retrogame</category>
    </item>
    <item>
      <title>The coffee log, rebuilt in .NET</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Fri, 02 Oct 2026 11:24:10 +0000</pubDate>
      <link>https://dev.to/owaincodes/the-coffee-log-rebuilt-in-net-25md</link>
      <guid>https://dev.to/owaincodes/the-coffee-log-rebuilt-in-net-25md</guid>
      <description>&lt;h1&gt;
  
  
  The coffee log, rebuilt in .NET
&lt;/h1&gt;

&lt;p&gt;Back in June I wrote about &lt;a href="https://owain.codes/blog/2026/june/its-coffee-time" rel="noopener noreferrer"&gt;my coffee machine writing my blog&lt;/a&gt;. Smart plug watches the coffee machine, Raspberry Pi watches the plug, bit of Python tells Umbraco I've made a coffee. If you've not read that one, go and read it first, it covers the plug, the KLAP handshake, the controller on the site, all of it. None of that has changed.&lt;/p&gt;

&lt;p&gt;So why am I writing about it again? Because I've ripped out the middle bit and rewritten it in .NET. And I know, I know, "it worked, why touch it?" Fair question. Let me explain.&lt;/p&gt;

&lt;h2&gt;
  
  
  It worked. I just couldn't remember how.
&lt;/h2&gt;

&lt;p&gt;Here's the thing. I write C# all day. I don't write Python all day. So when I came back to the coffee log after a few months, I opened the script and had to learn it all over again. Which virtual env was it? Why is that library pinned to that version? Why is that one line commented out?!&lt;/p&gt;

&lt;p&gt;The Python version was written for a Pi Zero, which meant pure Python only and being very careful about what got installed. All sensible at the time. But six months on it just felt like someone else's project.&lt;/p&gt;

&lt;p&gt;The Pi has since been upgraded to a 64 bit model, and that opened a door I couldn't resist. .NET can publish self contained. One binary, no runtime to install, no pip, no package manager, nothing. Copy it over, run it. That alone was enough for me to fire up a new solution.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a month of data taught me
&lt;/h2&gt;

&lt;p&gt;In June the state machine had two ideas. Power goes up and stays up for a few seconds, that's a brew starting. Power drops and stays down for a while, that's a brew finished. Simple, and it mostly worked, because my machine switches itself off after brewing so every on, brew, off is one clean session.&lt;/p&gt;

&lt;p&gt;Mostly. Every so often it would log a coffee I hadn't made, and I couldn't tell you why, because all I had was the post on the site and a vague memory of what I'd been doing that morning.&lt;/p&gt;

&lt;p&gt;This time round the service writes every brew it detects to a JSON file on the Pi as well as posting it, and honestly that file turned out to be the best thing in the whole project. A month of it and I could see exactly what was going on. Have you ever looked at a month of your own coffee habits as JSON? No? Just me then.&lt;/p&gt;

&lt;p&gt;So the detector now has a few more rules. It needs a run of readings above the threshold before it'll commit to a brew, a run below before it'll call one finished, a minimum duration so the short blips get binned, and a cooldown afterwards. That last one is the guard rail I care about most. If I make two or three cups in quick succession, say when we've got people round, it counts as one. I'm not after 100% accuracy here, it's a blog post about coffee, not a billing system. I'd much rather miss the odd cup than post about ones I never made.&lt;/p&gt;

&lt;h2&gt;
  
  
  Replay mode, or how to tune a coffee machine without drinking 40 coffees
&lt;/h2&gt;

&lt;p&gt;The service logs every raw reading to a CSV, one file per day. And it has a replay mode. Point it at a CSV instead of the plug and it runs the whole day through the detector in about a second, using the timestamps from the file rather than the clock on the wall.&lt;/p&gt;

&lt;p&gt;The trick is that the detector doesn't know or care where its readings come from. There's one interface for "give me a power reading", and either the real plug or a CSV file sits behind it. Everything downstream is identical.&lt;/p&gt;


&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body flex items-center justify-between"&gt;
        &lt;a href="https://mermaid.live/edit#pako:eNpljstugzAQRX_Fmk03gCCAHLzoJtm06ktNVanBWVh4QmjBRrZpkiL-vYAaVWp3586cefRQaInAYF_rY3EQxpG7Z264auuuzF9Eq8lEO-L716RBh2ZqFvYzf0M7JinOV5asNq9_jBn6_uZJH9HcT2EYZkOOXDht8vUP7Cb9Up2Vd6tVfrt5fCD7qsb_fVs5zPVRVCqYnrc78KA0lQTmTIceNGgaMUXouSKEgztggxzYiAZld_KlMB9-oWttOHA1jPOtUFutm8sKo7vyAGwvajumrpXC4boSpRG_Co5fmZXulAOWLuYVwHo4AaM0iGiYJMswS2gahUsPzsCiNAyiRZLROF7QOMyyePDgaz4aBkuaDt9W14RT" rel="noopener noreferrer" class="c-link fw-bold flex items-center"&gt;
          &lt;span class="mr-2"&gt;mermaid.live&lt;/span&gt;
          

        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Swap the box on the left and nothing else changes. That's the whole reason it's tunable.&lt;/p&gt;

&lt;p&gt;Nothing gets written in replay mode. No CSV, no state, no posts to the site, it doesn't even need credentials. So I can copy a month of captures off the Pi, replay them on the desktop with different settings, and check the results against the times I know I made a coffee. Change a number, run it, a second later I know if it helped. No standing at the machine pulling shots I don't want. No risk of publishing a post about a coffee from August either, which, trust me, I thought about.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why I stopped retrying
&lt;/h2&gt;

&lt;p&gt;Where a brew goes is now pluggable. There's a JSON file sink, an Umbraco sink, and a mode that does both, and I run both.&lt;/p&gt;

&lt;p&gt;In June the Pi had a little pending queue that kept retrying a post until the site answered. Sensible, right? Until you remember the controller creates a node every single time it's called, and there's nothing in the request that lets the site spot a repeat. So if the site processed the request but the response got lost on the way back, the retry publishes the same coffee twice. Two blog posts, one coffee. Nobody needs that.&lt;/p&gt;

&lt;p&gt;So the .NET sink deliberately never retries. If a post fails it gets logged and the brew's still sitting in the JSON file on the Pi. A missing post I can fix by hand in a minute. A duplicate one I have to notice first, and I won't.&lt;/p&gt;

&lt;h2&gt;
  
  
  The afternoon I lost to two keys
&lt;/h2&gt;

&lt;p&gt;Right, confession time. Wiring the Pi back up to the site after a few months away, I went into the backoffice and created an API user. Because that's how you talk to Umbraco from outside, right? Management API, client id, secret, OAuth, all of that.&lt;/p&gt;

&lt;p&gt;Not here it isn't. The controller from the June post isn't the Management API at all, it's a plain controller sat inside the site, and the only thing guarding it is one shared secret in an &lt;code&gt;X-Api-Key&lt;/code&gt; header. No OAuth, no client id, nothing to create in the backoffice. The same string just has to live in two places, an environment variable on the Live environment in Umbraco Cloud, and the env file on the Pi. That's it. I'd built the thing and forgotten how it worked. Again.&lt;/p&gt;

&lt;p&gt;And then, because one mistake is never enough, I put the secret in the wrong setting. The site also needs to know which node to create posts under, and that's a GUID in a setting called BlogParentKey, which sits right next to the API key in the Cloud portal. So for a good while I had a password sat in a field that wanted a GUID and was staring at 401s wondering what on earth was going on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Deploying is one command now
&lt;/h2&gt;

&lt;p&gt;The service runs under systemd as its own service account, credentials in a separate env file, and the unit file locks it right down. It can only write its own data folder, it can't see home directories, and it never gives up restarting after a power cut, which on a Pi is a matter of when, not if.&lt;/p&gt;

&lt;p&gt;Deploying is a single script. Build for arm64, copy the binary over SSH, stop the service, install, start, print the status. It only ever replaces the binary and the default settings. It never touches the env file, the captured data or the detector's saved state, so I can run it at three in the afternoon and nothing gets lost.&lt;/p&gt;

&lt;h2&gt;
  
  
  So what's actually different?
&lt;/h2&gt;

&lt;p&gt;Same plug. Same site. Same controller. Same daft idea. What's changed is that I can open this project after six months away, run the tests, replay a day of data to see what the detector thinks, and deploy with one command. It went from a thing I built to a thing I can actually maintain. Which, if you read my last post, is sort of the point I've been circling round for a while now.&lt;/p&gt;

&lt;p&gt;Right then. Coffee. You'll know when I have.&lt;/p&gt;

</description>
      <category>umbraco</category>
      <category>dotnet</category>
      <category>raspberrypi</category>
    </item>
    <item>
      <title>AI as a learning tool</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Fri, 02 Oct 2026 09:34:35 +0000</pubDate>
      <link>https://dev.to/owaincodes/ai-as-a-learning-tool-1iec</link>
      <guid>https://dev.to/owaincodes/ai-as-a-learning-tool-1iec</guid>
      <description>&lt;h1&gt;
  
  
  Using AI to Become a Better Developer (A Promise to Myself)
&lt;/h1&gt;

&lt;p&gt;Alright, let's be honest. I ask Claude for code. I read maybe three lines of it. I think "yeah that looks right" and paste it into my editor or just accept it in to my repo. Quick test. Ship it. Move on.&lt;/p&gt;

&lt;p&gt;That's my current workflow. Sloppy but honest.&lt;/p&gt;

&lt;p&gt;And it works. Most of the time. Which is the exact problem.&lt;/p&gt;

&lt;p&gt;When something works, there's no incentive to understand it. No incentive to question it. No incentive to actually learn anything from it. I'm not becoming a better developer. I'm becoming faster at not thinking.&lt;/p&gt;

&lt;p&gt;This ends next week.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Matters
&lt;/h2&gt;

&lt;p&gt;I've got enough experience that I can get away with this for a while. But I can feel it. The edges are getting blurry. There's code in repos I've written that I couldn't explain to someone else. Not because it's complex. Because I never actually understood it in the first place.&lt;/p&gt;

&lt;p&gt;That's not sustainable. That's not how you stay sharp.&lt;/p&gt;

&lt;p&gt;The difference between using AI as a tool and using AI as a crutch is simple. It's the difference between asking "why" and just accepting.&lt;/p&gt;

&lt;p&gt;When I stop asking why, I stop learning. And when I stop learning, I stop being useful.&lt;/p&gt;

&lt;p&gt;So next week, that changes. I'm going to Claude with a different mindset. Not "give me the answer." But "help me understand this."&lt;/p&gt;

&lt;h2&gt;
  
  
  How I'm Going to Use It Differently
&lt;/h2&gt;

&lt;p&gt;Instead of copy, paste, ship, I'm going to actually engage with it. When Claude gives me something, I'm going to ask myself better questions.&lt;/p&gt;

&lt;p&gt;Why did it choose this approach? What's the alternative? What could go wrong here? Is there a trade-off I'm missing?&lt;/p&gt;

&lt;p&gt;Sometimes Claude's right and I'll learn why. Sometimes it's half-right and I'll learn how to adapt it. Sometimes it's confidently wrong and I'll learn more from fixing it than if it had been perfect.&lt;/p&gt;

&lt;p&gt;The key thing is that I'm actually thinking now. Claude's the rubber duck that talks back.&lt;/p&gt;

&lt;p&gt;What changes:&lt;/p&gt;

&lt;p&gt;I stop asking for solutions. I start asking for explanations.&lt;/p&gt;

&lt;p&gt;I stop reading three lines. I read it all and actually process it.&lt;/p&gt;

&lt;p&gt;I stop shipping immediately. I challenge the output. Play devil's advocate with the code.&lt;/p&gt;

&lt;p&gt;I use it to learn new patterns, not to skip learning patterns I should already know.&lt;/p&gt;

&lt;p&gt;I ask "why this way" instead of just accepting "here's a way."&lt;/p&gt;

&lt;h2&gt;
  
  
  The Challenge to You
&lt;/h2&gt;

&lt;p&gt;If you're doing what I'm doing right now, I get it. It's faster. But you're missing out on actually learning anything.&lt;/p&gt;

&lt;p&gt;Start next week. Change one habit. When you get an answer from AI, before you do anything else, ask it why it chose that approach. Make it explain its reasoning. Make it justify it.&lt;/p&gt;

&lt;p&gt;You'll be surprised how often that extra five minutes of questioning reveals something you didn't know.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Prompts That Actually Work
&lt;/h2&gt;

&lt;p&gt;These are the ones I'm going to use. Steal them if they help.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stop saying:&lt;/strong&gt; "Write me a function that does X"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start saying:&lt;/strong&gt; "Show me how to [specific task]. Walk me through why you'd approach it this way instead of [alternative approach]."&lt;/p&gt;

&lt;p&gt;Forces them to explain the thinking, not just dump code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stop saying:&lt;/strong&gt; "Fix this code"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start saying:&lt;/strong&gt; "This code does X but I think there's a better way. What are the trade-offs between my current approach and alternatives? Which would you recommend and why?"&lt;/p&gt;

&lt;p&gt;Now you get the reasoning behind the fix, not just a quick patch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stop saying:&lt;/strong&gt; "How do I do X"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start saying:&lt;/strong&gt; "I need to [outcome]. What are the three most common approaches? What's the trade-off between them? What would you pick for [your specific context] and why?"&lt;/p&gt;

&lt;p&gt;Forces options and reasoning, not just one answer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stop saying:&lt;/strong&gt; "Write me some code"&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Start saying:&lt;/strong&gt; "I'm trying to solve [problem]. Before you write code, help me understand the concepts and patterns I should know about. Then show me how they apply here."&lt;/p&gt;

&lt;p&gt;Learn the foundation first. The code comes after.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;And always follow up with:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;"I don't understand why you chose this. Explain it like I've never seen this pattern before. What could break? What are the limitations?"&lt;/p&gt;

&lt;p&gt;Push back. Ask the hard questions. Don't accept the first answer.&lt;/p&gt;

&lt;h2&gt;
  
  
  Actually Doing This
&lt;/h2&gt;

&lt;p&gt;The developers getting real value from AI aren't the ones who use it to skip thinking. They're using it to think better.&lt;/p&gt;

&lt;p&gt;So next week. That's when I start. I'm going to use Claude to learn, not just to ship. I'm going to ask why instead of just accepting the answer.&lt;/p&gt;

&lt;p&gt;And maybe you should too.&lt;/p&gt;

&lt;p&gt;We'll see how this goes.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
    </item>
    <item>
      <title>Umbraco "hidden" properties - umbracoUrlName and umbracoUrlAlias</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Wed, 06 Jan 2021 00:00:00 +0000</pubDate>
      <link>https://dev.to/owaincodes/umbraco-hidden-properties-umbracourlname-and-umbracourlalias-4mjl</link>
      <guid>https://dev.to/owaincodes/umbraco-hidden-properties-umbracourlname-and-umbracourlalias-4mjl</guid>
      <description>&lt;p&gt;While working on a project I came across an issue where having the ability to give a different url for a page within the CMS would be beneficial. &lt;/p&gt;

&lt;p&gt;In the past, I've always just used &lt;code&gt;umbracoUrlAlias&lt;/code&gt; but it was suggested that &lt;code&gt;umbracoUrlName&lt;/code&gt; might be a better option. This short blog will hopefully bring these properties to light for some of you. &lt;/p&gt;

&lt;h2&gt;
  
  
  How do you use them?
&lt;/h2&gt;

&lt;p&gt;Both properties can be use on any document type that is accessible via the front end of your site e.g. &lt;a href="http://www.owain.codes/about" rel="noopener noreferrer"&gt;http://www.owain.codes/about&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add a text string to your document type and make sure that the alias is &lt;code&gt;umbracoUrlAlias&lt;/code&gt; or &lt;code&gt;umbracoUrlName&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;An example is below for &lt;code&gt;umbracoUrlName&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2F8d8b27e1a7c69f0%2Fpropertyeditor.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fowain.codes%2Fmedia%2F8d8b27e1a7c69f0%2Fpropertyeditor.jpg" alt="enter image description here" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Of course, you can change the Name from &lt;code&gt;umbracoUrlName&lt;/code&gt; but make sure the alias, the bit  next to the padlock, remains &lt;code&gt;umbracoUrlName&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What's the difference between the two?
&lt;/h2&gt;

&lt;p&gt;I'll use the description that is used within the &lt;a href="https://our.umbraco.com/Documentation/Reference/Routing/routing-properties" rel="noopener noreferrer"&gt;Umbraco Documentation&lt;/a&gt;, &lt;/p&gt;

&lt;h3&gt;
  
  
  umbracoUrlAlias
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;This property when created as a text string lets you provide a comma separated list of alternate full URL paths for the node. For example, if your URL was /some-category/some-page/content-node, by adding an umbracoUrlAlias of "flowers", a user can navigate to the node by going to /flowers. The URL alias remains in the browser address bar as a 'mask' over the real URL. You can also specify paths like "flowers/roses/red".&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;One thing to note is that the original URL is also still accessible. To help understand this, if you think about this property as a url shorterner then it will hopefully make it a bit clearer. &lt;/p&gt;

&lt;h3&gt;
  
  
  umbracoUrlName
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;This property when created as a text string lets you provide a different URL name to what is created by default by the name of the node. If you enter a value for this property and save/publish the content node, you will see that its main URL is updated with a new path suffix.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If we use the example that was used above and use the path &lt;code&gt;/some-category/some-page/content-node&lt;/code&gt;, if we use &lt;code&gt;umbracoUrlName&lt;/code&gt; property and use the word &lt;code&gt;flowers&lt;/code&gt;as the value, the url for this page / node is now &lt;code&gt;/flowers&lt;/code&gt;. &lt;/p&gt;

&lt;p&gt;The longer path name now doesn't exist and the only way to access this node is via &lt;code&gt;/flowers&lt;/code&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Other routing options
&lt;/h3&gt;

&lt;p&gt;There are two other options built in to Umbraco that you can use when handling routing. &lt;br&gt;
&lt;code&gt;umbracoRedirect&lt;/code&gt; and &lt;code&gt;umbracoRedirectId&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;In short, &lt;code&gt;umbracoRedirect&lt;/code&gt; performs a 302 redirect by using a Content Picker and &lt;code&gt;umbracoRedirectId&lt;/code&gt; does a url rewrite. &lt;/p&gt;

&lt;p&gt;For more info, check out the &lt;a href="https://our.umbraco.com/Documentation/Reference/Routing/routing-properties" rel="noopener noreferrer"&gt;Umbraco Documentation&lt;/a&gt;&lt;/p&gt;

</description>
      <category>umbraco</category>
    </item>
    <item>
      <title>Null Conditional Operator for fallback images</title>
      <dc:creator>Owain Williams</dc:creator>
      <pubDate>Thu, 10 Dec 2020 00:00:00 +0000</pubDate>
      <link>https://dev.to/owaincodes/null-conditional-operator-for-fallback-images-4akg</link>
      <guid>https://dev.to/owaincodes/null-conditional-operator-for-fallback-images-4akg</guid>
      <description>&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4t1vobhcjaccdaulmf89.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4t1vobhcjaccdaulmf89.jpg" alt="Generic Header image" width="800" height="800"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Last night when working on my new version of &lt;a href="https://www.owain.codes" rel="noopener noreferrer"&gt;Owain.Codes&lt;/a&gt; I managed to blow up the site. &lt;/p&gt;

&lt;p&gt;The reason? &lt;/p&gt;

&lt;p&gt;I hadn't put an image in to the CMS and when I rendered out the image or the lack of an image on the front end, I got a null exception error.&lt;/p&gt;

&lt;p&gt;I started to write a bit of code to handle this which looked a bit like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;@if(Model.Image.Url() == null)
{
  set default image as fallback.jpg
}
else{
  use the image from the CMS
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But then I thought, there must be a nicer way to handle fallbacks, and I believe I have found that nicer option and its by using the &lt;a href="https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/operators/member-access-operators#null-conditional-operators--and-" rel="noopener noreferrer"&gt;Null Conditional Operator&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So I am now using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; var blogImage = Model.PageBanner?.Url() ?? "assets/images/noImage.jpg";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So if the &lt;code&gt;Model.PageBanner&lt;/code&gt; is null, give me the noImage.jpg fall back string, else give me the &lt;code&gt;Model.PageBanner.Url()&lt;/code&gt;. I then use the variable blogImage on my page.&lt;/p&gt;

&lt;p&gt;I now don't need to worry about whether I set an image for a blog or not. Either way I will have an image on my page.&lt;/p&gt;

</description>
      <category>csharp</category>
    </item>
  </channel>
</rss>
