You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,6 +80,14 @@ sandbox/ # Personal scratch (not shipped, excluded from m
80
80
81
81
**Rule of thumb:** if the design itself is the artifact, it's a plan. If you just need a journal of what happened, it's a log.
82
82
83
+
### Session location and durable context
84
+
85
+
- Start every session by creating its log or plan in the main checkout under `packages/docs/`, before creating a worktree.
86
+
- If the task moves to a worktree, move every agent-created write, including the session log or plan, into that worktree immediately. Do not leave duplicate or partial agent work in the main checkout.
87
+
- The primary artifact for a code-changing session is a pull request. Create a draft PR from the worktree as soon as it contains a coherent first commit, and promote it to ready for review only after verification is complete.
88
+
- Assume the chat may end immediately after the draft or final PR is created. Record unfinished work and handoff context in `packages/docs/`, the PR description, or an explicit final response to the user.
89
+
- These instructions apply to all agents. Repository lifecycle hooks are scoped to local CLI runtimes and must exit immediately in hosted or web environments.
90
+
83
91
### Mirroring harness plans
84
92
85
93
When plan mode is used, copy the approved plan from `~/.claude/plans/<slug>.md` into `packages/docs/plans/` using the dated naming convention before beginning implementation.
@@ -298,7 +306,7 @@ files a build needs.
298
306
299
307
After PR merge: run `git-spice repo sync` to delete merged branches and retarget the rest of the stack, then `git worktree remove .claude/worktrees/<feature-slug>` and `git branch -d feature/<slug>` from the main checkout. Run `git worktree prune` to clean up stale entries.
300
308
301
-
See the `worktree-workflow` skill for the full workflow. `claude -w <slug>` creates and enters a worktree at launch; for Codex, create the worktree first and start it with `codex -C <dir>`. A `SessionStart` hook (`.claude/hooks/worktree-reminder.sh`, wired for both Claude Code and Codex) also reminds you whenever a session opens in the main checkout.
309
+
See the `worktree-workflow` skill for the full workflow. `claude -w <slug>` creates and enters a worktree at launch; for Codex, create the worktree first and start it with `codex -C <dir>`.
302
310
303
311
**If you were started in a worktree, stay in that worktree.** Keep every command, search, and file operation scoped to the worktree path you were launched in. Do not `cd` into, read from, or write to the main checkout (the parent of the `.claude/worktrees/` directory you are in) — the worktree is a complete checkout with the same files, so there is no reason to reach outside it. The main checkout may hold the user's own in-progress work; only touch it when the user explicitly asks.
Define a durable session and pull-request workflow for repository agents without executing lifecycle hooks in cloud or web sessions.
11
+
12
+
## Session Log - 2026-07-19
13
+
14
+
### Done
15
+
16
+
- Added the main-checkout log, worktree handoff, durable-context, and draft-PR policy to `AGENTS.md` and `CLAUDE.md`.
17
+
- Restored non-blocking repository-local Claude Code, Codex, and OpenCode lifecycle hooks. Claude hooks skip `CLAUDE_CODE_REMOTE`; Codex hooks skip hosted-task environment markers.
18
+
- Updated `.gitignore` to ignore local `.claude/` and `.codex/` state.
19
+
- Opened draft PR #1579: `https://github.com/shepherdjerred/monorepo/pull/1579`.
20
+
- Audited user and repository configuration for Claude Code, Codex, and OpenCode. Claude and OpenCode user configuration is chezmoi-managed; Codex user configuration is unmanaged.
21
+
- Removed stale Codex hook-trust records from the unmanaged `~/.codex/config.toml`.
22
+
23
+
### Remaining
24
+
25
+
- None.
26
+
27
+
### Caveats
28
+
29
+
- The durable workflow is prompt-based for all agents, with supplemental lifecycle hooks only for local CLI runtimes.
30
+
- PR #1579 remains draft pending workflow review.
31
+
- User-level instructions are intentionally cross-repository only. The monorepo-specific session, worktree, log, and PR policy belongs in repository `AGENTS.md`.
0 commit comments