task-observer: new-session updates from 2026-05-25#34
Conversation
When work accidentally lands in the main checkout, check for an existing clean worktree before creating another one. Minimizes workspace sprawl.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0065ebf626
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| If work has landed in the main checkout and needs to move to a worktree: | ||
|
|
||
| 1. **Check existing worktrees first:** `git worktree list`. A clean worktree is the safest landing zone and avoids adding clutter. | ||
| 2. **Verify a candidate is clean:** in that worktree, run `git log --oneline <target>..HEAD`. Zero results means no branch-only commits — safe to reuse. |
There was a problem hiding this comment.
Validate worktree has no local changes before reuse
The new recovery flow treats a candidate as "clean" based only on git log --oneline <target>..HEAD, but that check ignores uncommitted/staged/untracked files. In a common case where a worktree has no branch-only commits but does have local edits, this guidance will incorrectly mark it safe and those edits can leak into the recovered session; add a working-tree cleanliness check (for example, empty git status --porcelain) before calling it safe to reuse.
Useful? React with 👍 / 👎.
Target\nskill: .agents/skills/new-session/SKILL.md\n\n## Observations addressed\n- Observation 12 (journology/log.md): Reuse existing clean worktrees before creating another → changed: added ## Recovery section; when work lands in the main checkout, check
git worktree listfor a clean candidate (zero branch-only commits) before creating a new worktree; fast-forward and reuse insteadGenerated by Claude Code