- Add statusline.sh and set-topic.sh for per-session status line topics - Update context-load with improved directory walking and output format - Update CLAUDE.md with status line docs and early-call safety note - Update MEMORY.md and README.md with new script/skill entries - Add memory files: script-statusline, skill-decompose, skill-orchestrate, gotchas-gitea - Add networking.md best practice (nftables, systemd sockets, Docker forwarding, TLS) - Update best practices from prior distill: documentation, kubernetes, scripting, secrets-management, skills-development - Prune reflected session logs, add new session logs - Update reflection state Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.1 KiB
2.1 KiB
Status Line Scripts
Overview
Two scripts that power a persistent status bar at the bottom of Claude Code, showing the current session topic, model name, and context window usage.
Files
scripts/statusline.sh— Status line renderer. Receives session JSON on stdin from Claude Code, outputs formatted text. Also writes the session ID to/tmp/claude-session-id-<cwd-hash>so Claude can discover it.scripts/set-topic.sh— Helper to write the topic file for a session. Usage:set-topic.sh <cwd> "topic text".~/.claude/status/— Symlinks back to the canonical scripts. Claude Code'ssettings.jsonpoints here.~/.claude/status/<session-id>/claude-topic.txt— Per-session topic files, written byset-topic.sh.
Setup
The statusLine config in ~/.claude/settings.json:
{
"statusLine": {
"type": "command",
"command": "~/.claude/status/statusline.sh"
}
}
Symlinks in ~/.claude/status/:
statusline.sh→~/dev/claude/projects/claude-foundations/scripts/statusline.shset-topic.sh→~/dev/claude/projects/claude-foundations/scripts/set-topic.sh
How It Works
- Claude Code runs
statusline.shafter each assistant message (debounced 300ms) - The script receives session JSON on stdin with
session_id,model,context_window,cwd, etc. - It writes the session ID to
/tmp/claude-session-id-<md5 of cwd>so Claude can discover its own session - It reads the topic from
~/.claude/status/<session-id>/claude-topic.txtif it exists - Outputs:
[Model Name] topic text | N% context(or without topic if not set)
Early Topic Setting
If set-topic.sh is called before the status line has run (e.g., on the first message), the topic is written to a pending file (/tmp/claude-pending-topic-<hash>). On its next run, statusline.sh picks up the pending file and moves it into the correct session topic location. No error is raised — the topic just appears on the next response.
Dependencies
jq— for parsing the session JSONmd5sum— for hashing the cwd to a predictable filename