Skip to content

fix(claude): statusline hostname source - LocalHostName not hostname -s#74

Merged
tieubao merged 3 commits into
mainfrom
fix/statusline-hostname
May 7, 2026
Merged

fix(claude): statusline hostname source - LocalHostName not hostname -s#74
tieubao merged 3 commits into
mainfrom
fix/statusline-hostname

Conversation

@tieubao
Copy link
Copy Markdown
Member

@tieubao tieubao commented May 6, 2026

Summary

  • Statusline was reading hostname -s which returns the generic Mac on macOS by default (SMB-style short hostname), making the @<host> segment useless across multiple machines.
  • Switched to scutil --get LocalHostName (with hostname -s as fallback), matching what the SessionStart machine-banner.sh hook already uses. Now shows @Hans-Air-M4.

Test plan

  • Run statusline script with sample input on Hans Air M4 → outputs @Hans-Air-M4
  • Verify scutil --get LocalHostName returns expected value, hostname -s fallback exists
  • Apply on at least one other machine (Mac Mini, etc.) to confirm the LocalHostName is set there too

🤖 Generated with Claude Code

tieubao and others added 3 commits May 6, 2026 10:56
Drops the "which machine am I on" question from every session.
SessionStart hook prints `Machine: <user>@<host> (<hw.model>)` so Claude
sees the active box first thing. CLAUDE.md gains a "Machines I work
from" table mapping verbal shorthand (mini, air, egress-tokyo) to SSH
aliases, so "upgrade hermes on the mini" resolves without asking.

- new: dot_claude/hooks/machine-banner/executable_machine-banner.sh
- modify_settings.json: dedup-by-marker SessionStart entry alongside
  Stop / PreToolUse, preserving guardrails additive merge
- modify_CLAUDE.md.tmpl: prepend "Machines I work from" before the
  "Tool selection" heredoc

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Document the SPEC-052 ops convention so Claude routes work to the right
ssh alias by default: `mini` (server) for daemon control / log tail /
the one ADR-0012 kickstart grant; `mini-tieubao` (tieubao) for any
broader foundation.d.* manipulation.

This makes SPEC-032's passwordless promise actually deliver across the
whole `foundation.d.*` namespace without re-discovering the
"server-can't-bootout" wall every time.

Refs: dfoundation SPEC-052, SPEC-032, ADR-0012.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`hostname -s` returns "Mac" on macOS by default (SMB-style short hostname),
which is useless when you have multiple machines. `scutil --get LocalHostName`
returns the actual user-set name (e.g. "Hans-Air-M4"), matching what the
SessionStart machine-banner hook already uses.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tieubao tieubao merged commit 238b06d into main May 7, 2026
2 checks passed
@tieubao tieubao deleted the fix/statusline-hostname branch May 7, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant