mirror of
https://github.com/aaddrick/claude-desktop-debian.git
synced 2026-05-17 08:36:35 +03:00
Previously the daemon was forked with stdio:"ignore" and its internal log() was gated by COWORK_VM_DEBUG=1, so a mid-session crash left no trace anywhere. Issue #408 surfaced this: the daemon died silently after ~40 minutes and the cause was unrecoverable from logs. Changes: - mkdirSync the log directory once at module load so writeLog() isn't silently discarded when the daemon is the first thing writing under ~/.config/Claude/logs/. - Add logLifecycle() — an always-on writer (bypasses DEBUG) for startup, listening, SIGTERM, SIGINT, uncaughtException, unhandledRejection, and process exit. A missing startup entry means fork() didn't complete; a startup with no matching exit means SIGKILL (OOM killer, kill -9, etc). - Hook logLifecycle into the entry point and signal handlers. Works in tandem with Patch 6's stdio redirect: Node-level crash dumps (pre-handler native assertions, etc.) land in the same log file via the fd redirection, so the file becomes the single source of truth for daemon death. Co-Authored-By: Claude <claude@anthropic.com>