Set Safety Net status line in Claude Code settings
Configures Claude Code's status line to display Safety Net monitoring information.
/plugin marketplace add kenryu42/claude-code-safety-net/plugin install safety-net@safety-net-devYou are helping the user configure the Safety Net status line in their Claude Code settings.
The statusLine field in ~/.claude/settings.json has this structure:
{
"statusLine": {
"type": "command",
"command": "<shell command to execute>",
"padding": <optional number>
}
}
type: Must be "command"command: Shell command that outputs the status line textpadding: Optional number for spacingFollow this flow exactly:
Use AskUserQuestion to let user select their preferred package runner:
{
"questions": [
{
"question": "Which package runner would you like to use?",
"header": "Runner",
"multiSelect": false,
"options": [
{
"label": "bunx (Recommended)",
"description": "Uses Bun's package runner - faster startup"
},
{
"label": "npx",
"description": "Uses npm's package runner - more widely available"
}
]
}
]
}
Read the current settings file:
cat ~/.claude/settings.json 2>/dev/null || echo "{}"
Parse the JSON and check if statusLine.command already exists.
If statusLine.command already exists:
{
"questions": [
{
"question": "The statusLine command is already set. What would you like to do?",
"header": "Existing",
"multiSelect": false,
"options": [
{
"label": "Replace",
"description": "Replace the existing command with Safety Net statusline"
},
{
"label": "Pipe",
"description": "Add Safety Net at the end using pipe (existing_command | cc-safety-net --statusline)"
}
]
}
]
}
Based on user choices:
If Replace or no existing command:
{
"statusLine": {
"type": "command",
"command": "bunx cc-safety-net --statusline"
}
}
(Use npx -y instead of bunx if user selected npx)
If Pipe:
{
"statusLine": {
"type": "command",
"command": "<existing_command> | bunx cc-safety-net --statusline"
}
}
Show the generated config to the user.
Use AskUserQuestion to confirm:
{
"questions": [
{
"question": "Does this configuration look correct?",
"header": "Confirm",
"multiSelect": false,
"options": [
{
"label": "Yes, apply it",
"description": "Write the configuration to ~/.claude/settings.json"
},
{
"label": "No, cancel",
"description": "Cancel without making changes"
}
]
}
]
}
If user confirms:
~/.claude/settings.json (or start with {} if it doesn't exist)statusLine configuration~/.claude/settings.json with proper JSON formatting (2-space indent)Use the Write tool to update the file.
Tell the user:
~/.claude/settings.json~/.claude/settings.jsonnpx -y (not just npx) to skip prompts when using npm