Skip to content

feat(cli): /move — rebind a session to a new working directory #1101

Closed

Description

@Astro-Han

Problem

A session's cwd is fixed at creation. When a project relocates (repo moved, checked out elsewhere), the session cannot follow — its history stays bound to the old path. Benchmark exists: opencode session.move (tui/src/component/prompt/move.tsx).

Desired outcome

  • /move opens a directory picker with path completion (reuse the autocomplete file provider).
  • Persist the new cwd to the session header (same update seam as /rename), effective for subsequent turns.
  • Inject a synthetic <system-reminder> telling the model the cwd changed ("same project, possibly new location") — the opencode move.tsx pattern.
  • Warn when the old directory has uncommitted changes (opencode offers to move them; warn-only is fine for MVP).

Seams

SessionHeader.cwd in session-store; sessionCwdOverride (packages/cli/src/runtime-bootstrap.ts) already shows the backend-creation-time patch point used by maka run resume — interactive sessions need the cwd to refresh per turn or on next backend creation.

Out of scope: opencode's "new git worktree copy" destination (possible follow-up).

(Split out of the retired #549 tracker.)

Activity

  1. Nyvo-io commented on Jul 18, 2026

    @Nyvo-io
    Contributor

    I would like to claim this issue.

    Implementation scope:

    • Add /move to the CLI/TUI and reuse the existing directory picker and file-path autocomplete.
    • Validate the selected directory, persist it to SessionHeader.cwd, and refresh the runtime/backend cwd so subsequent turns use it.
    • Inject a system reminder explaining that the session working directory changed.
    • Read-only check the old cwd for uncommitted changes and show a warning when applicable.
    • Keep worktree copying out of scope.

    Before implementation I will verify the session lifecycle and active-turn behavior, header/runtime consistency, resume/replay semantics, invalid or missing paths, and empty input handling. I will add focused behavioral tests, then run the relevant CLI/runtime typechecks, the full CLI test suite, lint, and git diff --check.

    Please assign this issue to me before I start. After assignment I will create a dedicated branch from the latest main and submit the implementation as a separate PR.

  2. Astro-Han commented on Jul 18, 2026

    @Astro-Han
    ContributorAuthor

    Assigned! Personally I use move in Opencode for move between worktrees the most, It would be great to see moving between worktrees being targeted as the first major UX journey. Look forward to your PR!

  3. Astro-Han commented on Jul 18, 2026

    @Astro-Han
    ContributorAuthor

    @Nyvo-io Do you have wechat or Email that we can contact you except Github? It would make communicating much more smoother. Cheers!

  4. Nyvo-io commented on Jul 18, 2026

    @Nyvo-io
    Contributor
  5. Nyvo-io commented on Jul 18, 2026

    @Nyvo-io
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions