Skip to content

Add git worktree support for shared brain across sessions#18

Open
jasper-trustworks wants to merge 1 commit intocytostack:mainfrom
jasper-trustworks:jasper-trustworks/worktree-brain
Open

Add git worktree support for shared brain across sessions#18
jasper-trustworks wants to merge 1 commit intocytostack:mainfrom
jasper-trustworks:jasper-trustworks/worktree-brain

Conversation

@jasper-trustworks
Copy link
Copy Markdown

When running in a git worktree (e.g. Conductor), brain files (cerebrum, buglog, token-ledger) now resolve to the main repo's .wolf/ so they persist across worktrees. Session-specific files (anatomy, memory, hooks) stay local per worktree.

  • Add worktree detection via .git file parsing (no git commands)
  • Add getSharedWolfDir() to hooks/shared.ts and utils/paths.ts
  • Update all 4 hooks that access brain files (session-start, pre-write, post-write, stop) to use shared dir
  • Update init.ts for two-tier .wolf/ initialization
  • Update status.ts to report worktree mode and shared brain path
  • Document worktree support in README, how-it-works, hooks, getting-started, and troubleshooting docs

When running in a git worktree (e.g. Conductor), brain files
(cerebrum, buglog, token-ledger) now resolve to the main repo's
.wolf/ so they persist across worktrees. Session-specific files
(anatomy, memory, hooks) stay local per worktree.

- Add worktree detection via .git file parsing (no git commands)
- Add getSharedWolfDir() to hooks/shared.ts and utils/paths.ts
- Update all 4 hooks that access brain files (session-start,
  pre-write, post-write, stop) to use shared dir
- Update init.ts for two-tier .wolf/ initialization
- Update status.ts to report worktree mode and shared brain path
- Document worktree support in README, how-it-works, hooks,
  getting-started, and troubleshooting docs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant