[BUG] --session-id ignored when --plugin-dir is used

Resolved 💬 2 comments Opened Mar 28, 2026 by tomcorke Closed Mar 28, 2026

Summary

--session-id is silently ignored when --plugin-dir flags are also passed. Claude creates the session under its own generated ID instead of the specified one, making programmatic resume via --resume <id> impossible.

Use case

Passing --session-id <uuid> at launch so the session can be resumed later with --resume <uuid> without needing to discover Claude's internal session ID.

Reproduction

mkdir /tmp/session-test

# Without --plugin-dir: works correctly
cd /tmp/session-test && claude --session-id aaaaaaaa-1111-2222-3333-444444444444 -p "say ok"
# Creates: ~/.claude/projects/-private-tmp-session-test/aaaaaaaa-1111-2222-3333-444444444444.jsonl
# --resume aaaaaaaa-1111-2222-3333-444444444444 works

# With --plugin-dir: session-id is ignored
cd /tmp/session-test && claude --session-id bbbbbbbb-1111-2222-3333-444444444444 --plugin-dir /some/dir/with/plugins -p "say ok"
# Does NOT create bbbbbbbb-1111-2222-3333-444444444444.jsonl
# Session is created under a different ID in a different project directory
# --resume bbbbbbbb-1111-2222-3333-444444444444 fails: "No conversation found"

Observed behaviour

  • ~/.claude/session-env/bbbbbbbb-1111-2222-3333-444444444444/ is created (empty dir)
  • No .jsonl with the specified ID appears in any project directory
  • The session .jsonl is created under a different auto-generated UUID, in the project directory corresponding to one of the --plugin-dir paths rather than the CWD

Expected behaviour

--session-id should be honoured regardless of other flags. The .jsonl should be named with the specified UUID.

Environment

  • Claude Code v2.1.86
  • macOS Darwin 25.2.0

View original on GitHub ↗

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