Original Reddit post

I’m using the desktop app for Claude Code and trying to improve my worktrees, I understand how worktrees work at a conceptual level but don’t quite understand how I’m supposed to preview changes on a Next.js app. From what I understand I just ask Claude to open the app on a new port, but that doesn’t use the same .env variables as the branch the worktree was created from. Claude Code errors out, then every time suggests copying the .env file over and I can’t help but think there must be a better way. I did suggest a .worktreeinclude file so I created that with the values copied from .env but I feel like this shouldn’t be complicated for what seems like a standard feature, but I’m not an experienced dev. I just want to learn what the standard way of working should be so I can adopt best practices. All YouTube videos I’m finding and most websites are talking about Claude Code in terminal, so it’s not helping my specific situation with the UI in the desktop app. Codex has a great handoff feature which I’d love the equivalent of, but there doesn’t seem to be anything obvious here to handle that. submitted by /u/StartupAndy

Originally posted by u/StartupAndy on r/ClaudeCode