Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

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

Profilbild von Gordon Mickel
Gordon Mickelvor 9 Monaten

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

Profilbild von Ado
Adovor 9 Monaten

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

Profilbild von Mike Mickelson
Mike Mickelsonvor 9 Monaten

sandboxing is for people who back up their code

Profilbild von BrianMcGrath
BrianMcGrathvor 9 Monaten

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

Profilbild von M.en
M.envor 9 Monaten

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

Profilbild von mee seen
mee seenvor 9 Monaten

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

Profilbild von Jason
Jasonvor 9 Monaten

claude --dangerously-skip-permissions

Profilbild von Akram
Akramvor 9 Monaten

thanks for the info

Profilbild von JFPuget 🇫🇷🇺🇦🇨🇦🇬🇱
JFPuget 🇫🇷🇺🇦🇨🇦🇬🇱vor 9 Monaten

How is it better than using a symlink?

Profilbild von Muzaffar
Muzaffarvor 9 Monaten

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

Profilbild von Alan
Alanvor 9 Monaten

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.

Profilbild von United Records
United Recordsvor 9 Monaten

logical

Profilbild von Marcin Dudek | WordPress speed + AI
Marcin Dudek | WordPress speed + AIvor 9 Monaten

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.

Profilbild von Larry Diffey
Larry Diffeyvor 9 Monaten

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

Profilbild von Anonymouse
Anonymousevor 9 Monaten

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

Profilbild von gerry🗯
gerry🗯vor 9 Monaten

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)

Profilbild von archivedvideos
archivedvideosvor 9 Monaten

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

Profilbild von Toast
Toastvor 9 Monaten

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

Profilbild von River
Rivervor 9 Monaten

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.

Profilbild von Jukka
Jukkavor 9 Monaten

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

Profilbild von robertus
robertusvor 9 Monaten

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.

Profilbild von Leadlyx
Leadlyxvor 9 Monaten

Exactly.

Profilbild von cepo.ai
cepo.aivor 9 Monaten

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

Profilbild von Andy Heynderickx
Andy Heynderickxvor 9 Monaten

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

Profilbild von guzus
guzusvor 9 Monaten

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

Profilbild von Pax2Crypto ∞ ₿ Ξ🦇🔊
Pax2Crypto ∞ ₿ Ξ🦇🔊vor 9 Monaten

Noice, very noice...

Profilbild von Gill
Gillvor 9 Monaten

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

Profilbild von Jithin Palepu
Jithin Palepuvor 9 Monaten

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.

Profilbild von Konstantin
Konstantinvor 9 Monaten

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

Profilbild von Melvyn • Builder
Melvyn • Buildervor 9 Monaten

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

Profilbild von Cameron Westland
Cameron Westlandvor 9 Monaten

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

Profilbild von Cool
Coolvor 9 Monaten

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)

Ähnliche Videos