Summary
ec init creates a separate EntireContext project for each Git worktree. This fragments decision memory and prevents worktree sessions from using the main checkout context by default.
Reproduction
- Run ec init in the main checkout.
- Create or enter a linked Git worktree.
- Run ec init in the worktree.
- Run ec status in both directories.
Observed in the resume repository:
- Main checkout: project resume, with existing session and turn history.
- Worktree: project t3code-754baa7d, with zero sessions and zero turns after initialization.
Current behavior
- find_git_root() uses git rev-parse --show-toplevel, which returns the worktree root.
- get_db(repo_path) stores data at <repo_path>/.entirecontext/db/local.db.
- Session and decision hooks resolve the same worktree-specific root.
- No ec link command or automatic canonical-project resolution exists.
Expected behavior
All linked worktrees should share one logical EntireContext project and decision corpus, while each session retains its own:
- workspace path
- branch or worktree identity
- session and turn metadata
The logical project should be keyed by the Git common directory, or an equivalent stable repository identity, not by --show-toplevel.
Proposed direction
- Resolve a canonical project identity from git rev-parse --git-common-dir.
- Store workspace path, branch, and worktree Git directory as session-scoped fields.
- Migrate existing per-worktree projects only after collision and attribution checks.
- Keep a backup or read-only copy of existing worktree databases during migration.
- Show the logical project and active workspace separately in ec status.
Safety note
Do not solve this by symlinking or copying local.db; that can mix project identity and workspace attribution.
Temporary workaround
Use the main project explicitly from another checkout, for example: ec search --global --repo resume query.
Summary
ec init creates a separate EntireContext project for each Git worktree. This fragments decision memory and prevents worktree sessions from using the main checkout context by default.
Reproduction
Observed in the resume repository:
Current behavior
Expected behavior
All linked worktrees should share one logical EntireContext project and decision corpus, while each session retains its own:
The logical project should be keyed by the Git common directory, or an equivalent stable repository identity, not by --show-toplevel.
Proposed direction
Safety note
Do not solve this by symlinking or copying local.db; that can mix project identity and workspace attribution.
Temporary workaround
Use the main project explicitly from another checkout, for example: ec search --global --repo resume query.