Skip to content

Open the task/plan file in the editor pane on session creation #16

@ukanga

Description

@ukanga

Use case

When I run a 3-pane session, my editor pane opens to a blank buffer. If I
just used wt session add foo --prompt "..." to spin up a session with a
task, I want my editor pane to open that task — so I can read what the agent
is being told to do, refine it while the agent is starting up, and keep
notes as the work progresses. The task lives somewhere on disk; my editor
should already be looking at it.

Depends on #14 (per-session task prompt).

Outcome

When a session is created with a task prompt and a 3-pane/3-window layout is
in use, the editor pane opens with the task file already loaded. No extra step
needed. When no task prompt was supplied, the editor opens to its current
default (no behavior change).

The shape this takes is up to the implementer — common candidates:

  • Pass the task file path as an argument to the editor command.
  • Make editor_cmd consume an env var (the same one the agent uses) via shell
    substitution, so users who don't want this opt out by configuration.
  • Convention-based: the editor always opens whatever file lives at a known
    path inside the worktree (e.g. .wt/prompt), if it exists.

Whichever shape is chosen, it should also be sensible if the user later
extends the concept to a "plan file" or "task notes" file — the editor surface
for in-flight work.

Why now

A 3-pane session implies the user wants an editor alongside the agent. Today
that editor is a blank slate; the task they care about exists as a file but
the editor has no idea. Closing this loop turns "create session" into "create
session with the task ready to read and refine."

Acceptance criteria

  • After wt session add foo --prompt "..." --panes 3, the editor pane
    shows the task content (loaded from the file wt wrote) without any extra
    user action.
  • When no prompt is supplied, the editor pane behaves as it does today —
    no surprise files, no error.
  • The user has a way to opt out (or tailor which file is opened) via
    configuration, if they prefer their editor to start blank.
  • Documentation shows the workflow with an example.

Out of scope

  • A separate "plan file" concept distinct from the task prompt — can be
    layered later. v1 opens whatever wt already has on disk for the session.
  • Live syncing / file-watching between the editor and the agent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions