Add Claude Code statusline and LSP plugins !3

merged merged by cmc on 2026-09-19 21:00 UTC · cmc/dotfiles:claude-setup-lsp-statusline into main

2 files changed, +78 −3

Layout: unified · split

common/claude/.claude/settings.json +45 −3
@@ -1,5 +1,4 @@
11{
2 "model": "claude-fable-5-1[1m]",
32 "hooks": {
43 "Notification": [
54 {
@@ -102,9 +101,18 @@
102101 }
103102 ]
104103 },
104 "statusLine": {
105 "type": "command",
106 "command": "~/.claude/statusline.sh"
107 },
105108 "enabledPlugins": {
106109 "superpowers@claude-plugins-official": true,
107 "i-have-adhd@i-have-adhd": true
110 "i-have-adhd@i-have-adhd": true,
111 "typesafe@typesafe-ai": true,
112 "gopls-lsp@claude-plugins-official": true,
113 "swift-lsp@claude-plugins-official": true,
114 "pyright-lsp@claude-plugins-official": true,
115 "rust-analyzer-lsp@claude-plugins-official": true
108116 },
109117 "extraKnownMarketplaces": {
110118 "i-have-adhd": {
@@ -112,10 +120,44 @@
112120 "source": "github",
113121 "repo": "ayghri/i-have-adhd"
114122 }
123 },
124 "typesafe-ai": {
125 "source": {
126 "source": "github",
127 "repo": "typesafe-ai/skills"
128 }
115129 }
116130 },
117131 "tui": "fullscreen",
118132 "theme": "auto",
119133 "inputNeededNotifEnabled": true,
120 "agentPushNotifEnabled": true
134 "agentPushNotifEnabled": true,
135 "autoMode": {
136 "environment": [
137 "### Org-wide",
138 "**Organization**: None configured",
139 "**Cloud provider(s)**: None configured",
140 "**Repository visibility**: assume private unless the remote host and repo name indicate otherwise, or a visibility check in the transcript shows public",
141 "**Internal sharing / snippet hosting**: None configured — treat public paste/gist services as outside the trust boundary",
142 "**Secrets management**: None configured",
143 "**Default / protected branches**: None configured — no remotes or repo found at /Users/cmc",
144 "**CI/CD deploy targets**: None configured",
145 "**Network posture**: None configured",
146 "**Host containment**: None configured — assume Claude Code runs on an ordinary developer machine or CI runner with open internet",
147 "**Source control**: No trusted repo found — /Users/cmc has no tracked files and no remotes configured",
148 "**Trusted internal domains**: None configured",
149 "**Trusted cloud buckets**: None configured",
150 "**Key internal services**: None configured",
151 "**Internal package registry**: None configured",
152 "**Sensitive data locations & audiences**: any file or store holding personal data, confidential business data, credentials, regulated data, or similarly sensitive material; preserve exact handles when known and share only with audiences cleared at the [named+specifics] bar",
153 "**Data retention / declassification**: None configured",
154 "**Sensitive remote targets**: any namespace, host, or container whose name carries `prod` or `production` as a whole word or name segment (hyphen/underscore/dot-delimited — e.g. matches `prod-db`, not `producer`)",
155 "**Protected deployment namespaces / environments**: None configured — fall back to the Sensitive remote targets heuristic",
156 "**Protected IaC scopes**: IAM, RBAC, networking, quota, and node-pool resources; anything whose name or tag carries `prod` or `production` as a whole word or name segment",
157 "### User-specific",
158 "**Primary use of Claude Code**: software development",
159 "**Trusted repo**: None found — /Users/cmc (the directory the agent started in) has no tracked files and no configured remotes",
160 "**Org-specific CLIs**: None configured"
161 ]
162 }
121163}
common/claude/.claude/statusline.sh added +33
@@ -0,0 +1,33 @@
1#!/bin/sh
2# Claude Code status line: model, directory, git branch, context usage.
3# Session JSON arrives on stdin; see
4# https://code.claude.com/docs/en/statusline#available-data
5
6tab=$(printf '\t')
7IFS="$tab" read -r model dir pct <<EOF
8$(jq -r '[.model.display_name,
9 .workspace.current_dir,
10 (.context_window.used_percentage // 0 | floor)] | @tsv' 2>/dev/null)
11EOF
12pct=${pct:-0}
13
14branch=''
15if [ -n "$dir" ] && cd "$dir" 2>/dev/null; then
16 branch=$(git branch --show-current 2>/dev/null)
17 if [ -n "$branch" ] && [ -n "$(git status --porcelain 2>/dev/null)" ]; then
18 branch="$branch*"
19 fi
20fi
21
22if [ "$pct" -ge 80 ]; then
23 ctx=31
24elif [ "$pct" -ge 50 ]; then
25 ctx=33
26else
27 ctx=32
28fi
29
30sep='\033[2m·\033[0m'
31printf "\033[35m%s\033[0m $sep \033[36m%s\033[0m" "$model" "${dir##*/}"
32[ -n "$branch" ] && printf " $sep \033[33m%s\033[0m" "$branch"
33printf " $sep \033[%dm%d%%\033[0m\n" "$ctx" "$pct"