anthropics / anthropics/claude-code

Expose focus-mode (/focus) state in the statusline JSON payload

Open
#95,368 1 comment 0 reactions 0 assignees View on GitHub
area:statusline enhancement platform:macos
Dominant language
Python
Stars
145k
Forks
23.1k
PR merge metrics
PR metrics pending

Description

## Feature request

Custom `statusLine` scripts already receive `fast_mode` in the stdin JSON, but there's no equivalent field for whether `/focus` (focus/brief-transcript view) is currently on.

## Why

I wanted my statusline's model/effort/speed line to also show focus state. There's no way to do it today:

- The documented statusline JSON schema (https://code.claude.com/docs/en/statusline) has no focus-related field.
- The toggle's internal state key (`briefTranscript`, confirmed by inspecting the CLI binary strings) lives only in the running terminal process's in-memory app state — it is not written to `settings.json`, `settings.local.json`, or any other file I could find. I toggled `/focus` live and diffed/mtime-swept `~/.claude` afterward; nothing on disk changed.
- Since a custom `statusLine` command runs as a fresh, separate subprocess on each render, it has no way to read that in-memory state.

## Suggested fix

Add a `focus_mode: boolean` (or similarly named) field to the statusline stdin JSON, alongside the existing `fast_mode` field, reflecting current `/focus` state.

## Workaround

None found. Claude Code's own footer does show a "Focus" badge on its mode-indicator row (added per the changelog, e.g. entries around v2.1.9x), and that footer renders in its own row alongside a custom statusline rather than being replaced by it — so the state is visible to the user, just not to statusline scripts.

## Environment

- Claude Code version: 2.1.274
- Platform: macOS (Darwin 25.6.0)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the statusline stdin JSON path that already exposes fast_mode and trace how the /focus state is represented in the running CLI. Add a boolean focus field and update the documented statusline schema; done when a custom statusLine subprocess receives the current value as /focus is toggled.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, developer-experience
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.