Auto-detect Claude Code plans with inline commenting#251
Draft
Auto-detect Claude Code plans with inline commenting#251
Conversation
Watch plan directories (~/.claude/plans/ and project-local .claude/plans/) for markdown plan files. Surface detected plans in the sidebar with a "Plans" section. Clicking a plan opens a split pane alongside the terminal that renders the plan as structured sections with inline feedback commenting. Feedback is written back to the plan file as blockquotes that Claude Code can read on its next pass. Closes #243
Remove stale comments, simplify notification effect in usePlans, fix misleading security comment in plans.ts, eliminate duplicated terminal rendering in App.tsx (flex layout vs Resizable).
# Conflicts: # client/src/useTerminalLifecycle.ts
Plans are now tied to the Claude session, not standalone in the sidebar.
The provider extracts the session slug from JSONL entries and checks
~/.claude/plans/{slug}.md — this ensures each terminal only shows the
plan from its own Claude session. The plan pane auto-appears when Claude
is active and a plan exists, and disappears when the session ends.
Removes PlanSidebar, standalone plans provider, and sidebar plan section.
# Conflicts: # server/src/git.ts
… smaller font - Replace flex split with @corvu/resizable for draggable terminal/plan split - Use `marked` instead of solid-markdown (ESM compat issues) - Render feedback inline within markdown flow (not in separate bottom section) - Show plan file path in header - Reduce font size for denser plan display - Fix e2e test feedback via proper oRPC HTTP format
Fix plan pane content extending beyond viewport by adding h-full to the resizable panel. Clamp feedback line numbers instead of throwing when the plan file changes between read and feedback submission.
Review button (enabled only when feedback exists) sends "I updated the plan with feedback" + Enter to the active terminal. Proceed button sends "Proceed with the plan" + Enter. Both type directly into the terminal where Claude is running.
Replace polling (refetchInterval) with server-pushed reactivity. The Claude provider now includes planModifiedAt in metadata — when fs.watch detects a plan file change, the new mtime propagates through the metadata stream, changing the TanStack query key and triggering a content refetch. Also revert the always-Resizable approach (broke xterm rendering) back to Show-based toggling. The TerminalPane duplication is a conscious tradeoff — Resizable requires children inside panels, and collapsing to zero breaks terminal canvas sizing.
Stamp rendered HTML elements (headings, paragraphs, list items) with data-line attributes mapping back to source line numbers. When the user selects text, walk up the DOM to find the nearest annotated element and use its source line for feedback insertion. Fixes feedback being placed at the first occurrence of selected text instead of the actual location.
Add overflow-hidden + w-full to plan pane root to prevent content from expanding beyond the resizable panel on first render. Fall back to end-of-file line number when selected text has no data-line ancestor (e.g. table cells) — previously blocked the popover entirely.
Add ✎ (edit) and × (remove) icons to feedback callouts, visible on hover. Remove deletes the feedback block from the plan file. Edit removes and prompts to re-add via text selection. New removeFeedback RPC endpoint strips the feedback lines + surrounding blank lines from the file.
…line map 1. Extract renderPlanMarkdown into planMarkdown.ts as a pipeline of independent transforms (stampLineNumbers, restyleFeedback) — each can be tested/reordered independently. 2. Extract change highlighting into usePlanChangeHighlight.ts — own module, own concern, no coupling to rendering or selection. 3. Fix buildLineMap first-occurrence-wins: now stores ALL occurrences per text snippet with a consumption index, so duplicate lines (e.g. repeated table values) get sequential line numbers. PlanPane.tsx drops from 464 to 270 lines, composing 3 modules.
# Conflicts: # client/src/App.tsx # client/src/index.css # common/src/contract.ts # common/src/index.ts # default.nix # server/src/meta/claude.ts # server/src/router.ts
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.
Claude Code plans now auto-surface in a resizable split pane when the active terminal has a Claude session with a plan file. Select any text in the rendered markdown to leave inline feedback — Antigravity-style scoped commenting without leaving the Kolu UI.
The plan pane renders full markdown via
markedwith inline feedback callouts. When Claude writes or updates a plan in~/.claude/plans/{slug}.md, the server'sfs.watchdetects the change, publishes a newplanModifiedAtthrough the metadata stream, and the client reactively refetches content — no polling, pure push. Feedback is written back as> [FEEDBACK]: Re: «selected text» — commentblockquotes that Claude reads on its next pass.Each terminal's Claude provider independently matches its session via PTY, extracts the session slug from JSONL entries, and checks for the corresponding plan file. Multiple Claude sessions in different repos each show their own plan — no cross-contamination. The plan pane appears when Claude has a plan and disappears when the session ends. Two action buttons at the bottom — Review (tells Claude to re-read the plan with your feedback) and Proceed (tells Claude to execute the plan) — type directly into the terminal.
Closes #243