feat: add option to scope /resume to current workspace directory
Problem
The /resume command recently changed from workspace-scoped to global — it now shows all sessions regardless of which directory Claude Code was started in.
This is a regression for workspace-based workflows. Claude Code sessions are not context-neutral:
- CLAUDE.md files load based on the working directory. Resuming a session in a different workspace silently loads wrong or missing project instructions.
- Sandbox permissions are path-scoped. A session resumed outside its original workspace may be blocked from writing to expected paths.
- Project memory (
~/.claude/projects/...) is keyed to the workspace path. The wrong workspace = wrong institutional context.
The result: a developer using /resume from workspace A can accidentally continue work that was scoped to workspace B, operating with wrong instructions and wrong memory, with no warning.
Rationale for the original scoped behavior
Tools like git and editors scope their context to the current directory by design. Claude Code workspaces (e.g. via loom) coordinate multi-repo branches under a single directory — the working directory is the project identity. /resume should respect that by default.
Proposed solution
Add a configuration option to control /resume scope, with workspace-scoped as the default:
~/.claude/settings.json (global default):
{
"resumeScope": "workspace"
}
.claude/settings.json (per-project override):
{
"resumeScope": "global"
}
Accepted values:
"workspace"(default) — only show sessions whose working directory matches the current directory"global"— show all sessions (current behavior)
Optionally, a CLI flag could allow one-off overrides:
claude --resume --global
Expected behavior with default "workspace" scope
/resumein/path/to/my-feature-workspaceshows only sessions started there- Sessions from other workspaces are hidden unless the user explicitly opts into global scope
- The current global behavior is preserved for users who set
"resumeScope": "global"
Workaround today
Users must manually inspect the working directory shown in the /resume picker before confirming — there is no guard or warning when resuming a session into the wrong context.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗