Skip to content

Manage Claude Desktop sessions

Claude Desktop stores its Claude Code sidebar separately for each signed-in account. Switching accounts can make existing sessions disappear from the sidebar even though their transcripts still exist.

harn claude-desktop can mirror those sidebar entries across accounts. It can also archive completed entries after Harnery records their task lifecycle as done.

  • Run the command on the machine where Claude Desktop stores its session index.
  • Initialize Harnery in the project whose lifecycle events you want to read.
  • Fully quit Claude Desktop before relying on a changed sidebar. Closing the window usually leaves the app running in the system tray.

Keep sessions visible after an account switch

Section titled “Keep sessions visible after an account switch”
  1. Inspect the account directories Harnery found.

    Terminal window
    harn claude-desktop accounts
    harn claude-desktop sessions
  2. Preview the mirror plan. The command changes nothing without --yes.

    Terminal window
    harn claude-desktop mirror --all
  3. Apply the plan.

    Terminal window
    harn claude-desktop mirror --all --yes

    Use --to <account-prefix> or --from <account-prefix> when you want a one-way copy. Use --session <id-or-title> to mirror one session.

  4. Fully quit Claude Desktop and relaunch it.

Mirroring copies sidebar entry files. It does not copy or fork the transcript. Both accounts point to the same underlying Claude Code session, so do not open and drive that session from two accounts at the same time.

  1. Mark the Harnery task done from its agent session.

    Terminal window
    harn agents lifecycle done --reason "implementation and verification complete"
  2. Preview the cleanup plan.

    Terminal window
    harn claude-desktop tidy

    Harnery maps each desktop entry to its session and reads the newest durable lifecycle event. It reports active, blocked, unmatched, and already archived entries without changing them.

  3. Apply the archive plan.

    Terminal window
    harn claude-desktop tidy --yes

    Limit the batch with --account <uuid-prefix> when needed.

  4. Fully quit and relaunch Claude Desktop.

Applied cleanup changes only isArchived and replaces each entry atomically. Repeating the command is safe; already archived entries become skips.

Older sessions may have a [DONE] title but no lifecycle event. Normal cleanup skips them because a title is editable and cannot prove completion.

Preview those entries only when you intend to include that history:

Terminal window
harn claude-desktop tidy --include-legacy-prefix
harn claude-desktop tidy --include-legacy-prefix --yes

The compatibility flag never overrides a matching active or blocked lifecycle event. A [BLOCKED] title never qualifies for cleanup.

Pass the directory explicitly:

Terminal window
harn claude-desktop accounts --data-dir <path>

Harnery normally checks ~/Library/Application Support/Claude on macOS, %APPDATA%\\Claude on Windows, and ~/.config/Claude on Linux. A CLI running under WSL also scans Windows user profiles mounted under /mnt/c/Users/.

A completed entry is reported as unmatched

Section titled “A completed entry is reported as unmatched”

The desktop row must carry a cliSessionId that maps to a Harnery session in the current project’s active or rotated event ledgers. Run the command from the project that recorded the lifecycle event. Do not rename the sidebar entry as a substitute for that evidence.

Quit the Claude Desktop process from its tray menu, then relaunch it. The window close button may only hide the application.