claude-code - 💡(How to fix) Fix Expose permission_mode in statusLine stdin JSON [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#54032Fetched 2026-04-28 06:41:05
View on GitHub
Comments
0
Participants
1
Timeline
3
Reactions
0
Participants
Timeline (top)
labeled ×2subscribed ×1

This was raised as the "Alternatively…" paragraph in #52510, but that issue was auto-closed as a duplicate of #50679. #50679 is about a different bug (the statusLine hook not being invoked at all during active turns) and doesn't address the JSON payload. Filing this separately so it doesn't get lost.

Root Cause

This was raised as the "Alternatively…" paragraph in #52510, but that issue was auto-closed as a duplicate of #50679. #50679 is about a different bug (the statusLine hook not being invoked at all during active turns) and doesn't address the JSON payload. Filing this separately so it doesn't get lost.

Code Example

{
  "permission_mode": "default" | "acceptEdits" | "plan" | "bypassPermissions"
}
RAW_BUFFERClick to expand / collapse

Request

Add a permission_mode field to the JSON payload piped to the statusLine.command so user scripts can render their own indicator for auto / plan / bypassPermissions / acceptEdits state.

Why

The statusLine JSON already exposes model.display_name, vim.mode, effort.level, thinking.enabled, context_window.*, rate_limits.*, and cwd. Permission mode is comparable session state that users want visible alongside the rest, but it isn't in the payload — so a custom statusline can't surface it.

Today the only signal is the built-in mode banner (e.g. blue "plan mode on", red "bypass permissions on"), which lives outside the custom statusline and isn't programmatically accessible to it.

Proposal

Add to the stdin JSON:

{
  "permission_mode": "default" | "acceptEdits" | "plan" | "bypassPermissions"
}

If feasible, also include default_permission_mode (the configured default) so scripts can detect when the user is temporarily in a non-default mode.

Context

This was raised as the "Alternatively…" paragraph in #52510, but that issue was auto-closed as a duplicate of #50679. #50679 is about a different bug (the statusLine hook not being invoked at all during active turns) and doesn't address the JSON payload. Filing this separately so it doesn't get lost.

Environment

  • Custom statusLine.command shell script, Linux

extent analysis

TL;DR

Add a permission_mode field to the JSON payload passed to the statusLine.command to enable custom statusline scripts to render the permission mode indicator.

Guidance

  • Review the current JSON payload structure to determine the best location for the permission_mode field.
  • Consider adding an optional default_permission_mode field to provide additional context for custom statusline scripts.
  • Update the statusLine.command shell script to parse and utilize the new permission_mode field.
  • Test the updated script with different permission modes to ensure correct rendering of the indicator.

Example

{
  "model": {
    "display_name": "...",
    "permission_mode": "plan"
  },
  "vim": {
    "mode": "...",
    "permission_mode": "plan"
  }
}

Note: This example assumes the permission_mode field is added to the existing JSON payload structure.

Notes

The proposal suggests adding the permission_mode field to the JSON payload, but the exact implementation details are not provided. The guidance above is based on the information provided in the issue.

Recommendation

Apply workaround: Update the statusLine.command shell script to parse and utilize the new permission_mode field, if feasible, to provide a temporary solution until the JSON payload is updated.

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