Plan history loses its Versions tab when the agent changes directory into another git repo between submits
I maintainer di solito rispondono entro 1 giorno
@backnotprop ci sta già lavorando.
Dal 26/10/2026.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- backend
Direzione di ricerca
Start with server/index.ts and trace how startPlannotatorServer detects the project and saves plan history. Then read the Claude Code plan launch path in apps/hook/hooks/mod/controller.ts and the classic PermissionRequest hook to see which session directory information is available. Done means consecutive submits stay in the same history chain after the agent changes directories, so the Versions tab and diff remain available.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happened?
When the agent changes directory into a different git repo between two plan submits, the Versions tab disappears and there is no diff. The revised plan is correct and the earlier version is still on disk; they just land in two different history projects, so the UI sees a chain of length 1.
Concretely: a Claude Code session started in a workspace repo (workspace) whose subfolders are separate git clones. The first submit went to history/workspace/<slug>/001.md. Before the resubmit, the agent ran cd service-a (a nested clone) in its shell, and the second submit went to history/service-a/<slug>/001.md. The session record for the second review shows "project": "service-a".
Root cause: the history project is detected from the process cwd at every submit.
packages/server/index.ts (startPlannotatorServer):
project = (await detectProjectName()) ?? "_unknown";
historySlug = resolveHistorySlug(project, slug);
const historyResult = saveToHistory(project, historySlug, plan);
detectProjectName() defaults to process.cwd() and returns the basename of git rev-parse --show-toplevel. The plan CLI inherits whatever directory the session is in at that moment:
- the Claude Code mod launches
plannotator claude-mod-planwithout acwdorPLANNOTATOR_CWD(apps/hook/hooks/mod/controller.ts,launch) - the classic
PermissionRequesthook runsplannotatorin the session's current directory
So a shell cd mid-session (common in multi-repo workspaces and monorepos with nested clones) changes the project key, getNextVersionNumber returns 1 in the fresh directory, previousPlan is null, and the Versions gate never opens. The code-review paths already prefer PLANNOTATOR_CWD; the plan paths ignore it.
This is the same class of bug as #1679 (history key not stable across a resubmit), on the project half of history/{project}/{slug} rather than the slug half.
Suggested fix
- Name the history project from the session's project root rather than the current directory:
$.session.root()in the mod (a shellcddoes not move it),CLAUDE_PROJECT_DIRin the classic hook. - Pin a plan's project per (session, date-free slug) on its first save, so
/cdor a worktree move mid-plan still continues the same chain.
Other agents (OpenCode, Pi, Codex, Gemini, Copilot, Droid, Vibe) are unaffected.
Plannotator version
plannotator 0.28.31
OS
macOS
Agent
Claude Code
Where did it happen?
Plan review
- Lingua principale
- TypeScript
- Stelle
- 8.7k
- Fork
- 649
- Merge medio
- 4h 9m
- PR unite (30g)
- 448
Preparare l'ambiente
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di backnotprop/plannotator
-
Annotate documentation omits per-file version history and privacy controlsForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
backnotprop/plannotator#1086 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
show full file nameApertaaccepted enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 58/100
backnotprop/plannotator#2195 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
backnotprop/plannotator#2194 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug] plannotator-* preference cookies pollute every app running on localhostForse già presa @utpalsinghdev l’ha presa 1 giorno fa. Apertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
backnotprop/plannotator#2184 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature Request] Copy selection as rich text (for Outlook and Slack)Forse già presa Una pull request collegata a questa issue è aperta o già unita. Apertaenhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
backnotprop/plannotator#1972 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di backnotprop/plannotator
Issue simili
-
支持对已取消(cancelled)任务生成报告Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
Clouditera/VulnHunter#57 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
bug bug:behavior clawsweeper:bulk-filed clawsweeper:fix-shape-clear clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:auth-provider issue-rating: 🦞 diamond lobster P2
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
openclaw/openclaw#185297 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
bug needs-triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
apex-dev-tools/apex-log-parser#199 ·
I maintainer di solito rispondono entro 1 giorno