newgit Docs GitHub
Contents

Using it with Claude Code

Claude Code makes a Git worktree for claude --worktree <name>, for a subagent with isolation: "worktree", and for each background session. In a newgit project, one command makes each of those a newgit instance, with its trackers bound and its resources prepared:

newgit claude-code install            # writes .claude/settings.local.json
claude --worktree auth-refactor       # spawns instance `auth-refactor`

install adds Claude Code's WorktreeCreate and WorktreeRemove hooks: the first runs newgit spawn <name> and hands Claude Code the workspace, the second runs newgit remove when Claude Code removes the worktree. --shared writes .claude/settings.json instead, for a team that all has newgit on its PATH.

The instance starts where Claude Code's own worktree would, not at whatever the project root has checked out (which is what a plain newgit spawn uses):