{"version":"2.1.300","anchor":"daemon-process-detection-via-proc-and-ps","canonical_anchor":"daemon-process-detection-via-proc-and-ps","heading":"Claude Code checks a process's command line to tell if it is a daemon","tier":"internal","area":"Daemon","scope":"individual","heads_up":false,"url":"https:\/\/changelogs.core-directive.com\/v\/2.1.300\/e\/daemon-process-detection-via-proc-and-ps","release_url":"https:\/\/changelogs.core-directive.com\/v\/2.1.300","markdown":"### Claude Code checks a process's command line to tell if it is a daemon\n\nTo decide if a process ID belongs to a Claude Code daemon, Claude Code now reads its command line, falling back to `ps` if that fails\n\n**What**\n\nA daemon is a Claude Code process that runs in the background. Every running program has a process ID, or pid. Claude Code's check for whether a given pid is one of its daemons now reads that process's command line from `\/proc\/<pid>\/cmdline` and looks for the daemon's start-up words, such as `daemon run` or the `--json-path`, `--log-file` and `--origin service` options. If that file cannot be read, it asks the `ps` command instead.\n\n**Why**\n\nA saved pid can go stale and end up pointing at an unrelated program. Checking the command line makes it less likely that Claude Code treats such a program as its own daemon.\n\n- Area: Daemon\n- Tier: Under the hood\n- Useful: 1\/5\n- Signal: 1\/5\n- Scope: individual\n- Heads-up: no"}