From 2d6c3a3fde010e06e60e3ddddd15b8197d35b0b5 Mon Sep 17 00:00:00 2001 From: Kieran Klukas Date: Sun, 9 Aug 2026 15:19:06 -0400 Subject: [PATCH] chore: add crush wakatime hook --- modules/home/system/shell.nix | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/modules/home/system/shell.nix b/modules/home/system/shell.nix index 030be03..36627f7 100644 --- a/modules/home/system/shell.nix +++ b/modules/home/system/shell.nix @@ -210,6 +210,28 @@ let ' "$summary" ''; + crush-wakatime = pkgs.writeShellScriptBin "crush-wakatime" '' + # Heartbeat for Crush, fired from its PreToolUse hook. wakatime-cli + # already reads Claude's transcripts on its own; Crush keeps its + # sessions in sqlite, so nothing sees them unless we say so. + entity="''${CRUSH_TOOL_INPUT_FILE_PATH:-''${CRUSH_PROJECT_DIR:-$CRUSH_CWD}}" + [[ -n "$entity" ]] || exit 0 + + args=( + --entity "$entity" + --plugin "crush/1.0.0 crush-wakatime/1.0.0" + --category "ai coding" + ) + [[ -n "$CRUSH_PROJECT_DIR" ]] && args+=(--project-folder "$CRUSH_PROJECT_DIR") + + case "$CRUSH_TOOL_NAME" in + write | edit | multiedit) args+=(--write) ;; + esac + + # Never block a tool call over time tracking. + ${pkgs.unstable.wakatime-cli}/bin/wakatime-cli "''${args[@]}" >/dev/null 2>&1 || true + ''; + now = pkgs.writeShellScriptBin "now" '' # Post AtProto status updates message="" @@ -841,6 +863,7 @@ in ghrpc assh hackatime-summary + crush-wakatime now ghostty-setup pkgs.unstable.wakatime-cli -- 2.51.2