r/ClaudeCode • • 4h ago

Help/Question How to Disable Workspaces?

I have specifically instructed my agents several times and multiple places only to work inside of the live repo and never to go into a copy workspace folder.
Regardless, there is over 300 workspaces that are 90 GB’s, and they continuously create them, leave their changes in the workspace and never bring them to the actual repo.

My whole system is designed around multiple agents working together in one directory and no matter what I do they are mutilating my guidelines and destroying every way I’ve set up for them to work.

And then they played dumb said they won’t do it again and then they do it again. So is there a command or I’d even go as far as a Linux command that blocks them from the file tree.

Regardless of all of this, holy fuck Anthropic. watching the way tbey programmed these agents to work and run all these pointless 30 minute test wasting all the context without ever reading A single file is heartbreaking. Making corrupt file changes behind your back using python scripts through the terminal. It’s like you just can’t build anything complex anymore. People building generic vibecoding probably do not notice too much as long as it works but when you care about how it works and why you just start to notice its tendency to tangle until the project becomes unworkable after 2-4 weeks unless you spend 2-3 days cleaning it up, just to be ruined again.

1 Upvotes

5 comments sorted by

•

u/AutoModerator 4h ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/millionbonus 4h ago

Do you mean you want 300 employees to share one laptop?

1

u/ParamedicAble225 3h ago

I usually only work with one agent at a time on a remote server in a single repo. Regardless, they eventually end up duplicating the full repo per new agent which desyncs all the work across sessions(since the file tree itself is the long term memory), and leads to massive storage bloat.

Based on your low level jab not even funny question, I do not think you’ll understand the point I’m saying fully. I built tree structure coding agents before Claude code even came out so I know what’s up.

1

u/pvera 🔆Pro Plan 3h ago

Worktrees plus Claude is how you avoid breaking the wrong branch. Nothing stops you from giving Claude an instruction along the lines of "Once a day check for any workspace for a branch that shows already merged into release, list them as deletion candidates and let me choose which ones you can remove".

I love worktrees because I never have to worry about breaking a stash. I have a folder per project, and each folder has a clone of the release for that app plus one workspace per open ticket.

1

u/CCodeSI 22m ago

Instructions won't stop this, because the copies aren't the agents disobeying a rule: they're features that create a git worktree under .claude/worktrees/, and the model just chooses to use them. Turn the features off instead:

  • Background sessions: set worktree.bgIsolation to "none" in settings. Background sessions then edit your checkout directly instead of getting their own worktree.
  • The worktree tools themselves: turning on permissions.blockWritesOutsideWorkingDirectories removes the EnterWorktree/ExitWorktree tools (or refuses calls to them).
  • Subagents: check .claude/agents/ and ~/.claude/agents/ for any agent with isolation: worktree in its frontmatter and delete that line. Subagent isolation is opt-in, so one of your agent files or a plugin is asking for it.
  • Headless runs: claude -p never cleans up its worktrees, because there's no exit prompt. If you script agents, that's likely where most of the 300 came from.

To clean up the existing ones: git worktree list, then git worktree remove --force <path> for each (git worktree unlock first if it refuses). Check them for unmerged work before deleting, since some of what you thought was lost may still be sitting in there.