◉CLAUDE LABJP
●BG SKILL — Claude Code 2.1.337 lets a running skill move to the background in Desktop and cloud sessions so the chat keeps going●API 10-21 — In API version 2026-10-21, setting temperature, top_p or top_k returns a 400. Check before you bump the version●OPUS 4.5 — claude-opus-4-5 retires on 2027/1/22, 47 days from now. A good week to find every place your config names it●CHROME — Several people report Claude in Chrome refusing all of amazon.com. The question is how to tell a block from a mistake●NEW — New: Before a sync, check where files land if the destination is empty●RETIRE — A retirement date and a "not sooner than" date mean different things on deprecation pages. Knowing which is which saves a scramble●BG SKILL — Claude Code 2.1.337 lets a running skill move to the background in Desktop and cloud sessions so the chat keeps going●API 10-21 — In API version 2026-10-21, setting temperature, top_p or top_k returns a 400. Check before you bump the version●OPUS 4.5 — claude-opus-4-5 retires on 2027/1/22, 47 days from now. A good week to find every place your config names it●CHROME — Several people report Claude in Chrome refusing all of amazon.com. The question is how to tell a block from a mistake●NEW — New: Before a sync, check where files land if the destination is empty●RETIRE — A retirement date and a "not sooner than" date mean different things on deprecation pages. Knowing which is which saves a scramble
Articles/Cowork
◈ Cowork/2026-10-21Intermediate

Why I Stopped Borrowing a Stale Repo and Started Cloning Fresh After a Scheduled Task Couldn't Write to Shared /tmp

A scheduled task stopped because it could not create its clone directory under /tmp. Here is how I traced it, the borrowable clone that was about 9.6 hours behind, the cost of cloning fresh every run, and a script that picks a working directory.

Cowork75Scheduled Tasks21Git6/tmpOps Log

✦ Premium Article

On a Wednesday evening I opened the log of a scheduled task and found it had stopped at its first Git operation.

fatal: could not create work tree dir '/tmp/repos/site-repo': Permission denied

My runbook says to keep a persistent repository under /tmp/repos and git pull it next time. That one line told me there are days when the assumption does not hold. I've masked the repository name as site-repo here; every other line of output is exactly what I saw that day.

What follows is how I traced the cause, and why I stopped borrowing a clone that another run had left behind and decided to clone fresh every time. If you run Git against a repository from a Cowork scheduled task, I hope it saves you from stepping on the same spot.

The short version first: the fix was not "repair /tmp." It was two habits — never hard-code the working directory, and prove the checkout is current with a number before doing any work.

A triage table: from the error you see to the likely cause

The same Permission denied can come from several places. Here are the ones I actually hit, plus the neighbours I'd check next. Going top to bottom saves a detour.

Symptom (verbatim)Likely causeHow to checkFix
fatal: could not create work tree dir '/tmp/repos/…': Permission deniedThe parent /tmp/repos belongs to another user with mode 755Compare ls -ld /tmp/repos with idPick a parent you can write to (pick_base.sh below)
mkdir: cannot create directory '/tmp/repos/x': Permission deniedSame thing. /tmp itself is writable; its subdirectories depend on their ownerDoes touch /tmp/_w_test succeed?Same as above
touch: cannot touch '.git/probe': Permission deniedThe clone you wanted to borrow has a .git owned by someone elsestat -c '%U %a' .gitClone fresh instead. If you must borrow, copy first, then pull
fatal: detected dubious ownership in repository at …Git's ownership check refused a repository owned by another userCheck the owner of the path in the messageRead it with a one-off -c safe.directory=… (this grants no write access)
No space left on deviceGenuinely out of spacedf -m /tmp "$HOME"Delete only what you created. Leave other runs' directories alone

Mine was the first row. I started at the last row, though, and checked disk space first. That detour is the next section.

Four commands to trace it — /tmp is writable, /tmp/repos is not

My first suspect was /tmp itself. Was it out of space, or read-only? I checked in order.

id                                   # who am I
ls -ld /tmp /tmp/repos               # owner and mode of parent and child
mkdir /tmp/repos/x                   # can I create under the child?
touch /tmp/_w_test && echo "tmp root writable"   # can I write directly in /tmp?

The actual output (trimmed):

uid=1079(rcw-017tvrnbapgi3k7hq52tm5wv) gid=1079(...) groups=1079(...)
drwxrwxrwt 15 nobody nogroup 4096 Oct 21 08:44 /tmp
drwxr-xr-x  3 nobody nogroup 4096 Oct 21 01:16 /tmp/repos
mkdir: cannot create directory '/tmp/repos/x': Permission denied
tmp root writable

Three things fall out of this. /tmp is drwxrwxrwt — world-writable with the sticky bit — so a touch directly inside it works. /tmp/repos, on the other hand, is owned by nobody with mode 755, so my user (uid 1079) can enter it but cannot create anything inside. And /tmp/repos was created at 01:16 the same day: another run had made it first.

Being able to write to /tmp is not the same as being able to write to someone else's directory under /tmp. I briefly reasoned "/tmp is writable, so the problem must be elsewhere" and went off to check disk space. There was 3,787 MB free on / and 7,229 MB on /sessions, so that wasn't it. Looking back, a single ls -ld would have settled it; I went to disk space because "anyone can write to /tmp" was sitting in my head ahead of the evidence.

✦

Thank you for reading this far.

Continue Reading

What follows includes implementation code, benchmarks, and practical content we hope you'll find useful. This site runs without ads — server and development costs are supported entirely by members like you. If it's been helpful, we'd be truly grateful for your support.

WHAT YOU'LL LEARN
✦You can tell whether a shared /tmp is 'writable but not for you' and find the cause with four commands
✦You can stop a run from appending to a stale clone that another run left behind, by comparing SHAs before you touch anything
✦You can put the choice of working directory into one script, so a scheduled task spends no time hunting for a place to work
Secure payment via Stripe · Cancel anytime
✦

Unlock This Article

Get full access to the rest of this article. Buy once, read anytime. This site is ad-free — your support goes directly toward keeping it running.

or
Unlock all articles with Membership →
Share

Thank You for Reading

Claude Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

Related Articles

◈ Cowork2026-12-02
When a Scheduled Task Stops on 'denied by the auto mode classifier', I Move the Destructive Step Into Its Own Call
A Cowork scheduled task stopped on 'Permission for this action was denied by the Claude Code auto mode classifier'. How to tell this message apart, the order I narrowed it down in, the split-and-replace fix, and a script that checks task instructions beforehand.
◈ Cowork2026-11-20
Copy Your Scheduled Tasks' Prompts and Times Once a Week, So You Can Restore Them If They Vanish
Scheduled tasks can disappear or need rescheduling after an app update or a save that fails to read its file. Here is a weekly habit for keeping three things—prompt, schedule, and connected folders—in your own folder, plus a small script that tells you which copies changed since last week.
◈ Cowork2026-10-26
I Linted 36 Unattended-Run Prompts: All 7 'Use This Tool' Hits Turned Out to Be Bans
One permission dialog is enough to stall an unattended task, because nobody is there to click it. This note covers a lint script that counts prompt lines that tell the task to use such a tool, why a banned-word grep gave seven false alarms, and how matching on word stems fixed it.