Loading video...

Video Failed to Load

Go Home

Claude Code is sandboxed to your current directory. Building an web app that imports from a shared SDK that's outside the current directory? /add-dir ../sdk Now Claude sees both and can read and edit both. No symlinks. No switching sessions.

127,803 views • 10 months ago •via X (Twitter)

32 Comments

Gordon Mickel's profile picture
Gordon Mickel10 months ago

Bad me for just running with --allow-dangerously-skip-permissions and telling it to go look in the other directory 😈

Ado's profile picture
Ado10 months ago

I mean danger is in the name and some of us like to live on the edge. 🤷

Mike Mickelson's profile picture
Mike Mickelson10 months ago

sandboxing is for people who back up their code

BrianMcGrath's profile picture
BrianMcGrath10 months ago

Love this. Makes working with component libraries, shared types, or utility packages alongside the main app seamless. No more context fragmentation.

M.en's profile picture
M.en10 months ago

This sandboxing workaround is genuinely clever for monorepo workflows. It directly solves the "shared dependency" problem that breaks so many AI coding sessions.

mee seen's profile picture
mee seen10 months ago

I have all my projects in one workspace and I launch claude from workspace, it automatically gets all folder access

Jason's profile picture
Jason10 months ago

claude --dangerously-skip-permissions

Akram's profile picture
Akram10 months ago

thanks for the info

JFPuget 🇫🇷🇺🇦🇨🇦🇬🇱's profile picture
JFPuget 🇫🇷🇺🇦🇨🇦🇬🇱10 months ago

How is it better than using a symlink?

Muzaffar's profile picture
Muzaffar10 months ago

this wold have so much of my time. I create a fullstack with Next, mongo and prisma. After that, I moved the backend to modal cloud and volume-based architecture. There I had to go back and forth a lot, had to create a know file to transfer it. Now I can just use this and make two repos sync with each other. thanks for this

Alan's profile picture
Alan10 months ago

I tried messing around with SDK’s last night. I realise that you have to pay for the API which I don’t think I’m quite ready yet because I don’t have a solid project that I think I want to work on with that function.

United Records's profile picture
United Records10 months ago

logical

Marcin Dudek | WordPress speed + AI's profile picture
Marcin Dudek | WordPress speed + AI10 months ago

But it’s not sandboxed by default. Or it can be disabled. Then it will just ask if it needs to read outside of its pwd.

Larry Diffey's profile picture
Larry Diffey10 months ago

It's always just gone to other directories when I tell it where something is. Did that just change?

Anonymouse's profile picture
Anonymouse10 months ago

@bcherny You can also….this is working correctly in another project at “../other-project”. Analyze and make this project work similar. It will ask permission and read the other dir.

gerry🗯's profile picture
gerry🗯9 months ago

I don't actually understand this. I seem to be able to at least read files outside the current directory just by asking Claude. (dangerously-skip is off)

archivedvideos's profile picture
archivedvideos10 months ago

Nice! Btw fast path autocompletion on Claude code would be nice

Toast's profile picture
Toast10 months ago

just add to the project’s the directory you use. or if you have specific linkages to different repos you will always use, add it to the overall

River's profile picture
River10 months ago

It definitely isn't sanboxed and I've never used this /add-dir command. I just ask claude to do things in any specific dir and it happily does.

Jukka's profile picture
Jukka10 months ago

I guess sandboxing does not prevent eg. cat file.txt && rm -rf ~

robertus's profile picture
robertus10 months ago

the quiet quality of life feature. context bleed is friction. anything reducing friction on what's actually in the repo is worth 10 flashy features.

Leadlyx's profile picture
Leadlyx10 months ago

Exactly.

cepo.ai's profile picture
cepo.ai10 months ago

Will this solve the problem where I use git worktrees and Claude code keeps prompting me for permissions?

Andy Heynderickx's profile picture
Andy Heynderickx10 months ago

@bcherny Exactly what I needed (frontend and API without shuffling the openapi.json to the frontend and every little change). Will it be aware of the chosen language for each solution though, or will it try to shove Flutter down FastAPI's rear end?

guzus's profile picture
guzus10 months ago

Now I don’t have to use symlink anymore. Good tip

Pax2Crypto ∞ ₿ Ξ🦇🔊's profile picture
Pax2Crypto ∞ ₿ Ξ🦇🔊10 months ago

Noice, very noice...

Gill's profile picture
Gill10 months ago

Nice—explicit directory whitelisting beats symlinks. Cleaner security model, better DX.

Jithin Palepu's profile picture
Jithin Palepu10 months ago

this is pretty cool. it's nice to see tools that make development smoother. simplifies things a lot, especially when you're juggling multiple directories. makes me think about how First100 can help marketers streamline their processes too. having everything accessible without extra hassle is key.

Konstantin's profile picture
Konstantin10 months ago

this is half the sandbox problem. the other half: your memory and states are trapped in dotfiles that don't really scale across sessions/machines. built something for that

Melvyn • Builder's profile picture
Melvyn • Builder10 months ago

skip permissions and he can even read you're password file

Cameron Westland's profile picture
Cameron Westland10 months ago

I do exactly this for `frontend` `backend` `library` etc since my startup has many repos. Really useful to see across projects.

Cool's profile picture
Cool10 months ago

Is this the way you work with multiple related projects that are in different directories? Or what is the best practice? (Like a frontend and backend project that are in different locations on your machine)

Related Videos