claude_version 1.4.1

Claude Code version manager: install, upgrade, and session lifecycle
Documentation
# Feature: Process Lifecycle

### Scope

- **Purpose**: Document the process listing and kill commands for running Claude Code sessions.
- **Responsibility**: Describe process detection via `/proc`, SIGTERM/SIGKILL signal sequence, force kill mode, and post-kill verification.
- **In Scope**: `.processes`, `.processes.kill`, `/proc` scanning, signal sequence, force::1 behavior, post-kill verification.
- **Out of Scope**: Version management (→ `feature/001_version_management.md`), hot-swap during install (→ `feature/001_version_management.md`).

### Design

**Process detection:** `.processes` scans `/proc/{pid}/cmdline` for entries where `basename == "claude"` (exact match, not substring). The scanner's own PID is excluded. Unreadable `/proc` entries are skipped non-fatally. Linux-only: uses the `/proc` filesystem.

**Kill sequence — normal mode:**
1. Send SIGTERM to all detected claude processes
2. Sleep 2 seconds
3. Send SIGKILL to any survivors
4. Sleep 500ms
5. Verify: if any processes still survive, return exit code 2

**Kill sequence — force mode (`force::1`):**
1. Send SIGKILL directly (skip SIGTERM, skip 2s wait)
2. Sleep 500ms
3. Verify: if any processes still survive, return exit code 2

Signal delivery uses `Command::new("kill")` (no `libc`, enforced by `unsafe-code = "deny"` workspace lint).

**Kill isolation invariant:** Kill signals are delivered only when a user explicitly invokes `.processes.kill`. The `.version.guard` and `.version.install` flows interact with running processes exclusively via `hot_swap_binary()` (unlink of the binary path), which allows running sessions to continue from their open file descriptor. No automatic path — guard, install, daemon, or interval-watch mode — ever reaches `send_kill_signals()` or any `libc::kill` call.

**Post-kill verification:** After the kill sequence completes, the process list is re-scanned. Any surviving processes cause exit code 2. This verification applies to both normal and force kill modes.

**Dry-run:** `dry::1` prints `[dry-run] would kill N process(es)` without sending any signals.

### Features

| File | Relationship |
|------|-------------|
| [feature/004_dry_run.md]004_dry_run.md | dry::1 preview mode for .processes.kill |
| [feature/005_cli_design.md]005_cli_design.md | CLI routing and exit code mapping |

### Sources

| File | Relationship |
|------|-------------|
| `../../src/commands/process.rs` | Process command routines |

### Provenance

| Source | Notes |
|--------|-------|
| `spec.md` (deleted) | FR-08, FR-09, Command Inventory (commands 7-8), Known Limitations |

### Tests

| File | Relationship |
|------|-------------|
| [tests/docs/feature/02_process_lifecycle.md]../../tests/docs/feature/02_process_lifecycle.md | Feature test spec |