◉CLAUDE LABJP
●CC 2.1.332 — No new Claude Code release over the weekend. 2.1.332 (11/25) is still current●ANALYTICS — A fix to search counts in the Enterprise Analytics API may raise numbers from 11/17 onward●SONNET 4.5 — Today, 11/30, is Sonnet 4.5's last day on the Claude API. Move to claude-sonnet-5-5●USAGE — Some users report weekly usage jumping right after upgrading to a higher plan●NEW — New: Does what a Project remembers carry over into your everyday chats?●BILLING — More readers are looking for what to check when a payment won't go through●CC 2.1.332 — No new Claude Code release over the weekend. 2.1.332 (11/25) is still current●ANALYTICS — A fix to search counts in the Enterprise Analytics API may raise numbers from 11/17 onward●SONNET 4.5 — Today, 11/30, is Sonnet 4.5's last day on the Claude API. Move to claude-sonnet-5-5●USAGE — Some users report weekly usage jumping right after upgrading to a higher plan●NEW — New: Does what a Project remembers carry over into your everyday chats?●BILLING — More readers are looking for what to check when a payment won't go through
Articles/Cowork
◈ Cowork/2026-11-30Beginner

Before Asking Cowork to Remove the Files You Don't Need, Pick a Holding Folder

When I hand Cowork a cleanup job, I now spell out that remove means move, not delete. Here is a small script that moves candidates into a holding folder with a log, a second one that walks the log back, and where I draw the line on who actually deletes.

Cowork72folderspermissions16file organizationnon-engineers

It was early evening, and I had just finished dropping a new batch of wallpaper source images into a dated folder. I started typing my usual request to Cowork — "remove the ones with white bars on the edges, and the near-duplicates" — and then my hands stopped.

That morning I had read Claude Code issue #112961. Someone reported that Auto mode ran a script it hadn't read, a deletion fired against a path the script had assembled, and the project was gone. Different tool, I know. But it made me notice that my one-line request never said whether "remove" meant delete, move, or just list.

Here's the line I've ended up with, up front: Cowork picks; I delete, a few days later. The rest of this post is how I turned that sentence into a holding folder, a log, and a way back.

"Remove" could mean three different things

As an indie developer who handles a lot of image assets, I say "remove" almost every day. From the receiving end, though, it reads at least three ways.

What I typedWhat I actually wantedWhat Cowork could reasonably do
Check theseA list of candidates with reasonsStop at the list, or go ahead and move them
Remove theseGet them out of the working folderMove them, or delete them
Clean this upLeave it ready for the next stepMove, delete, or rename

For a while I never put that difference into words, so "check these" would stop at a list on one day and roll on into the next step on another. These days, a "check" request always ends at the candidate list. That's the agreement.

Why the delete prompt alone wasn't enough

On my setup, Cowork asks for permission before it deletes files inside a connected folder. For a while I treated that as the safety net and left it there.

But that prompt only asks whether to delete. It doesn't give me what I'd need to judge which files were picked and why. Late in the day, with dozens of candidates on screen, I might well click Allow out of momentum.

Then there are scheduled tasks that run unattended. Nobody is there to click anything. So my rule is that unattended tasks never use a step that asks for delete permission at all. Either the run stalls, or something disappears while no one is watching — I'd rather have neither.

A holding folder, and a log of every move

So I made one folder, _holding/, inside the connected folder. What I ask Cowork for stops at writing the candidates down, with a reason for each, as relative/path<TAB>reason, one per line.

The actual moving is done by this script. The problem it solves: keeping three promises — don't delete, don't leave the folder, make it reversible — in code rather than in wording.

#!/usr/bin/env python3
"""Move cleanup candidates into _holding/<timestamp>/ instead of deleting them,
and log one line per file in manifest.tsv.
 
Usage: python3 hold_files.py <connected_folder> <candidates.tsv> [--apply]
Without --apply nothing moves; it only prints the plan.
candidates.tsv holds one "relative/path<TAB>reason" per line.
"""
import argparse
import csv
import datetime
import shutil
import sys
from pathlib import Path
 
 
def main() -> None:
    p = argparse.ArgumentParser()
    p.add_argument("root")
    p.add_argument("candidates")
    p.add_argument("--apply", action="store_true")
    a = p.parse_args()
 
    # Path("") behaves like ".", so an empty variable would make the
    # current directory the root. Refuse it before resolving anything.
    if not a.root.strip():
        sys.exit("STOP root is empty")
    root = Path(a.root).expanduser().resolve()
    # Also refuse "/" and the home directory itself.
    if root in (Path("/"), Path.home()) or not root.is_dir():
        sys.exit(f"STOP invalid root: {root}")
 
    stamp = datetime.datetime.now().strftime("%Y-%m-%d_%H%M")
    hold = root / "_holding" / stamp
    manifest = root / "_holding" / "manifest.tsv"
 
    plan = []
    for line in Path(a.candidates).read_text(encoding="utf-8").splitlines():
        if not line.strip() or line.startswith("#"):
            continue
        rel, _, reason = line.partition("\t")
        src = (root / rel.strip()).resolve()
        # Never touch a path that escapes the connected folder.
        if not src.is_relative_to(root) or "_holding" in src.relative_to(root).parts:
            print(f"SKIP outside root: {rel}")
            continue
        if not src.is_file():
            print(f"SKIP not found: {rel}")
            continue
        plan.append((src, hold / src.relative_to(root), reason.strip() or "-"))
 
    for src, dst, reason in plan:
        mark = "MOVE" if a.apply else "PLAN"
        print(f"{mark} {src.relative_to(root)} -> {dst.relative_to(root)} ({reason})")
    if not a.apply:
        print(f"{len(plan)} file(s) planned. Review, then rerun with --apply.")
        return
 
    manifest.parent.mkdir(parents=True, exist_ok=True)
    is_new = not manifest.exists()
    moved = 0
    with manifest.open("a", encoding="utf-8", newline="") as f:
        w = csv.writer(f, delimiter="\t")
        if is_new:
            w.writerow(["moved_at", "from", "to", "reason"])
        for src, dst, reason in plan:
            if dst.exists():
                print(f"SKIP already in holding: {dst.relative_to(root)}")
                continue
            dst.parent.mkdir(parents=True, exist_ok=True)
            shutil.move(str(src), str(dst))
            w.writerow([stamp, src.relative_to(root), dst.relative_to(root), reason])
            moved += 1
    print(f"Moved {moved} file(s). Log: {manifest.relative_to(root)} / run: {stamp}")
 
 
if __name__ == "__main__":
    main()

By default it moves nothing and prints the plan. Only --apply moves files, because I want a step where my own eyes go over the list once. The holding area mirrors the original folder layout, so I never wonder where a file came from.

I ran it against a practice folder with 12 dummy images and 5 candidate lines. The line that escaped with ../ and the line pointing at a file that didn't exist were both skipped; the other 3 files moved.

One thing I only caught while building it: the first version didn't stop when I passed an empty variable. In Python, Path("") behaves like ., so the current directory quietly becomes the root. The same kind of hole as the issue I'd read that morning was sitting in my own tiny script. Now it rejects an empty string first, then refuses / and the home directory.

Restoring should just mean reading the log backwards

You'll want something back sooner or later — say, a "near-duplicate" that's worth keeping because its colors are different. When that happens, I don't want to rely on memory. I want to walk the log in reverse.

#!/usr/bin/env python3
"""Walk manifest.tsv backwards for one run (moved_at) and put files back.
 
Usage: python3 restore_held.py <connected_folder> <moved_at> [--apply]
"""
import argparse
import csv
import shutil
import sys
from pathlib import Path
 
 
def main() -> None:
    p = argparse.ArgumentParser()
    p.add_argument("root")
    p.add_argument("moved_at")
    p.add_argument("--apply", action="store_true")
    a = p.parse_args()
 
    if not a.root.strip():
        sys.exit("STOP root is empty")
    root = Path(a.root).expanduser().resolve()
    manifest = root / "_holding" / "manifest.tsv"
    if not manifest.is_file():
        sys.exit(f"STOP no log found: {manifest}")
 
    with manifest.open(encoding="utf-8", newline="") as f:
        rows = [r for r in csv.DictReader(f, delimiter="\t") if r["moved_at"] == a.moved_at]
    if not rows:
        sys.exit(f"STOP no entries for run: {a.moved_at}")
 
    back = 0
    for r in rows:
        held, orig = root / r["to"], root / r["from"]
        if not held.is_file():
            print(f"SKIP not in holding (deleted by hand?): {r['to']}")
            continue
        if orig.exists():
            print(f"SKIP original path is taken: {r['from']}")
            continue
        print(f"{'BACK' if a.apply else 'PLAN'} {r['to']} -> {r['from']}")
        if a.apply:
            orig.parent.mkdir(parents=True, exist_ok=True)
            shutil.move(str(held), str(orig))
            back += 1
    print(f"{back if a.apply else len(rows)} file(s) {'restored' if a.apply else 'in scope'}.")
 
 
if __name__ == "__main__":
    main()

It restores by run because, most of the time, what I want is to undo an entire day's judgment. When it's a single file, I look up that row in manifest.tsv and move it back by hand. If a file with the same name already sits at the original path, the script skips it instead of overwriting, so restoring never costs me something else.

Three lines in the prompt, and who does the deleting

I changed how I ask, too. Every cleanup request now ends with these three lines:

- Do not delete any files. Write the candidates to candidates.tsv as "relative/path<TAB>reason" and stop there.
- When you're done, report only the count and a breakdown of the reasons. I'll move them after I've looked.
- Don't list any path outside the connected folder.

The script already blocks the third case, but I write it in the prompt anyway. If one layer misses, the other catches it.

So who actually deletes, and when? I've settled on this: anything that has sat in _holding/ for 7 days, I delete by hand after reading through manifest.tsv. There's no deep reason behind 7 days. It's simply long enough that I'll look at it at least once before the next batch of images arrives.

Services like Dropbox let you recover deleted files for a while. But how long depends on your plan, and if you notice too late, it won't help. I count on it as the last net, not as part of the plan.

One thing to try today

Make a _holding/ folder inside whatever folder you've connected to Cowork. The next time you're about to type "remove," rephrase it as "move these there and log them." Even without the scripts, the single line "don't delete — write the candidates down and stop" changes how the whole job feels.

If you're still deciding which folders to hand over in the first place, starting with a practice folder and the order I open up write access may help. And if you'd like to check, in one pass, whether any of your unattended task prompts slip in a permission-asking step, I walk through the full procedure — including where my own linter got it wrong — in the write-up on linting 36 unattended-run prompts.

A few days of slack between choosing and deleting. That's the order I keep, especially on the days I'm in a hurry.

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 →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

◈ Cowork2026-10-30
Start Cowork's First Week With a Practice Folder: Three I Handed Over, One I Held Back
How to decide which folders to give Cowork first: an empty practice folder, a copy of real files, and an output folder, while keeping the folder with credentials out of reach.
◈ Cowork2026-10-21
Three Ways to Let Cowork Read Your Calendar and Inbox: Connector, Claude in Chrome, or a File Export, Tried Narrowest First
There are three ways to let Cowork read a calendar or inbox: a connector, Claude in Chrome, or a file export. I choose by how little each one can touch, and I'll share the prompt template I hand over.
◈ Cowork2026-11-28
When I Ask Cowork to Draft Meeting Slides, the Old Minutes Wait Until the Outline Is Settled
Hand Cowork a folder full of past minutes and old quotes, and dropped ideas tend to creep back into your meeting draft. Here are the three files I give first, an outline-only first request, how to bring the minutes in later as a cross-check, and a small script that traces every number to its source.