Skip to content

[Bug] /ask mode fails with Claude Code 2.1.80: --allowedTools "" causes prompt argument to be ignored #45

Description

@yicheny

Description

When using /ask in Discord, the agent always returns:

❌ Error: Input must be provided either through stdin or as a prompt argument when using --print

This happens regardless of what prompt text is entered. /code works fine.

Root Cause

In the source code, askModeArgs is set to ["--allowedTools", ""]. When Claude Code is invoked in auto permission mode, the final command becomes:

claude -p --output-format stream-json --verbose --allowedTools "" "actual prompt here"

Claude Code 2.1.80 treats the empty string "" from --allowedTools as the positional prompt argument, causing the actual prompt to be silently dropped. This results in the "Input must be provided" error.

Reproduction

# This fails:
claude -p --output-format stream-json --verbose --allowedTools "" "hello"
# Error: Input must be provided either through stdin or as a prompt argument when using --print

# This works:
claude -p --output-format stream-json --verbose "hello"
# Returns response correctly

Environment

  • @doctorwu/agent-inbox: 1.2.5
  • Claude Code: 2.1.80
  • Node: v24.14.0
  • Platform: macOS (arm64)
  • IM: Discord

Workaround

Change all askModeArgs assignments in dist/index.mjs from ["--allowedTools", ""] to [].

Suggested Fix

In the source code, either:

  1. Remove --allowedTools "" from ask mode args entirely, or
  2. Only include --allowedTools when a non-empty value is provided

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions