正在加载视频...

视频加载失败

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 次观看 • 10 个月前 •via X (Twitter)

32 条评论

Gordon Mickel 的头像
Gordon Mickel10 个月前

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

Ado 的头像
Ado10 个月前

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

Mike Mickelson 的头像
Mike Mickelson10 个月前

sandboxing is for people who back up their code

BrianMcGrath 的头像
BrianMcGrath10 个月前

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

M.en 的头像
M.en10 个月前

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 的头像
mee seen10 个月前

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

Jason 的头像
Jason10 个月前

claude --dangerously-skip-permissions

Akram 的头像
Akram10 个月前

thanks for the info

JFPuget 🇫🇷🇺🇦🇨🇦🇬🇱 的头像
JFPuget 🇫🇷🇺🇦🇨🇦🇬🇱10 个月前

How is it better than using a symlink?

Muzaffar 的头像
Muzaffar10 个月前

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 的头像
Alan10 个月前

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 的头像
United Records10 个月前

logical

Marcin Dudek | WordPress speed + AI 的头像
Marcin Dudek | WordPress speed + AI10 个月前

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 的头像
Larry Diffey10 个月前

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

Anonymouse 的头像
Anonymouse10 个月前

@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🗯 的头像
gerry🗯9 个月前

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 的头像
archivedvideos10 个月前

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

Toast 的头像
Toast10 个月前

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 的头像
River10 个月前

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 的头像
Jukka10 个月前

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

robertus 的头像
robertus10 个月前

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 的头像
Leadlyx10 个月前

Exactly.

cepo.ai 的头像
cepo.ai10 个月前

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

Andy Heynderickx 的头像
Andy Heynderickx10 个月前

@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 的头像
guzus10 个月前

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

Pax2Crypto ∞ ₿ Ξ🦇🔊 的头像
Pax2Crypto ∞ ₿ Ξ🦇🔊10 个月前

Noice, very noice...

Gill 的头像
Gill10 个月前

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

Jithin Palepu 的头像
Jithin Palepu10 个月前

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 的头像
Konstantin10 个月前

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 的头像
Melvyn • Builder10 个月前

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

Cameron Westland 的头像
Cameron Westland10 个月前

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

Cool 的头像
Cool10 个月前

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)

相关视频