Repository navigation
Convention: one worktree per session under .worktrees/ - #3
Merged
Merged
Conversation
- AGENTS.md (canonical; CLAUDE.md imports it): the primary checkout stays on main and is never edited; every session — human, Claude Code, Codex, or Modex driving them — works in .worktrees/<name> on branch <name> cut from origin/main; no two sessions share a worktree or branch; landing is worktree → signed commits → PR → green CI → squash merge. - scripts/worktree.sh: new / list / remove / check. `check` exits 1 from the primary checkout so agents can self-verify before editing; `remove` refuses on uncommitted changes and deletes the local branch only when merged. - .worktrees/ git-ignored; README points at the convention. This change was made from .worktrees/worktree-convention. Co-Authored-By: Claude Fable 5.1 <[email protected]>
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Address the three unresolved worktree script issues before approval.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1
Open (1)
What changed in this PR
Establishes a one-worktree-per-session convention with supporting automation and documentation.
Changes:
- Adds
scripts/worktree.shfor worktree lifecycle management. - Adds canonical
AGENTS.mdguidance andCLAUDE.mdimport. - Documents the workflow and ignores
.worktrees/.
| File | Summary |
|---|---|
scripts/worktree.sh |
Adds lifecycle tooling; requires stricter name validation, existing-branch handling, and robust common-directory resolution. |
README.md |
Documents the worktree convention. |
CLAUDE.md |
Imports AGENTS.md. |
AGENTS.md |
Defines repository workflow conventions. |
.gitignore |
Ignores local worktrees. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| case "${1:-}" in | ||
| new) | ||
| name="${2:-}"; [ -n "$name" ] || { echo "usage: scripts/worktree.sh new <name>" >&2; exit 2; } | ||
| case "$name" in */*|*..*|.*|"") echo "name must be a simple slug (letters, digits, - _)" >&2; exit 2;; esac |
13 of 14 tasks
2 of 10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Sets the working convention for this repo, and follows it (this PR was authored from
.worktrees/worktree-convention).AGENTS.md(canonical;CLAUDE.mdimports it with@AGENTS.md): primary checkout stays onmain, never edited; each session — human, Claude Code, Codex, or Modex driving them — works in.worktrees/<name>on branch<name>fromorigin/main; no two sessions share a worktree/branch; land via signed commits → PR → green CI → squash.scripts/worktree.sh:new <name>(creates +npm installs),list,remove <name>(refuses on uncommitted changes; deletes the local branch only if merged),check(exit 1 from the primary checkout — agents call it first)..worktrees/git-ignored; README section.Context: two sessions were pushing to the same branch earlier today (#1). This makes that structurally unlikely.
🤖 Generated with Claude Code