Design and implement the note injection flow for subagent mode. The architecture has 3 layers: (1) Main conversation (talks to user), (2) Orchestrator subagent (runs the megaplan workflow), (3) Worker subagents/CLI calls (run individual phases). When the user wants to inject a note mid-run, they tell the main conversation. The main conversation needs to feed that into the orchestrator subagent. Two options: (A) DEFAULT — inject the note via megaplan override add-note and it gets picked up at the next phase boundary. The orchestrator subagent checks megaplan status between phases and sees the note. (B) KILL+RESTART — the main conversation kills the orchestrator subagent's CURRENT PHASE (the worker/CLI call it's blocking on), NOT the orchestrator itself. Then injects the note. The orchestrator detects the failed phase, reads the note, and decides whether to retry or proceed. The tricky part is layer (B): how does the main conversation kill just the current worker without killing the orchestrator? Options include: the orchestrator running phases via background Bash commands that can be stopped, or the orchestrator checking for a kill signal file between CLI calls. Think through what is actually possible with Claude Code Agent/Bash/TaskStop primitives and design something that works.
code
Plan:
# Implementation Plan: Note Injection Flow for Subagent Mode
Overview
Megaplan's subagent architecture has 3 layers: (1) Main conversation (outer skill, talks to user), (2) Orchestrator subagent (runs the megaplan workflow loop), (3) Worker subagents/CLI calls (run individual phases). The appendix at megaplan/data/claude_subagent_appendix.md already specifies both injection modes at a high level but lacks implementation detail for the outer skill's behavior and doesn't resolve how "kill just the worker" would work mechanically.
Key finding from primitives analysis: Claude Code's SendMessage delivers messages to an agent, but if the agent is blocked on a synchronous tool call (Bash running megaplan critique, or a nested Agent running a worker), the message queues until the tool completes. This means you cannot interrupt a running phase via SendMessage alone. TaskStop kills the entire agent — there's no way to target a child tool call. Therefore, "kill just the worker without killing the orchestrator" is not feasible with current primitives.
Design decision: Implement two modes:
Assistant
Option A (inject-at-boundary): User adds note via CLI, orchestrator picks it up between phases. Zero interruption.
Option B (kill+relaunch): Main conversation TaskStops the orchestrator entirely, injects note, relaunches a fresh orchestrator that resumes from disk state. The state-on-disk architecture already supports this.
No new CLI commands are needed — megaplan override add-note and megaplan status already provide everything. The work is in the prompt instructions (outer skill behavior, orchestrator protocol) and a small CLI enhancement to surface injection readiness.
Step 1: Add outer skill note-injection protocol to claude_subagent_appendix.md
Scope: Medium
The appendix currently describes the orchestrator's behavior (lines 55-63) but not the outer skill's decision tree. Add a new section after "Outer skill handling" (line 149) that specifies:
Detect user intent — When user says something mid-run, the outer skill classifies:
"Add context for next phase" → Option A (inject-at-boundary)
"Change direction NOW / stop current work" → Option B (kill+relaunch)
"Just a question, don't inject" → answer without touching the run
Option A flow (claude_subagent_appendix.md, new section after line 156):
code
Inject-at-boundary:
1. Run `megaplan override add-note --plan <name> --note "<user's note>"`.
2. Confirm to user: "Note injected. The orchestrator will pick it up after the current phase finishes."
3. Do not TaskStop or SendMessage to the orchestrator — it naturally reads notes via `megaplan status` between phases.
Option B flow (claude_subagent_appendix.md, new section after line 156):
code
Kill-and-reinject:
1. TaskStop the orchestrator subagent.
2. Run `megaplan override add-note --plan <name> --note "<user's note>"`.
3. Relaunch a new orchestrator subagent on the same plan using the same prompt template.
4. The new orchestrator runs `megaplan status`, sees the note, and resumes from current state.
5. Confirm to user: "Stopped the current phase, injected your note, and relaunched."
Plan name tracking — The outer skill must remember the plan name from the init response so it can run add-note without querying the orchestrator. Add this to the launch protocol.
Refine the existing "Note injection" and "Kill and reinject" sections:
Clarify note consumption — After reading notes and acting on them, the orchestrator should NOT clear them (they're an audit trail). But it should track which notes it has already processed to avoid re-acting on old notes. Add: "Track the notes_count from your last status check. Only act on notes with index >= your last-seen count."
Kill recovery — When a new orchestrator launches on an existing plan, it may find the plan in a state where the last phase didn't complete (e.g., state is planned but no critique artifact exists yet). The orchestrator should: check megaplan status, read next_step, and proceed. The CLI state machine handles the recovery — the orchestrator just needs to trust it.
Mid-execute kill — If killed during execute (per-batch), the orchestrator should check megaplan progress on relaunch to see which batches completed, then continue from the next incomplete batch.
Step 3: Add notes_since field to status response (megaplan/cli.py:77-98)
Scope: Small
Add a notes field to the status response that includes the full notes array (currently only notes_count and last_note_at are returned). This allows the orchestrator to read note contents without needing a separate command.
Edithandle_status() at megaplan/cli.py:85-98 to include "notes": notes in the response dict.
Update the test at tests/test_megaplan.py:2147 to verify the full notes array is present.
There's a narrow window where the orchestrator has already read status (seeing 0 notes) but hasn't started the next phase yet. If a note arrives in this window, it won't be seen until the NEXT phase boundary. This is acceptable for Option A (documented as expected behavior). For Option B, it's not an issue because kill+relaunch forces a fresh status read.
Document this explicitly in the appendix so users understand the latency model.
Step 5: Test the note injection flow (tests/test_megaplan.py)
Scope: Small
Add test — status response includes full notes array.
Add test — add-note from any active state succeeds and is visible in subsequent status call.
Verify existing tests still pass after the status response shape change (adding notes field).
Phase 3: Documentation
Step 6: Update instructions with user-facing guidance (megaplan/data/instructions.md)
Scope: Small
Add a brief section under "Orchestration Mode" (line 91-95) that explains to inline-mode users that notes work the same way — add-note is always available, and the orchestrator (whether inline or subagent) checks for notes between phases.
Execution Order
Step 3 first (CLI change + tests) — cheapest to validate, provides the notes field the orchestrator needs.
Steps 1-2 (prompt updates) — the core design work.
Step 4-5 (edge cases + tests) — hardens the design.
Step 6 (docs) — last, depends on everything above being settled.
Validation Order
Run pytest tests/test_megaplan.py after Step 3 to verify status response change.
Run full test suite after Step 5 to catch any regressions.
Manual smoke test: run a megaplan in subagent mode, inject a note mid-run, verify it appears in status and the orchestrator acts on it.
Design Rationale: Why Not "Kill Just the Worker"?
The user's idea explored whether the main conversation could kill just the current worker (layer 3) without killing the orchestrator (layer 2). After analyzing Claude Code primitives:
SendMessage can't interrupt a blocked tool call. If the orchestrator is waiting on megaplan critique (a Bash call), SendMessage queues.
TaskStop kills an entire agent — no way to target a child Bash process or nested Agent.
Background Bash + poll loop — The orchestrator could run phases as background Bash commands and poll for completion, checking for kill signals between polls. This would work mechanically but adds enormous complexity: the orchestrator prompt would need PID management, signal file handling, and poll timing logic. It transforms a clean sequential flow into a complex concurrent one, all to save ~30 seconds of phase restart time.
Nested Agent per phase — The orchestrator could launch each phase as a nested Agent. But the main conversation still can't TaskStop the nested agent (doesn't know its ID, and TaskStop targets are scoped to the calling agent).
Conclusion: Kill+relaunch of the entire orchestrator is the right primitive. It's simple, reliable, and the state-on-disk architecture was designed for exactly this. The cost (restarting a subagent, re-reading status) is ~5 seconds. The alternative (background Bash polling) would add 50+ lines of prompt complexity for negligible user benefit.
code
Plan metadata:
{
"version": 1,
"timestamp": "2026-04-06T17:48:04Z",
"hash": "sha256:3f84654ae58c087ff8ca6ed0a0e0f7902a24ddcd91b09daaaff94035d19d221b",
"questions": [
"Should the outer skill automatically classify user messages as inject-at-boundary vs kill+relaunch, or should it always ask the user which mode they want? The plan assumes auto-classification with the heuristic: 'change direction NOW' = kill, 'add context' = inject.",
"Should notes be 'consumed' after the orchestrator acts on them (removed from the array), or kept as permanent audit trail? The plan assumes permanent audit trail with index-based tracking of which notes have been processed.",
"Is there a plan to expose the orchestrator subagent's agent ID to the outer skill, or any future Claude Code primitive that would allow targeting child processes? This would change the kill+relaunch design significantly.",
"For the status response change (adding full notes array) \u2014 is there any concern about the response size if many notes accumulate? Should we cap or paginate?"
],
"success_criteria": [
{
"criterion": "megaplan status --plan returns full notes array in response JSON",
"priority": "must"
},
{
"criterion": "claude_subagent_appendix.md contains explicit outer-skill protocol for both inject-at-boundary and kill+relaunch flows",
"priority": "must"
},
{
"criterion": "Orchestrator prompt specifies how to track which notes have been processed (index-based)",
"priority": "must"
},
{
"criterion": "All existing tests pass after changes",
"priority": "must"
},
{
"criterion": "New test verifies notes array appears in status response",
"priority": "must"
},
{
"criterion": "Race condition between note injection and phase transition is documented",
"priority": "should"
},
{
"criterion": "instructions.md updated with note injection guidance for inline mode users",
"priority": "should"
},
{
"criterion": "Design rationale for why kill-just-the-worker is infeasible is documented in the appendix or a comment",
"priority": "should"
},
{
"criterion": "Prompt additions are under 40 lines each to avoid bloating the skill file",
"priority": "should"
},
{
"criterion": "Manual smoke test: inject a note during a subagent run and verify orchestrator picks it up",
"priority": "info"
}
],
"assumptions": [
"Claude Code SendMessage queues behind in-progress tool calls \u2014 it cannot interrupt a Bash or Agent call mid-execution. This is the core constraint that rules out 'kill just the worker'.",
"TaskStop kills the entire agent and all its child processes/tool calls. There is no selective child-kill primitive.",
"The outer skill (main conversation) can run megaplan CLI commands directly (e.g., megaplan override add-note) without going through the orchestrator subagent.",
"Notes are append-only in the plan state and serve as permanent audit trail. The orchestrator tracks its read position rather than consuming notes.",
"The outer skill remembers the plan name from the init response and can use it for add-note calls without querying the orchestrator.",
"Relaunching a fresh orchestrator subagent after TaskStop takes ~5 seconds and is acceptable latency for the kill+relaunch flow.",
"The auto-classification heuristic (inject vs kill) should default to inject-at-boundary unless the user's message clearly demands immediate interruption."
],
"structure_warnings": [
"Each step section should include at least one numbered substep."
]
}
code
Plan structure warnings from validator:
[
"Each step section should include at least one numbered substep."
]
code
Existing flags:
[]
Known accepted debt grouped by subsystem:
{
"are-the-proposed-changes-technically-correct": [
{
"id": "DEBT-009",
"concern": "are the proposed changes technically correct?: the mobile action-surface plan is technically incorrect for the current component structure. submissioncarouselcard hides footercontent below the md breakpoint (src/components/submissioncarouselcard.tsx:219), while submissionscarouselpage also hides the score panel on mobile via asidecontent={<div classname=\"hidden md:block\">... and passes hideactions to scorepanel at src/pages/submissionscarouselpage.tsx:250-263,347. reusing that pattern for entrypage would leave mobile users with no navigation controls and no scoring controls.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-010",
"concern": "are the proposed changes technically correct?: i checked the sign-in callback path again. submissionslayout already wires usescoring(..., { onrequiresignin: () => pagemachine.dispatch({ type: 'open_sign_in_modal' }) }) at src/pages/submissionslayout.tsx:38-40, and scorepanel still has its own onrequiresignin prop. the revised step 4.2 is acceptable only if it explicitly rewires that prop to pagemachine.dispatch; otherwise removing local modal state would orphan the direct ui callback. the plan hints at this, but it remains easy to misread because the scoring-context callback and the scorepanel prop are separate mechanisms.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
}
],
"are-the-success-criteria-well-prioritized-and-verifiable": [
{
"id": "DEBT-019",
"concern": "are the success criteria well-prioritized and verifiable?: mobile behavior is still under-prioritized relative to the actual risk in this repo. the user constraint specifically mentions the mobile bottom nav, but the only mobile-specific success criterion left is 'mobile scoring ux is coherent' at info level. given that the plan currently removes the working mobile nav, there should be at least a should or must criterion stating that mobile users retain navigation and scoring controls.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
}
],
"did-the-work-fully-address-the-issue-hints-user-notes-and-approved-plan-requirements": [
{
"id": "DEBT-011",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: a new critical issue is introduced on mobile. step 4.9 says to remove entrypage's mobile sticky bottom nav and 'use the same footercontent slot in submissioncarouselcard', but src/components/submissioncarouselcard.tsx:217-221 renders footercontent inside classname=\"hidden md:block\". in the current repo, the mobile sticky nav at src/pages/entrypage.tsx:283-340 is the only mobile surface for back/next and the score toggle, so the revised plan would remove working mobile controls and replace them with a slot that is explicitly hidden on phones.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-012",
"concern": "did the work fully address the issue hints, user notes, and approved plan requirements?: the plan still contradicts itself on mobile behavior. assumption #3 says the browse-mode mobile score toggle will be preserved, but step 4.9 removes the entire mobile sticky nav that contains that toggle in src/pages/entrypage.tsx:314-330. the implementer cannot satisfy both instructions as written.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
}
],
"does-the-change-touch-all-locations-and-supporting-infrastructure": [
{
"id": "DEBT-018",
"concern": "does the change touch all locations and supporting infrastructure?: if the implementation really wants footercontent to carry mobile actions, the plan must also include a supporting change in src/components/submissioncarouselcard.tsx or render a separate mobile control surface outside the card. right now step 4.9 removes the mobile nav but does not list submissioncarouselcard.tsx:217-221 as a place that must change, so the required glue for mobile controls is missing.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
}
],
"execute-phase-contract": [
{
"id": "DEBT-003",
"concern": "early-killed baselines pass truncated output to the execute worker, which may produce lower-quality diagnosis than full output.",
"occurrence_count": 1,
"plan_ids": [
"design-and-implement-a-20260327-0512"
]
}
],
"find-the-callers-of-the-changed-function-what-arguments-do-they-actually-pass-does-the-fix-handle-all-of-them": [
{
"id": "DEBT-014",
"concern": "find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: i checked the skip caller path against the real hook behavior and removefromqueue(entryid) looks redundant. scoring.skipentry(entryid) optimistically adds the id to skippedentryids in src/hooks/usescoring.ts:245-249, and usecarouselqueue already reactively filters skipped entries from submissions[] in src/hooks/usecarouselqueue.ts:154-165. calling removefromqueue() immediately afterward is safe, but it duplicates an existing state transition and should be justified as an explicit ux optimization rather than required logic.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-015",
"concern": "find the callers of the changed function. what arguments do they actually pass? does the fix handle all of them?: the direct ui sign-in caller is still important here. scorepanel invokes its own onrequiresignin prop when an unauthenticated user interacts with the score ui (src/components/scorepanel.tsx:499-515), which is independent of the scoring hook's internal requireauth() path. the plan should be read as requiring that caller to dispatch open_sign_in_modal; otherwise one caller remains broken even if submitscore() is correctly wired.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
}
],
"handler-boilerplate": [
{
"id": "DEBT-004",
"concern": "_run_worker() pseudocode hardcodes iteration=state['iteration'] but handle_plan and handle_revise use different failure iteration values.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
},
{
"id": "DEBT-005",
"concern": "same issue as correctness-1: failure iteration would be wrong for plan/revise handlers.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
}
],
"install-paths": [
{
"id": "DEBT-023",
"concern": "local setup path doesn't expose subagent mode",
"occurrence_count": 1,
"plan_ids": [
"refactor-megaplan-skill-so-20260406-1818"
]
},
{
"id": "DEBT-024",
"concern": "no automated guard to keep the mirror file synchronized with source files",
"occurrence_count": 1,
"plan_ids": [
"update-all-documentation-20260406-1902"
]
},
{
"id": "DEBT-025",
"concern": "local setup test only checks agents.md existence, not content",
"occurrence_count": 1,
"plan_ids": [
"update-all-documentation-20260406-1902"
]
}
],
"is-there-convincing-verification-for-the-change": [
{
"id": "DEBT-016",
"concern": "is there convincing verification for the change?: the test-plan details still miss a small but real infrastructure update: the current locationdisplay helper in src/pages/submissionscarouselpage.test.tsx:289-291 only renders location.pathname, so the step 7 requirement to assert { state: { carousel: true, navdirection: 'forward' } } cannot be implemented unless that helper is extended to expose location.state. the same pattern exists in the related page tests.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
},
{
"id": "DEBT-017",
"concern": "is there convincing verification for the change?: there is still no explicit mobile regression test in the plan, even though the revised implementation proposal removes the only current mobile nav/score surface. given the repository's actual component structure, a mobile-focused test or visual verification step is needed to prove controls remain accessible below md.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
}
],
"mobile-ui": [
{
"id": "DEBT-020",
"concern": "mobile ui: removing entrypage's mobile sticky nav and relying on submissioncarouselcard.footercontent would break mobile navigation and scoring because that footer slot is hidden below the md breakpoint.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
}
],
"search-for-related-code-that-handles-the-same-concept-is-the-reported-issue-a-symptom-of-something-broader": [
{
"id": "DEBT-013",
"concern": "search for related code that handles the same concept. is the reported issue a symptom of something broader?: the mobile problem is broader than entrypage. submissionscarouselpage already has a pre-existing mobile gap because its score panel is desktop-only and its footer actions are also hidden on mobile (src/pages/submissionscarouselpage.tsx:250-263,347-354 plus src/components/submissioncarouselcard.tsx:219). the revised plan says entrypage should 'match the carouselpage pattern', which would spread that existing gap into the one page that currently has working mobile controls.",
"occurrence_count": 1,
"plan_ids": [
"move-the-entry-page-into-20260401-0450"
]
}
],
"subagent-safeguards": [
{
"id": "DEBT-021",
"concern": "hermes reference safeguard numbers not validated against actual implementation",
"occurrence_count": 1,
"plan_ids": [
"refactor-megaplan-skill-so-20260406-1818"
]
},
{
"id": "DEBT-022",
"concern": "plan's retry caps (1 phase, 3 execute) may differ from hermes-agent's actual policy",
"occurrence_count": 1,
"plan_ids": [
"refactor-megaplan-skill-so-20260406-1818"
]
}
],
"worker-permissions": [
{
"id": "DEBT-001",
"concern": "codex --full-auto flag only triggers for step == 'execute', not 'loop_execute'",
"occurrence_count": 1,
"plan_ids": [
"build-megaloop-a-minimal-20260327-0250"
]
},
{
"id": "DEBT-002",
"concern": "claude --permission-mode bypasspermissions only triggers for step == 'execute', not 'loop_execute'",
"occurrence_count": 1,
"plan_ids": [
"build-megaloop-a-minimal-20260327-0250"
]
}
],
"workflow-state-machine": [
{
"id": "DEBT-006",
"concern": "_plan_prompt() does not read research.json, so replanning from state_researched would ignore research results.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
},
{
"id": "DEBT-007",
"concern": "same issue as correctness-2: state_researched \u2192 plan path is only partially wired.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
},
{
"id": "DEBT-008",
"concern": "_plan_prompt() is a missed location for the state_researched \u2192 plan change.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
}
]
}
code
Escalated debt subsystems:
[
{
"subsystem": "install-paths",
"total_occurrences": 3,
"plan_count": 2,
"entries": [
{
"id": "DEBT-023",
"concern": "local setup path doesn't expose subagent mode",
"occurrence_count": 1,
"plan_ids": [
"refactor-megaplan-skill-so-20260406-1818"
]
},
{
"id": "DEBT-024",
"concern": "no automated guard to keep the mirror file synchronized with source files",
"occurrence_count": 1,
"plan_ids": [
"update-all-documentation-20260406-1902"
]
},
{
"id": "DEBT-025",
"concern": "local setup test only checks agents.md existence, not content",
"occurrence_count": 1,
"plan_ids": [
"update-all-documentation-20260406-1902"
]
}
]
},
{
"subsystem": "workflow-state-machine",
"total_occurrences": 3,
"plan_count": 1,
"entries": [
{
"id": "DEBT-006",
"concern": "_plan_prompt() does not read research.json, so replanning from state_researched would ignore research results.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
},
{
"id": "DEBT-007",
"concern": "same issue as correctness-2: state_researched \u2192 plan path is only partially wired.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
},
{
"id": "DEBT-008",
"concern": "_plan_prompt() is a missed location for the state_researched \u2192 plan change.",
"occurrence_count": 1,
"plan_ids": [
"clean-up-and-properly-20260331-0149"
]
}
]
}
]
code
Debt guidance:
- These are known accepted limitations. Do not re-flag them unless the current plan makes them worse, broadens them, or fails to contain them.
- Prefix every new concern with a subsystem tag followed by a colon, for example `Timeout recovery: retry backoff remains brittle`.
- When a concern is recurring debt that still needs to be flagged, prefix it with `Recurring debt:` after the subsystem tag, for example `Timeout recovery: Recurring debt: retry backoff remains brittle`.
Your output template is at: /Users/user_c042661f/Documents/megaplan/.megaplan/plans/design-and-implement-the-note-20260406-1943/critique_output.json
Review the plan with a broad scope. Consider whether the approach is correct, whether it covers
all the places it needs to, whether it would break callers or violate codebase conventions,
and whether its verification strategy is adequate.
Place any concrete concerns in the flags array in the template file using the standard format
(id, concern, category, severity_hint, evidence). Leave checks as an empty array.
Workflow: read the file → investigate → read file again → add findings → write file back.
code
Additional guidelines:
- Robustness level: light. Be pragmatic. Only flag issues that would cause real failures. Ignore style, minor edge cases, and issues the executor will naturally resolve.
- Over-engineering: prefer the simplest approach that fully solves the problem.
- Reuse existing flag IDs when the same concern is still open.
- `verified_flag_ids`: list flag IDs from prior iterations that the revised plan actually resolves (e.g., if the plan was revised to fix FLAG-001, and you confirm the fix is correct, include "FLAG-001"). Only include flags you've verified — don't guess.
- Verify that the plan follows the expected structure when validator warnings or the outline suggest drift.
- Additional flags may use these categories: correctness, security, completeness, performance, maintainability, other.
- Focus on concrete issues, not structural formatting.
{"checks":[],"flags":[{"id":"FLAG-002","concern":"Note tracking: the proposed 'keep notes forever and remember only the last notes_count in the orchestrator' protocol is not restart-safe with the repository's actual state model. Notes are append-only in plan state, there is no persisted processed-note cursor, and worker prompts already inject the full note list every time. After a kill-and-relaunch, the new orchestrator has no way to distinguish newly injected notes from older ones, so it can re-apply stale guidance or repeat a prior replan decision.","category":"correctness","severity_hint":"likely-significant","evidence":"megaplan/handlers.py:588-596 initializes only meta.notes and related arrays; _override_add_note() in megaplan/handlers.py:1194-1205 only appends notes and overrides. intent_and_notes_block() in megaplan/_core/workflow.py:123-135 always renders the full meta.notes list, and that block is included in phase prompts such as megaplan/prompts/planning.py:100-107 and megaplan/prompts/execute.py:225-233."},{"id":"FLAG-003","concern":"Subagent handoff: the plan assumes the outer skill can 'remember the plan name from the init response', but the current subagent contract never guarantees that the outer skill receives that name before the first breakpoint. The prompt only tells the orchestrator to capture the plan name internally, while the outer-skill section says to wait for BREAKPOINT: or COMPLETE:. That leaves mid-run add-note and kill+relaunch blocked, because both flows require megaplan override add-note --plan <name> and the launcher may not know <name> yet.","category":"completeness","severity_hint":"likely-significant","evidence":"The orchestrator prompt in megaplan/data/claude_subagent_appendix.md:27-30 says megaplan init ... then 'Capture the returned plan name.' The outer-skill instructions in megaplan/data/claude_subagent_appendix.md:149-154 tell the launcher to wait for breakpoints/completion and do not add any initial handshake that reports the plan name back. The CLI response itself does expose the name at megaplan/handlers.py:614-621, but only to the process that ran init."},{"id":"FLAG-001","concern":"Status API: the plan's Step 3 and its matching success criterion are stale against the current repo. megaplan status already returns the full notes array, and the test suite already asserts that behavior, so treating this as a required new CLI change will send the executor after work that is already done.","category":"correctness","severity_hint":"likely-minor","evidence":"megaplan/cli.py:77-98 already includes \"notes\": notes in handle_status(), and tests/test_megaplan.py:2134-2149 already asserts both response[\"notes\"] == notes and the note metadata fields."}],"verified_flag_ids":[],"disputed_flag_ids":[]}