[BUG] CLAUDE_CODE_TASK_LIST_ID not working with non-interacting prompting

Status Fixed / completed
Reported on v2.1.17
Maintainer reply None cached
Activity 4 comments · opened Jan 23, 2026 · 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 ↗

4 Comments

github-actions[bot] · 8 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/7523
  2. https://github.com/anthropics/claude-code/issues/15683
  3. https://github.com/anthropics/claude-code/issues/15815

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

shiftysheep · 8 months ago

I ran into this issue while building a workflow orchestration system that spawns claude -p subprocesses with CLAUDE_CODE_TASK_LIST_ID set.

The Task* tools (TaskCreate, TaskUpdate, TaskList, TaskGet) are not available at all in non-interactive -p mode. When we prompted a subprocess to use TaskCreate, it responded:

"I don't have a TaskCreate tool available in my current toolset. Looking at my available tools, I have: Task - for launching agents/subprocesses, TodoWrite - for managing todo lists..."

Environment: Claude Code 2.1.19, macOS, Opus 4.5

shawnm-anthropic · 8 months ago

For headless mode, you currently need to opt into the new task tools using the environment variable CLAUDE_CODE_ENABLE_TASKS=true. We'll make that the default once folks have had a little bit of time to migrate their integrations.

github-actions[bot] · 8 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.