Tip Tuesday: Pin the Claude Code Version Your Agents Run (Mine Changed Twice Without Me Deciding, Then Sat 37 Releases Behind)

A frosted teal glass tile held upright by a small amber brass clamp on a dark shelf, with a long row of identical glass tiles stretching away behind it, representing a pinned software version among many newer releases

Today’s tip is a boring one that can save you a very bad morning: pin the Claude Code version your agents run, and write it down every time they run. Your agents are only as stable as the tool underneath them, and that tool ships new releases constantly.

I checked my own fleet this morning (1 December 2026). Every job log my scheduler writes starts with a line showing which Claude Code version ran it. There are 2,294 of those lines since 12 June, and they show something I never decided:

  • 12 June → 9 September: version 2.1.158
  • 9 September → 8 October: 2.1.266, in the container less than a day after it was published
  • 8 October → today: 2.1.292

Two upgrades, and I didn’t plan either one. Then the changes stopped. Since 8 October, 37 newer releases have come out (the latest, 2.1.333, landed yesterday), and my box hasn’t picked up any of them. I don’t know yet what triggered the two jumps or what stopped them. That’s the problem. Nobody told me, so I can’t tell you.

Why this matters more than it sounds

New versions don’t just add features. Sometimes they change defaults. Per Claude Code’s permission-modes docs (read 30 November), from version 2.1.302, running claude -p without choosing a permission mode starts in Manual mode, which denies actions instead of doing them. For an unattended agent, that means a job that wrote posts yesterday could quietly refuse to write anything today.

My fleet is safe from that one for a single reason: my dispatcher spells the mode out on every call (claude --print --dangerously-skip-permissions -p ...). It doesn’t lean on the default. But my Dockerfile installs @anthropic-ai/claude-code with no version number. If the container were rebuilt today, it would pull 2.1.333, 37 releases past the version my jobs have been tested on.

Jon Jones

⚡ GET THE AI EDGE

Weekly AI tips that actually save you time and money. No fluff, no hype — just what works.

Newsletter Signup - Blog CTA

How to pin your Claude Code version (4 steps)

  1. Log the version on every run. One line at the top of each job log: claude --version. It costs nothing and gives you the timeline above. Without it, “it worked last week” is a guess.
  2. Pin the install. Use npm install -g @anthropic-ai/claude-code@2.1.292 (your tested version) instead of the bare package name. A rebuild then gives you the same tool, not whatever shipped that morning.
  3. Turn off surprise upgrades on the agent box. Set DISABLE_AUTOUPDATER=1 in the container’s environment, so the version only moves when you move it. Keep auto-updates on your own laptop if you like. The difference is that nobody is watching the agent box.
  4. Spell out every flag you depend on. The permission mode, the model, the output format. If a job only works because of a default, a default change will break it. Explicit flags survive upgrades.

Then upgrade on purpose: read the changelog, bump the pinned number, run one low-stakes job by hand, check its log, and only then let the scheduler loose. Ten minutes, on a day you choose.

Where I am: step 1 has been in place since June, and step 4 is why the 2.1.302 change can’t hit my jobs. Steps 2 and 3 are on my list, not done. My Dockerfile still says “latest”. I’m writing this partly to shame myself into fixing it.

If you want to see where this version line lives in a full unattended setup, my Claude Code harness breakdown walks through every part around the model. The headless flags themselves are in the Claude Code cheat sheet, and Sunday’s environment variable check covers the other quiet thing that switches jobs off.

The takeaway: an agent you can’t reproduce is an agent you can’t trust. Pin the version, log the version, and upgrade like it’s a deploy, because it is.

Running agents on a schedule and want a second pair of eyes on how they’re wired? Book an automation strategy session.

The AI Playbook — Free Download

📥 FREE: THE AI PLAYBOOK

The exact tools and workflows I use to run a one-person agency. 25 years of marketing experience distilled into an actionable guide. Yours free.

Lead Magnet - AI Playbook

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *