[Docs] Undocumented `statusline` configuration feature
Title: [Docs] Undocumented statusline configuration feature
Body:
Summary
I've discovered what appears to be a powerful statusline configuration feature in settings.json for customizing the interactive prompt. This feature is not mentioned anywhere in the official documentation, making it difficult for users to discover, use, or understand its full capabilities.
How I Discovered It
I discovered this feature after running a subagent named statusline-setup. This agent automatically modified my user-level ~/.claude/settings.json file, adding a statusLine object. This implies it's an intended, albeit undocumented, feature.
Observed Functionality
Based on the configuration and its effect on the CLI, the statusline feature appears to:
- Be configured in
settings.jsonwith atypeof "command". - Execute a shell
commandto generate the prompt's status line. - Receive session data as a JSON object via standard input to the command. This JSON contains keys like
workspace.current_dirandmodel.display_name. - Allow for rich, dynamic prompts using tools like
jqto parse the session data andechowith ANSI codes for color.
My Configuration Example
Here is the configuration that was added to my settings.json file by the statusline-setup agent:
{
"statusLine": {
"type": "command",
"command": "input=$(cat); echo \"\\033[1;32m➜\\033[0m \\033[36m$(echo \"$input\" | jq -r '.workspace.current_dir' | sed \"s|^$HOME|~|\" | sed 's|.*/||')\\033[0m \\033[90m[$(echo \"$input\" | jq -r '.model.display_name')]\\033[0m\""
}
}
This produced a fantastic, context-aware prompt showing my current directory and active model, which is a great user experience.
Request
Could you please add official documentation for the statusline feature?
Ideally, the documentation would cover:
- Purpose and Scope: A high-level explanation of what the
statuslinefeature is for. - Configuration: The structure of the
statusLineobject insettings.json. - Input Schema: The full JSON schema of the data that is piped to the command. Knowing all available fields is crucial for customization.
- Examples: A few examples ranging from a simple static prompt to a more advanced, dynamic one like the one above.
- Feature Status: Clarification on whether this feature is considered stable, beta, or experimental.
This feature is a fantastic addition for power users who want to customize their CLI experience. Documenting it would allow the wider community to benefit from it.
Thank you for building such a great tool
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗