ClavueClavue
CLI · TUI · models

Terminal Opened in the Wrong Directory

Restore project cwd after session restore, failed agent resume, or a replacement shell.

BeginnerTroubleshooting
cwdsessionprojecttroubleshooting

After restore or agent exit, a new shell may land in $HOME even though the workspace still points at a project.

imux tries to preserve project directories on replacement terminals—this guide covers manual recovery when that fails.

Prerequisites

  • Known project path
  • A terminal pane in the workspace

Steps

  1. 01

    Check where you are

    pwd

    If you see your home directory, you are not in the project even if the window title mentions it.

  2. 02

    Use the workspace / sidebar path

    From the Files sidebar or workspace metadata, copy the project root. Then:

    cd '/path/to/project'
  3. 03

    Open a new terminal with the project cwd

    Prefer New Terminal after focusing a pane that already has the correct directory, so inheritance can copy cwd. Avoid launching from a dead remote-only context when you want local files.

  4. 04

    Fix bad resume commands

    If a saved cd … && agent --resume … fails, start a clean shell in the project first, then decide whether resume is still needed. Do not chain resume into $HOME.

FAQ

Why did restore open $HOME?

Often a failed initial command or missing panel directory metadata. Newer builds bias toward keeping project cwd on last-terminal replacement.