Video wird geladen...
Video konnte nicht geladen werden
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 Aufrufe • vor 9 Monaten •via X (Twitter)
32 Kommentare

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

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

sandboxing is for people who back up their code

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

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

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

claude --dangerously-skip-permissions

thanks for the info

How is it better than using a symlink?

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

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.

logical

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.

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

@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.

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)

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

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

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.

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

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.

Exactly.

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

@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?

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

Noice, very noice...

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

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.

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

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

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

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)
