Skip to content

Plan-first coding mode for complex feature work #1998

Closed

Description

@sentry-junior

Epic for making Junior reliable on complicated feature-development and coding tasks. Today a coding request goes straight from investigation to edits and a draft PR, with no default step to align on a plan, confirm scope with the requester, or track progress somewhere an engineer can follow.

Current behavior

  • Profiles only pick a model. A profile is { modelId, reasoningLevel, description } and nothing else: no per-profile prompt rules, tools, skills, or workflow (model-profile.ts#L24-L37). The defaults are standard and handoff, and the handoff description already covers implementation, debugging, and architecture work.
  • Coding context doesn't carry across turns. Each new turn is routed again; a handoff applies to its own turn and resumes but "must not pin later requests to that profile" (agent/index.ts#L627). So a multi-turn flow like plan → user answers a question → implement gets re-routed at every step, and a short reply such as "yes, go" can land on the routine profile. Separate turn routing from model handoffs #1036 left this policy as an open design question.
  • Core prompt pushes toward acting right away. TASK_EXECUTION_RULES says "Actionable request: act in this turn" and "Ask the user only for missing access, approval, or a decision that blocks safe progress". PLANNING_RULES says "do not finish with a plan when you can complete the work now" (prompt.ts#L318-L330).
  • The coding skill has no plan or confirm step. The github-code workflow is Resolve → Investigate → Edit → Verify → Package (workflow.md), and the skill defaults to "Unless the user opts out, push completed work and open a draft PR" (SKILL.md#L36).
  • Progress tracking only lives in the conversation. updatePlan (Add Codex-style TODO tracking within conversations #1859) is a checklist inside the conversation. Nothing durable on GitHub lets an engineer review the proposed plan or follow progress across PRs.

Gap

For non-trivial features, Junior commits to an approach before the requester has seen or confirmed it. Work isn't split into reviewable units, and progress isn't visible outside Slack. Course-correcting happens late, in PR review, after implementation is already done.

Proposal

This is the requested direction; the details are still open.

  1. Coding mode. Junior can upgrade a conversation into a coding mode, either by extending profiles or as a separate concept next to them. Entering coding mode always upgrades to the stronger model and stays active for later turns of that effort.
  2. Investigate first. Before planning, Junior always investigates the codebase and the ask so it understands the topic.
  3. High-level plan, then riff. Junior comes back with a high-level plan plus zero or more clarifying questions. If the task is simple, it can skip the questions, but implementation doesn't start until the plan has been checked with the requester by default.
  4. GitHub tracking issue. Every feature gets a tracking issue (epic) with the proposed plan and sub-tasks, so engineers can review the plan and follow progress.
  5. Fireable sub-tasks. Each implementation task states its intended outcome. Tasks are detailed but not a code-level breakdown, each one is self-contained and cleanly testable, and each maps to one or more PRs.

Workstreams

These are rough and get refined once the design settles.

  • Decide whether coding mode extends profiles (for example, profile-scoped prompt rules, skills, or workflow) or is a separate mode that implies a profile
  • Make coding mode last across turns, and define how it's entered and exited, both by the model and by the user
  • Define the plan-first flow (investigate → plan → clarify → confirm → implement) and how it relaxes the current act-now rules while in coding mode
  • Create and maintain the tracking issue: format for the plan, the sub-task checklist, and linking PRs back to it
  • Define what a well-formed sub-task is (outcome, scope, how to test it) and when to split work into multiple PRs
  • Write evals covering plan-before-edit, clarifying questions vs. skipping them on simple tasks, and tracking-issue upkeep

Related

via daniel.

--

View Junior Session [Sentry]

Activity

  1. dcramer commented on Oct 1, 2026

    @dcramer
    Member

    So my quick thoughts without consuming all this:

    1. Profiles expand to cover this behavior. They include more configuration like which skills should be available, which plugins should be available (or maybe disabled? not sure).
    2. Profiles have a way to specify a "workflow" - this is code. Coding is a workflow for example. These workflows would allow us to define this somewhat determnistic workflow. So for coding the plan => task out => implement => verify => pr phases or whatever.
    3. For the plan+tasks I think we'd want a coordinator agent that focuses on an openspec-like output, but pushes that information into a compatible adapter like GitHub or Linear. What I mean is I want it to effectively break down the task, but keep it somewhat high level and behavioral.
    4. The coordinator would focus on keeping things aligned and interpreting human input but would not do any actual implementation work. This means we'd need the subagent model to work well, though in this case its not truly typical subagents its just multiple conversations mapping up to a parent conversation (this is not a generalized "let the agent do whatever it wants")
    5. We'd integrate more deeply with GitHub/Linear and projects/repos. We have workspaces today which kind of encapsulate this for snapshots, but we'd want to expand that so you can group this work (since it may be bigger work, and it will also be task management)
    6. We dont want everything to be coupled to this workflow thing. Like the auto reactive stuff we have in Junior today should continue to be generic, and other behaviors should continue to be generic. The workflow would just be primarily about the coordinator pattern I think?
    7. We'd in the future want to change the turn router to try to select from these workflows both for new conversation sand "the task has changed" style behavior, but in the nearer term it can just be an explicit tool that switches to this. It'd still be handoff like it is today I think, HOWEVER we could switch the main agent to also behave like a coordinator.
  2. sentry-junior commented on Oct 13, 2026

    @sentry-junior
    ContributorAuthor

    Tracked under #2105. Direction there: coding mode is a consumer of a coordinator that is native to every thread (child conversations plus phase gates), not a separate structure, and per-project memory is out of scope.

  3. sentry-junior commented on Oct 18, 2026

    @sentry-junior
    ContributorAuthor

    Prior art: how Claude Code handles "big task" mode, clarifying questions, and suggested tasks

    Research from a Slack discussion with @dcramer about how Claude Code (CLI + desktop) handles plan-first work and breaking work into tasks. It's here as input for the coding workflow (see #2105 for the coordinator/child-conversation direction). Researched Oct 18, 2026.

    What Claude Code has

    Pattern How Claude Code does it Source
    Clarifying question with choices AskUserQuestion built-in tool. Takes a question and options; single-select options can include an optional preview field (a self-contained HTML fragment for mockups/code comparisons). In plan mode it must not be used to ask "is the plan ready?" tools reference, Piebald tool-description-askuserquestion*.md
    Plan-first design EnterPlanMode / ExitPlanMode. Plan mode explores read-only, writes a plan file, uses AskUserQuestion to clarify, then ExitPlanMode presents the plan for approval. There's also a 5-phase plan-mode reminder and an "interactive workshop" offer: for tasks with real design decisions, it offers a published page where the user clicks through each open decision, and the choices flow back into the plan. tools reference, Piebald system-prompt-plan-mode-interactive-workshop-offer.md, system-reminder-plan-mode-is-active-5-phase.md
    Proposed goal / completion condition ProposeGoal, non-blocking. It proposes one verifiable end state (e.g. "bun test exits 0") that a separate evaluator checks from the conversation alone. The user approves with one keypress; ask_user: false only when the user stated that outcome themselves. It's never used to widen scope. Piebald tool-description-proposegoal.md
    Suggested tasks (the chips) A tool call, not a response format. mcp__ccd_session__spawn_task (plus dismiss_task) on an internal ccd_session MCP server that the desktop app injects. Claude writes a title, a summary, and a hidden prompt. The chip shows the title and summary; one click starts a new session linked to the parent, in a fresh worktree, locally or in the cloud. The desktop changelog calls these "side-task suggestions". #82141, #100463, #67432, #52243
    In-session progress TaskCreate/TaskGet/TaskUpdate/TaskList, depending on model and version. This is a progress checklist, not the suggest-and-pick UX. Our equivalent is updatePlan (#1859). task tracking docs

    Gaps users have flagged in Claude Code

    • Suggested tasks aren't durable. #75622 asked for a "Create ticket" action that turns a chip into a GitHub issue. Chips only exist in the session, so a task is lost unless someone clicks "Send to cloud" right away. It was closed as not planned. This is exactly the GitHub-sync piece in this epic.
    • Users can't create chips themselves. #100463: only the model can call spawn_task, and the user never sees the prompt it wrote.
    • Spawned sessions start without external MCP servers (#67432) and branch from the repo default instead of the parent branch (#52243). Worth keeping in mind for child conversations.

    Implications for Junior

    1. Clarifying questions: feat(chat): Let Junior ask for user input with requestUserInput #2149 (requestUserInput) is our AskUserQuestion: a question plus 2–5 choices, rendered by each surface. The plan → clarify → confirm step in this epic can build on it. The "Write the design doc" / "Keep discussing" choice is a direct fit.
    2. Suggested tasks: a host-rendered tool, e.g. suggestTask({ title, summary, prompt, target }). The model writes the fields and the surface renders a card with Start (spawn a child conversation, Let a conversation coordinate child conversations #2105), File issue (GitHub/Linear adapter), and Dismiss. Unlike Claude Code, the issue should be the durable source of truth, and the chip should only point at it.
    3. Entering big-task mode: Claude Code leaves this to the model (EnterPlanMode plus "use when the task is ambiguous" guidance). The idea here is that the turn router classifies "coding task + complexity" and enters coding mode automatically or after a prompt. That would be a deterministic version of the same thing.
    4. Proposed goal: a ProposeGoal-style approved completion condition could set the "done" check for each sub-task.

    Source caveats

    • Official: the Claude Code tools reference and task-tracking docs.
    • Unofficial: Piebald-AI/claude-code-system-prompts pulls the CLI's system prompts and tool descriptions from each release (current through v2.1.301, Oct 16, 2026). It doesn't include desktop-only ccd_* tools.
    • The spawn_task field names come from community bug reports. Nobody has published its exact schema.
  4. sentry-junior commented on Nov 9, 2026

    @sentry-junior
    ContributorAuthor

    Duplicate of #2105, which consolidates the coding workflow including plan-first mode.

    Closed during a tracker cleanup. Reopen if this still needs separate tracking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions