Skip to content

fix: resolve repo root for initialization when started from subdirectory#665

Open
mvanhorn wants to merge 1 commit intoentireio:mainfrom
mvanhorn:osc/559-fix-init-subdir-detection
Open

fix: resolve repo root for initialization when started from subdirectory#665
mvanhorn wants to merge 1 commit intoentireio:mainfrom
mvanhorn:osc/559-fix-init-subdir-detection

Conversation

@mvanhorn
Copy link
Contributor

@mvanhorn mvanhorn commented Mar 9, 2026

Summary

Fixes #559

When entire enable is run from a subdirectory (e.g., cd repo/frontend && entire enable), the agent hook config files (.gemini/settings.json, .claude/settings.json) must be created at the repo root for agents to find them. While internal path resolution via paths.AbsPath() already uses git rev-parse --show-toplevel, some agent config lookups are CWD-relative. This fix explicitly changes to the repo root before the enable flow begins.

Changes

  • Detect when entire enable is run from a subdirectory (CWD != repo root)
  • Change to the repo root before proceeding with setup
  • Clear the worktree root cache after changing directory
  • Print a note so the user knows the repo root is being used

Testing

  • Run entire enable from a subdirectory within a git repo and verify it succeeds
  • Verify .entire/settings.json and agent config files are created at the repo root, not the subdirectory
  • Run entire enable from the repo root and verify no extra note is printed

This contribution was developed with AI assistance (Claude Code).

When `entire enable` is run from a subdirectory, change to the repo
root before proceeding. This ensures agent hooks (e.g.,
.gemini/settings.json, .claude/settings.json) are created at the
correct location and can be found by the agent regardless of CWD.
Prints a note when operating from a subdirectory so the user knows
the repo root is being used.

Fixes entireio#559

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

Development

Successfully merging this pull request may close these issues.

Entire not initialized when coding agent is started from subdirectory

1 participant