NarratorAI: Trainable AI assistant for Node and React
My new Narrator AI library writes content around your content so you don't have to - intros, outros and more
The Claude Code docs suggest that if you want to run more that one Claude Code session simultaneously for the same project, you should use git worktrees. Today I actually tried to do that, and the experience was not great tbh.
A git worktree is just basically another copy of your repository, which gets checked out inside a directory of your choice. From the filesystem point of view, it looks like a complete separate clone of the same repository. In fact it's not a full clone - it shares the same history and the same working directory, so you on really large repos with lots of objects and history, worktrees should be faster and use less disk space than full clones. I don't think either of those two benefits actually ends up mattering that much, as we'll get back to in a moment.
Let's see how we would actually do that:
Ok that was a few steps, but not too bad. Now we have a subdirectory in our project called short-video that we can run Claude Code in once we've done all that.
The first time I actually got that working I was pretty happy, until Claude Code tried to run pnpm lint:fix for me:
Ooof. Well, this is nothing to do with Claude Code at all, but it doesn't stop it from sucking. There's a way around this, so long as our project doesn't actually rely on nested ES Lint configurations, which is to set root: true on your .eslintrc.json or equivalent file (you'll have to commit that change before you make your worktree, or else make the same change again inside the worktree directory).
Ok, but then we try to run pnpm test in our base directory and although things work, we get a bunch of warnings like this:
Ok so what's happening there is that my Jest mocks are being picked up twice when I run pnpm test in the base directory. This is because the worktree is a separate copy of the repository, and it has its own test directory with its own mocks. Jest doesn't know that it's a worktree and will try to pick up both sets of mocks. I'm sure there's a solution to that too, but this is starting to get a bit annoying.
Cons:
Issues that affect separate clones AND worktrees:
My new Narrator AI library writes content around your content so you don't have to - intros, outros and more
RAG is not just for Pythonistas - it's easy and powerful with TypeScript and React too