dotfiles bugabingas dorkfiles
owned by bugabinga
README Source History Refs Reviews Compare Notes Search Review guide CI runs Merge remote-tracking branch 'bugabinga/trunk' into audio-event-driven-state 919a52b4dcb106dfe874456c73a0b0685b5c82fc
Oliver Jan Krylow <oliver@bugabinga.net > · 27 Jun 2026
unsigned
Browse files Compare with HEAD
# Conflicts:
# pi-ext
# pi/agent/settings.json
Changed files (8) Diff layout Auto Unified Split
NB-00718.symlinks Modified +18 / −0 text lines
1 1 forgejo-cli
forgejo-cli
2 2 ~/AppData/Roaming/Cyborus/forgejo-cli/config
~/AppData/Roaming/Cyborus/forgejo-cli/config
5 + ~/.claude/settings.json
7 + claude/cc-statusline-hook.js
8 + ~/.claude/cc-statusline-hook.js
11 + ~/.claude/statusline.js
claude/STATUSLINE.md Added new file mode 100644+141 / −0 text lines
1 + # Claude Code Statusline 3 + Eine einzeilige, Statusline für Claude Code.4 + Reines Node (stdlib), ein Renderer + ein Hook. Cross-Plattform (win/mac/linux).9 + RD-1950 · Opus 4.8 · xhigh · RD-1950 · 5h ██▋░░░░░ 33%·2h44m · 7d █▏░░░░░░ 14% · 🔥$26.68/hr · $0.499 $136.54Σ $486.13☾ · caveman:full12 + Segmente (v.l.n.r.): Verzeichnis · Modell · Effort · Git/JJ-Branch · 5h-Limit ·13 + 7d-Limit · Burn-Rate ($/h) · Kosten (Turn / Session Σ / Monat ☾) · Caveman-Badge.19 + | Dep | Pflicht | Zweck |20 + |-----|---------|-------|21 + | **Node ≥ 18** | ✅ | Laufzeit. Nur stdlib (`fs/os/path/crypto/child_process`), keine npm-Pakete. |22 + | **Claude Code** | ✅ | Liefert den JSON-Payload (inkl. Kosten) via stdin. |23 + | **git** oder **jj** | ➖ | Branch-Segment. Muss im `PATH` sein. Ohne → Segment entfällt. |24 + | **Nerd Font** | ➖ (empfohlen) | Glyphen ``, Balken `█▏░`, Icons. Ohne → Tofu (`□`). |25 + | **caveman-Plugin** | ➖ | Caveman-Badge. Ohne → Badge entfällt. |33 + | [`statusline.js`](./statusline.js) | Renderer. Liest stdin-JSON, gibt eine Zeile aus. |34 + | [`cc-statusline-hook.js`](./cc-statusline-hook.js) | Hook. Setzt Turn-Marker + Workflow-Badge. |36 + Beide nach `~/.claude/` kopieren oder symlinken:39 + ln -s "$PWD/statusline.js" ~/.claude/statusline.js40 + ln -s "$PWD/cc-statusline-hook.js" ~/.claude/cc-statusline-hook.js47 + 1. Node ≥ 18 installieren, im `PATH`.48 + 2. Beide Dateien nach `~/.claude/` (s.o.).49 + 3. `~/.claude/settings.json` ergänzen (Auszug unten).50 + 4. Nerd Font im Terminal aktivieren (sonst Tofu statt Glyphen).51 + 5. Claude Code neu starten.53 + ### settings.json (Auszug) 59 + "command": "node ~/.claude/statusline.js"62 + // Turn-Marker: Basis für die "Turn"-Kosten (Δ seit letztem Prompt)63 + "UserPromptSubmit": [66 + { "type": "command", "command": "node ~/.claude/cc-statusline-hook.js" }70 + // Workflow-Badge: NUR beim Workflow-Tool feuern (matcher scoped!)73 + "matcher": "Workflow",75 + { "type": "command", "command": "node ~/.claude/cc-statusline-hook.js" }83 + Der Hook ist **ein** Skript für beide Events; es verzweigt über `hook_event_name`.89 + - Claude Code spawnt `statusline.js` **pro Render** (frischer Prozess, Payload via90 + stdin, 300 ms Debounce, event-getriggert: neue Assistant-Nachricht, `/compact`,91 + Permission-/Vim-Mode-Wechsel). Per-Render-Spawn ist von der API erzwungen.92 + - Renderer baut Segmente, jeweils eigener `try/catch` (ein Crash darf die Zeile nicht93 + leeren), und schreibt **ohne** Trailing-Newline.94 + - **Turn-Kosten**: Der Hook legt bei `UserPromptSubmit` eine Marker-Datei95 + `~/.claude/.cc-turn-<session>` an. Der nächste Render liest sie, rebaselined den96 + Turn-Start und löscht den Marker.97 + - **Workflow-Badge**: Bei `PreToolUse(Workflow)` schreibt der Hook eine selbst-98 + ablaufende Zeile nach `~/.claude/.cc-statusline-extra` (TTL 120 s), die der Renderer100 + - **Kosten-Ledger** `~/.claude/.cc-cost-ledger.json`: Turn / Session / Monat (monats-101 + übergreifend kumuliert). Idle-Renders (keine Kostenänderung) schreiben nicht.102 + Selbst-GC räumt alte `.cc-*.tmp` / `.cc-turn-*` (> 1 Tag) auf.108 + Tunables stehen oben in `statusline.js` im `CONFIG`-Block:110 + | Schlüssel | Default | Bedeutung |111 + |-----------|---------|-----------|112 + | `sep` | `" · "` | Trenner zwischen Segmenten. |113 + | `barWidth` | `8` | Zellen pro Usage-Balken. |114 + | `costStyle` | `"icon"` | `"icon"` = helle `$Zahl` + gedämpftes Glyph; `"slash"` = `$x/turn`. |115 + | `gitCacheTtlMs` | `8000` | Cache für `git status` (Spawn ist ~400 ms kalt auf win32). |116 + | `contextWarnPct`/`CritPct` | `70`/`90` | Schwellen Kontext-Balken (gelb/rot). |117 + | `usageWarnPct`/`CritPct` | `50`/`80` | Schwellen Rate-Limit-Balken. |118 + | `burnWindowMs` | `10 min` | Fenster für die Burn-Rate ($/h). |122 + ## Performance (win32) 124 + - Harte Untergrenze ist **nicht** das Skript, sondern der Node-Kaltstart:125 + `node -e 0` ≈ **120 ms** (Prozess-Spawn + V8-Init). Nicht durch Flags reduzierbar.126 + - **< 100 ms ist mit Node unmöglich.** Nur ein kompiliertes Binary (Go/Rust ~10–20 ms)127 + unterbietet das — kostet aber Cross-Plattform (per-OS-Builds) + zweite Codebase.128 + Bun (win32) und Deno sind langsamer als Node; LLRT kann kein stdin lesen. → Node.129 + - Die Bar ist asynchron und blockiert keine Eingabe; ~120–140 ms sind unsichtbar.135 + | Symptom | Ursache / Fix |136 + |---------|---------------|137 + | `□`/Tofu statt Glyphen | Nerd Font nicht aktiv im Terminal. |138 + | Keine Kosten | Alte Claude-Code-Version ohne `cost` im Payload. |139 + | Kein Branch-Segment | `git`/`jj` nicht im `PATH`, oder nicht in einem Repo. |140 + | Keine Turn-Kosten | Hook nicht in `UserPromptSubmit` registriert. |141 + | Statusline leer | `statusline.js` wirft beim Start — manuell testen: `echo '{}' \| node ~/.claude/statusline.js`. |claude/statusline.js Modified +56 / −25 text lines
22 22 const CONFIG = {const CONFIG = {24 24 barWidth: 8 , barWidth: 8 , 25 25 contextWarnPct: 70 , contextWarnPct: 70 ,26 26 contextCritPct: 90 , contextCritPct: 90 ,27 27 usageAlways: true , usageAlways: true ,28 28 usageWarnPct: 50 , usageWarnPct: 50 ,29 29 usageCritPct: 80 , usageCritPct: 80 ,32 32 extraTtlMs: 120000 , extraTtlMs: 120000 ,33 33 cmdTimeoutMs: 2500 , cmdTimeoutMs: 2500 ,34 34 ledgerPruneDays: 40 , ledgerPruneDays: 40 ,99 - if (d?. model?. display_name) push(c. magenta(d. model. display_name));100 + if (d?. model?. display_name) push(c. magenta(d. model. display_name. replace ( / \s * \( [ ^ )] * \ )\s * $ / , " " ) ) ) ;100 101 } catch {}} catch {}105 106 if (lvl) { if (lvl) {106 107 const on = d?. thinking?. enabled !== false ; const on = d?. thinking?. enabled !== false ;107 108 const col = lvl === "max" || lvl === "xhigh" ? c. magenta : lvl === "high" ? c. blue : c. dim; const col = lvl === "max" || lvl === "xhigh" ? c. magenta : lvl === "high" ? c. blue : c. dim;108 - push(on ? col(` ⚡ ${ lvl} ` ) : c. dim(` ⚡ ${ lvl} ` ));109 + push(on ? col(lvl) : c. dim(lvl)); 110 111 } catch {}} catch {}159 160 const { turn, month, burnRate } = updateLedger(sid, total); const { turn, month, burnRate } = updateLedger(sid, total);161 162 if (burnRate > 0 ) push(c. orange(` 🔥$ ${ burnRate. toFixed(2 )} /hr ` )); if (burnRate > 0 ) push(c. orange(` 🔥$ ${ burnRate. toFixed(2 )} /hr ` ));163 - const fmt = (n, type, icon, color ) => 164 - CONFIG. costStyle === "icon" ? color(`${ icon} $ ${ money(n)}` ) : color(` $ ${ money(n)} / ${ type}` );165 + const fmt = (n, type, icon) => 166 + CONFIG. costStyle === "icon" 167 + ? c. white(` $ ${ money(n)}` ) + (icon ? c. dim(icon) : "" )168 + : c. white(` $ ${ money(n)} / ${ type}` );165 169 const seg = []; const seg = [];166 - if (turn > 0 ) seg. push(fmt(turn, "turn" , "⟳ " , c . white ));167 - seg. push(fmt(total, "session" , "Σ" , c . dim ));168 - if (month > 0 ) seg. push(fmt(month, "month" , "☾" , c . dim ));170 + if (turn > 0 ) seg. push(fmt(turn, "turn" , "" ));171 + seg. push(fmt(total, "session" , "Σ" ));172 + if (month > 0 ) seg. push(fmt(month, "month" , "☾" ));169 173 push(seg. join(" " )); push(seg. join(" " ));171 175 } catch {}} catch {}210 214 L = JSON . parse(fs. readFileSync(file, "utf8" )); L = JSON . parse(fs. readFileSync(file, "utf8" ));211 215 } catch {} } catch {}212 216 if (! L. sessions) L. sessions = {}; if (! L. sessions) L. sessions = {};216 221 if (L. month !== mk) { if (L. month !== mk) {217 222 L. month = mk; L. month = mk;218 223 L. monthTotal = 0 ; L. monthTotal = 0 ;233 239 if (fs. existsSync(marker)) { if (fs. existsSync(marker)) {234 240 s. turnStart = total; s. turnStart = total;235 241 fs. unlinkSync(marker); fs. unlinkSync(marker);237 244 } catch {} } catch {}240 247 const delta = total - (s. total ?? 0 ); const delta = total - (s. total ?? 0 );241 - if ( delta > 0 ) L. monthTotal = (L. monthTotal || 0 ) + delta;249 + L. monthTotal = (L. monthTotal || 0 ) + delta;243 253 const turn = Math . max(0 , total - (s. turnStart ?? total)); const turn = Math . max(0 , total - (s. turnStart ?? total));249 257 if (! Array . isArray(s. samples)) s. samples = []; if (! Array . isArray(s. samples)) s. samples = [];250 - s. samples. push([now, total]);261 + s. samples. push([now, total]);262 + if (s. samples. length > CONFIG. burnMaxSamples) s. samples = s. samples. slice(- CONFIG. burnMaxSamples);251 266 const wcut = now - CONFIG. burnWindowMs; const wcut = now - CONFIG. burnWindowMs;252 267 s. samples = s. samples. filter((p) => p[0 ] >= wcut); s. samples = s. samples. filter((p) => p[0 ] >= wcut);253 - if (s. samples. length > CONFIG. burnMaxSamples) s. samples = s. samples. slice(- CONFIG. burnMaxSamples);
254 268 const burnRate = computeBurnRate(s. samples); const burnRate = computeBurnRate(s. samples);256 270 L. sessions[sid] = s; L. sessions[sid] = s;259 - const tmp = `${ file} . ${ process . pid } .tmp ` ;260 - fs. writeFileSync(tmp, JSON . stringify(L));261 - fs. renameSync(tmp, file);276 + const tmp = `${ file} . ${ process . pid } .tmp ` ;277 + fs. writeFileSync(tmp, JSON . stringify(L));278 + fs. renameSync(tmp, file);284 + const stale = now - 864e5 ;285 + for (const f of fs. readdirSync(claudeDir)) {286 + if (! ((f. startsWith(".cc-" ) && f. endsWith(".tmp" )) || f. startsWith(".cc-turn-" ))) continue ;287 + const fp = path. join(claudeDir, f);289 + if (fs. statSync(fp). mtimeMs < stale) fs. unlinkSync(fp);264 295 return { turn, month: L. monthTotal || 0 , burnRate }; return { turn, month: L. monthTotal || 0 , burnRate };357 388 if (branch === "(detached)" ) branch = "detached" ; if (branch === "(detached)" ) branch = "detached" ;358 389 const col = dirty > 0 ? c. yellow : c. green; const col = dirty > 0 ? c. yellow : c. green;359 - let s = col(` ⎇ ${ branch}` );390 + let s = col(` ${ branch}` ); 360 391 if (dirty > 0 ) s += c. yellow(` ● ${ dirty}` ); if (dirty > 0 ) s += c. yellow(` ● ${ dirty}` );361 392 if (ahead) s += c. cyan(` ↑ ${ ahead}` ); if (ahead) s += c. cyan(` ↑ ${ ahead}` );362 393 if (behind) s += c. cyan(` ↓ ${ behind}` ); if (behind) s += c. cyan(` ↓ ${ behind}` );395 426 "commit" , "review" , "compress" , "commit" , "review" , "compress" ,397 428 if (! valid. has(mode) || mode === "off" ) return "" ; if (! valid. has(mode) || mode === "off" ) return "" ;398 - let out = c. orange(mode || "full" );429 + let out = c. dim("caveman:" ) + c. orange(mode || "full" ); 399 430 if (process . env . CAVEMAN_STATUSLINE_SAVINGS !== "0" ) { if (process . env . CAVEMAN_STATUSLINE_SAVINGS !== "0" ) {401 432 const sf = path. join(claudeDir, ".caveman-statusline-suffix" ); const sf = path. join(claudeDir, ".caveman-statusline-suffix" );codex/config.toml Modified +51 / −0 text lines
1 + approval_policy = "never" 2 + sandbox_mode = "danger-full-access" 3 + permission_profile = "disabled" 4 + approvals_reviewer = "user" 1 6 project_doc_fallback_filenames = ["CLAUDE.md" ]project_doc_fallback_filenames = ["CLAUDE.md" ]
12 + hide_full_access_warning = true 15 + theme = "inspired-github" 16 + status_line = ["model-with-reasoning" , "current-dir" , "project-name" , "git-branch" , "pull-request-number" , "branch-changes" , "context-used" , "five-hour-limit" , "weekly-limit" , "context-window-size" , "fast-mode" , "thread-title" , "task-progress" ]17 + status_line_use_colors = true 18 + session_picker_view = "comfortable" 21 + [tui .model_availability_nux ]3 24 [projects ."/home/okr" ][projects ."/home/okr" ]4 25 trust_level = "trusted" trust_level = "trusted"
27 + [projects .'c:\users\okr' ]28 + trust_level = "trusted" 30 + [projects .'c:\users\okr\.codex' ]31 + trust_level = "trusted" 33 + [projects .'c:\users\okr\workspace' ]34 + trust_level = "trusted" 36 + [projects .'c:\users\okr\workspace\dotfiles' ]37 + trust_level = "trusted" 39 + [projects .'c:\users\okr\workspace\isp-insoft-cloud' ]40 + trust_level = "trusted" 42 + [projects .'c:\users\okr\workspace\kkg' ]43 + trust_level = "trusted" 45 + [projects .'c:\users\okr\workspace\kkg-cloud' ]46 + trust_level = "trusted" 48 + [projects .'c:\users\okr\workspace\kkg5' ]49 + trust_level = "trusted" 51 + [projects .'c:\users\okr\workspace\dotfiles\notes\isp-insoft\kultur\ki_roadmap' ]52 + trust_level = "trusted" 6 54 [plugins ."atlassian-rovo@openai-curated" ][plugins ."atlassian-rovo@openai-curated" ]7 55 enabled = true enabled = true 12 60 [plugins ."build-web-data-visualization@openai-curated" ][plugins ."build-web-data-visualization@openai-curated" ]13 61 enabled = true enabled = true
63 + [plugins ."claude-skills@personal" ]15 66 [plugins ."codex-security@openai-curated" ][plugins ."codex-security@openai-curated" ]16 67 enabled = true enabled = true wezterm/bugabinga/options.lua Modified +2 / −1 text lines
17 17 target = 'CursorColor' , target = 'CursorColor' ,19 19 cfg.unzoom_on_switch_pane = true cfg.unzoom_on_switch_pane = true 20 - cfg.scrollback_lines = 100000 21 + cfg.front_end = "WebGpu" wezterm/bugabinga/status.lua Modified +10 / −11 text lines
98 98 local host_domain = function ()local host_domain = function ()99 99 local triple = wez.target_triple or '' local triple = wez.target_triple or '' 100 - if triple:find( 'windows' , 1 , true ) then return 'WIN' , wez.nerdfonts.dev_windows or '□ ' , palette.warning end 101 - if triple:find( 'darwin' , 1 , true ) then return 'MAC' , wez.nerdfonts.dev_apple or '□ ' , palette.ui.important_local end 102 - if triple:find( 'linux' , 1 , true ) then return 'LIN' , wez.nerdfonts.dev_linux or '□ ' , palette.ui.important_local end 103 - if triple:find( 'bsd' , 1 , true ) then return 'BSD' , wez.nerdfonts.dev_freebsd or '□ ' , palette.ui.important_local end 104 - return 'LOC' , wez.nerdfonts.cod_terminal or '□ ' , palette.ui.important_local100 + if triple:find( 'windows' , 1 , true ) then return 'WIN' , wez.nerdfonts.dev_windows or ' ' , palette.warning end 101 + if triple:find( 'darwin' , 1 , true ) then return 'MAC' , wez.nerdfonts.dev_apple or ' ' , palette.ui.important_local end 102 + if triple:find( 'linux' , 1 , true ) then return 'LIN' , wez.nerdfonts.dev_linux or ' ' , palette.ui.important_local end 103 + if triple:find( 'bsd' , 1 , true ) then return 'BSD' , wez.nerdfonts.dev_freebsd or ' ' , palette.ui.important_local end 104 + return 'LOC' , wez.nerdfonts.cod_terminal or ' ' , palette.ui.important_local107 107 local domain_label = function ( domain )local domain_label = function ( domain )108 - if domain == 'unix' then return 'MUX' , wez.nerdfonts.cod_server or wez.nerdfonts.cod_terminal or '□ ' , palette.info end 108 + if domain == 'unix' then return 'MUX' , wez.nerdfonts.cod_server or wez.nerdfonts.cod_terminal or ' ' , palette.info end 109 109 if not domain or domain == 'local' or domain == 'Local' then return host_domain() end if not domain or domain == 'local' or domain == 'Local' then return host_domain() end 110 - if domain:find( '^WSL:' , 1 , false ) then return 'WSL' , wez.nerdfonts.dev_linux or '□ ' , palette.ui.important_local end 111 - if domain:find( '^scope:' , 1 , false ) then return 'EXE' , wez.nerdfonts.cod_gear or '□ ' , palette.warning end 112 - return ( domain:upper():gsub( '[^%w]' , '' ):sub( 1 , 3 ) .. 'LOC' ):sub( 1 , 3 ), wez.nerdfonts.cod_terminal or '□ ' , palette.ui.important_local110 + if domain:find( '^WSL:' , 1 , false ) then return 'WSL' , wez.nerdfonts.dev_linux or ' ' , palette.ui.important_local end 111 + if domain:find( '^scope:' , 1 , false ) then return 'EXE' , wez.nerdfonts.cod_gear or ' ' , palette.warning end 112 + return ( domain:upper():gsub( '[^%w]' , '' ):sub( 1 , 3 ) .. 'LOC' ):sub( 1 , 3 ), wez.nerdfonts.cod_terminal or ' ' , palette.ui.important_local115 115 wez.on( 'format-tab-title' , function ( tab, tabs, panes, config, hover, max_width )wez.on( 'format-tab-title' , function ( tab, tabs, panes, config, hover, max_width )202 202 cfg.enable_tab_bar = true cfg.enable_tab_bar = true 203 203 cfg.hide_tab_bar_if_only_one_tab = false cfg.hide_tab_bar_if_only_one_tab = false 204 204 cfg.use_fancy_tab_bar = false cfg.use_fancy_tab_bar = false 205 - cfg.tab_max_width = 64 205 + cfg.tab_max_width = 128 206 206 cfg.show_tabs_in_tab_bar = true cfg.show_tabs_in_tab_bar = true 207 207 cfg.show_new_tab_button_in_tab_bar = false cfg.show_new_tab_button_in_tab_bar = false 208 208 cfg.tab_bar_at_bottom = true cfg.tab_bar_at_bottom = true 209 - cfg.status_update_interval = 1000
wezterm/bugabinga/window.lua Modified +2 / −2 text lines
1 1 local wez = require 'wezterm' local wez = require 'wezterm' 3 3 return function ( cfg )return function ( cfg )4 - cfg.window_background_opacity = 1.0 5 - cfg.window_decorations = 'RESIZE|NONE' 5 + cfg.window_decorations = wez.target_triple:find( 'windows' , 1 , true ) and 'RESIZE' or 'RESIZE|NONE' 6 6 cfg.use_resize_increments = true cfg.use_resize_increments = true 7 7 cfg.adjust_window_size_when_changing_font_size = false cfg.adjust_window_size_when_changing_font_size = false wezterm/bugabinga/workspace_switcher.lua Modified +15 / −2 text lines
54 54 return choice_table return choice_table
57 + local function is_dir ( path )59 + local ok, result = pcall ( wezterm.read_dir, path )60 + return ok and result ~= nil 57 63 local function get_workspace_dir_elements ( choice_table, workspace_ids )local function get_workspace_dir_elements ( choice_table, workspace_ids )58 64 local workspace_dir = wezterm.home_dir .. '/Workspace' local workspace_dir = wezterm.home_dir .. '/Workspace' 59 - local stdout = run_child_process { 'find' , workspace_dir, '-mindepth' , '1' , '-maxdepth' , '1' , '-type' , 'd' }60 - local paths = wezterm.split_by_newlines( stdout )65 + local ok, entries = pcall ( wezterm.read_dir, workspace_dir )66 + if not ok or not entries then return choice_table end 69 + for _, entry in ipairs ( entries ) do 70 + if is_dir( entry ) then 71 + table .insert ( paths, entry )61 74 table .sort ( paths ) table .sort ( paths )62 75 for _, path in ipairs ( paths ) do for _, path in ipairs ( paths ) do 63 76 add_path_element( choice_table, workspace_ids, path ) add_path_element( choice_table, workspace_ids, path )