Safety: /resume shows sessions from all directories — risk of modifying wrong project

Resolved 💬 3 comments Opened Apr 11, 2026 by YitzhakMizrahi Closed Apr 11, 2026

Problem

The /resume command shows sessions from all projects/directories by default, not just the current working directory. A user in project B can accidentally resume a session from project A, causing the agent to read/modify files in the wrong codebase.

This is a safety issue, not just a UX inconvenience — the resumed agent retains the original session's context but operates in the current terminal's working directory.

Steps to reproduce

  1. Start a Claude Code session in /path/to/project-a, do some work, exit
  2. cd /path/to/project-b
  3. Start Claude Code, type /resume
  4. The picker shows sessions from project-a and all other directories by default
  5. Selecting a project-a session resumes it while the working directory is project-b

Current behavior

The /resume picker defaults to showing all sessions across all directories. Filtering controls exist in the footer:

  • Ctrl+A — narrow to current directory only
  • Ctrl+B — filter to current branch
  • Ctrl+W — filter to current worktree

However, these filters do not persist between invocations — every /resume resets to showing everything.

Expected behavior

  • Default to current directory only — the safe default is scoped, not global
  • Ctrl+A (or similar) to expand to all directories when intentionally needed
  • Persist the user's filter choice across invocations, or at minimum default to the safe option

The current default inverts the safety model: the dangerous action (cross-directory resume) is the default, and the safe action requires an extra keystroke every time.

Environment

  • Claude Code CLI
  • Discovered while running multiple agent sessions across different project directories

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗