[BUG] --fork-session does not inherit CLAUDE_CODE_TASK_LIST_ID from parent session

Resolved 💬 2 comments Opened Jan 24, 2026 by ramonclaudio Closed Mar 1, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When forking a session with claude --continue --fork-session, the task list from the parent session is not inherited. Tasks created in the parent session are not visible in the forked session unless you manually pass CLAUDE_CODE_TASK_LIST_ID.

This breaks the expected workflow where forking preserves the full session state including tasks.

What Should Happen?

Forked sessions should automatically inherit the CLAUDE_CODE_TASK_LIST_ID from the parent session, making tasks visible in the forked session without manual intervention.

Error Messages/Logs

# Parent session - tasks exist
> /tasks
#1. [pending] Task one
#2. [pending] Task two

# Fork the session
$ claude --continue --fork-session

# Forked session - tasks missing
> /tasks
No tasks found.

Steps to Reproduce

  1. Start a new Claude Code session:

``bash
claude
``

  1. Create some tasks:

``
> Create a task to fix the login bug
``

  1. Verify tasks exist:

``
> /tasks
``

  1. Exit the session and fork it:

``bash
claude --continue --fork-session
``

  1. Check tasks in forked session:

``
> /tasks
``

  1. Result: Tasks are missing in the forked session

Workaround: Manually pass the task list ID:

CLAUDE_CODE_TASK_LIST_ID=<task-list-id> claude --continue --fork-session

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.19

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

The task list ID can be found in ~/.claude/tasks/ but users shouldn't need to manually look this up and pass it when forking. The fork operation already preserves conversation history and other session state - task list should be included.

Related issue: #20424 covers CLAUDE_CODE_TASK_LIST_ID not working with non-interactive mode (-p), but this is a separate issue about fork not inheriting the ID from the parent session.

View original on GitHub ↗

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