[BUG] CLAUDE_CODE_TASK_LIST_ID not working with non-interacting prompting

Resolved 💬 4 comments Opened Jan 23, 2026 by bitstein Closed Jan 26, 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 I try to use CLAUDE_CODE_TASK_LIST_ID with Claude in non-interactive mode, Claude does not recognize there being any tasks. The same command and same prompt without -p is able to successfully bring up the expected tasks.

Example:

$ CLAUDE_CODE_TASK_LIST_ID=groceries claude -p "List pending tasks"
No pending tasks. The todo list is empty.

What Should Happen?

The same thing in interactive mode:

$ CLAUDE_CODE_TASK_LIST_ID=groceries claude "List pending tasks"
❯ List pending tasks
4 tasks (1 done, 3 open)

✔ #1 Buy fruits and vegetables
◼ #2 Get dairy products
◼ #3 Stock up on pantry staples
◼ #4 Buy proteins

Error Messages/Logs

Steps to Reproduce

  1. Run Claude with CLAUDE_CODE_TASK_LIST_ID, and ask it to generate a few tasks.
  2. Exit that session and run a non-interactive prompt with the same CLAUDE_CODE_TASK_LIST_ID

Claude Model

Opus

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.17

Platform

Anthropic API

Operating System

Other Linux

Terminal/Shell

Other

Additional Information

_No response_

View original on GitHub ↗

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