Skip to content

Add machine-readable error codes to JSON commands #3697

Description

@NathanaelRea

Motivation

Callers using --format=json can parse successful results, but failures such as approval-required, hook failure, and Git failure still require compatibility matching against human-readable stderr.

Request

For JSON-mode commands, return a stable structured error envelope or another documented machine-readable error channel with codes for at least:

  • approval required;
  • hook failure;
  • Git failure;
  • invalid input or unsupported operation.

Human diagnostics can remain on stderr, but callers should not need regexes to classify failures.

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