claude-code - 💡(How to fix) Fix [Bug] CLI output latency degrades user experience [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49296Fetched 2026-04-17 08:45:17
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Author
Participants
Timeline (top)
labeled ×3

Error Message

[{"error":"ZodError: [\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "hooks",\n "PreToolUse",\n 0,\n "hooks",\n 0,\n "command"\n ],\n "message": "Invalid input: expected string, received array"\n },\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "hooks",\n "PreToolUse",\n 1,\n "hooks",\n 0,\n "command"\n ],\n "message": "Invalid input: expected string, received array"\n },\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "hooks",\n "PreToolUse",\n 2,\n "hooks",\n 0,\n "command"\n ],\n "message": "Invalid input: expected string, received array"\n },\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "hooks",\n "PreToolUse",\n 3,\n "hooks",\n 0,\n "command"\n ],\n "message": "Invalid input: expected string, received array"\n },\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "hooks",\n "PreToolUse",\n 4,\n "hooks",\n 0,\n "command"\n ],\n "message": "Invalid input: expected string, received array"\n },\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "hooks",\n "PreToolUse",\n 5,\n "hooks",\n 0,\n "command"\n ],\n "message": "Invalid input: expected string, received array"\n },\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "hooks",\n "PreToolUse",\n 6,\n "hooks",\n 0,\n "command"\n ],\n "message": "Invalid input: expected string, received array"\n },\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "hooks",\n "PreToolUse",\n 7,\n "hooks",\n 0,\n "command"\n ],\n "message": "Invalid input: expected string, received array"\n },\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "hooks",\n "PreToolUse",\n 8,\n "hooks",\n 0,\n "command"\n ],\n "message": "Invalid input: expected string, received array"\n },\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "hooks",\n "PreToolUse",\n 9,\n "hooks",\n 0,\n "command"\n ],\n "message": "Invalid input: expected string, received array"\n },\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "hooks",\n "PreToolUse",\n 10,\n "hooks",\n 0,\n "command"\n ],\n "message": "Invalid input: expected string, received array"\n },\n {\n "expected": "string",\n "code": "invalid_type",\n "path": [\n "hooks",\n "PreToolUse",\n 11,\n "hooks",\n 0,\n "command"\n ],\n "message": "Invalid input: e…

Code Example

[{"error":"ZodError: [\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      0,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      1,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      2,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      3,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      4,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      5,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      6,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      7,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      8,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      9,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      10,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      11,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: e…
RAW_BUFFERClick to expand / collapse

Bug Description output too slow to do anything, the worst experience

Environment Info

  • Platform: win32
  • Terminal: windows-terminal
  • Version: 2.1.111
  • Feedback ID: 3860b323-5ef5-45fc-9e45-4655c80c2c1f

Errors

[{"error":"ZodError: [\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      0,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      1,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      2,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      3,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      4,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      5,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      6,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      7,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      8,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      9,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      10,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: expected string, received array\"\n  },\n  {\n    \"expected\": \"string\",\n    \"code\": \"invalid_type\",\n    \"path\": [\n      \"hooks\",\n      \"PreToolUse\",\n      11,\n      \"hooks\",\n      0,\n      \"command\"\n    ],\n    \"message\": \"Invalid input: e…

Note: Content was truncated.

extent analysis

TL;DR

The issue is likely caused by an invalid input type in the hooks configuration, where an array is being passed instead of a string.

Guidance

  • Review the hooks configuration, specifically the PreToolUse section, to ensure that the command property is a string, not an array.
  • Check the data being passed to the hooks configuration to identify where the array is being introduced.
  • Verify that the ZodError is being thrown due to the invalid input type, and not due to another issue.
  • Consider adding input validation to ensure that the command property is always a string.

Example

No code example can be provided without more context, but the error message suggests that the issue is with the hooks configuration, specifically the PreToolUse section.

Notes

The issue description is truncated, which may limit the ability to provide a complete solution. Additionally, without more information about the hooks configuration and the data being passed to it, it is difficult to provide a more specific solution.

Recommendation

Apply a workaround by reviewing and correcting the hooks configuration to ensure that the command property is a string, rather than an array. This should resolve the ZodError and allow the application to function as expected.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING