Skip to main content
skill CX Codex

service-restart-forensics — Claude Code skill for service restarts

service-restart-forensics is a Claude Code skill that investigates stopped or restarted services. It checks the replacement process and identifies when this host cannot reveal the cause.

Apache-2.0 ★ 71 updated 2026-11-15

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Problem99-io/kodeblue --skill service-restart-forensics -a claude-code
Open on GitHub

What service-restart-forensics does

The skill narrows down a service outage by comparing its last successful signal with the first failure. It checks activity around that window and rules out stops issued through kill_process or stop_unit.

It compares the restarted process by executable, command line, and user, then checks the entrypoint's modification time. The skill allows for a cold start before treating a missing listener as a hang. Monitor errors are checked against host state with host_list and ss.

Exit codes and restart reasons may belong to an external supervisor, such as systemd, a container runtime, or an orchestrator. If those records cannot be read on the host, the result is inconclusive rather than benign.

What it helps with

  • trace events preceding a service outage
  • check whether a restarted process matches its baseline
  • distinguish a cold start from a hang
  • compare monitor errors with actual host state
  • identify when restart records must come from a supervisor

Example prompts for the agent

  • Find out why the service stopped and restarted.
  • Check whether the process listening after the restart is legitimate.
  • Compare the monitor failures with the host state and determine where the exit reason can be found.

How to install service-restart-forensics

1Skills CLI (Vercel)

npx skills add Problem99-io/kodeblue --skill service-restart-forensics -a claude-code

2Manually: put the files in place

~/.claude/skills/service-restart-forensics/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/service-restart-forensics/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about service-restart-forensics

How do I install service-restart-forensics in Claude Code?

Run npx skills add Problem99-io/kodeblue --skill service-restart-forensics -a claude-code. The skill file is at ~/.claude/skills/service-restart-forensics/SKILL.md.

What does service-restart-forensics do?

It investigates service stops and restarts by comparing monitor signals, checking the replacement process, and determining whether this host can reveal the cause.

Why might the restart cause remain inconclusive?

Exit codes and restart reasons may be recorded by a supervisor such as systemd, a container runtime, or an orchestrator. If those records are unavailable on the host, the finding remains inconclusive.

Source text

SKILL.md · Apache-2.0
---
name: service-restart-forensics
description: A watched service died, restarted or stopped listening — work out why, check the new process is the real one, and know when the cause cannot be found from this host.
metadata:
  kodeblue-bundled: true
---

# Service died or restarted

When monitors report a service gone ("0 running", no listener, health check
failing) and it comes back, there are three questions: why it died, whether the
new process is legitimate, and whether the death is part of an attack.

## 1. Bracket the death
- The last good sign: the last successful request in the request log, the last
  passing monitor run (`monitor_list`).
- The first bad sign: the first failing monitor run, the listener disappearing.
- Requests in that window matter most. Attack traffic just before the death is
  a likely cause (a crash exploit or an exploit that killed the process); a quiet
  log means look elsewhere.
- `response_list`: rule out kodeblue's own `kill_process` or `stop_unit`.

## 2. Check the new process
- `host_exec ["ps","-o","pid,ppid,user,lstart,etime,cmd","-p","<pid>"]`: same
  executable, same command line, same user as the baseline; no children.
- PIDs change on every restart. Compare by executable, command line and user,
  never by PID.
- A parent PID of 0 means it is supervised from outside its PID namespace (a
  container runtime). That is normal in containers.
- `readlink -f /proc/<pid>/exe` and the entrypoint's mtime (`host_list` or
  `stat` on the script or binary it runs): a newer entrypoint than the deploy
  means tampering.
- Empty drop zones as the service sees them: `/proc/<pid>/root/tmp`,
  `var/tmp`, `dev/shm`.

## 3. Expect the cold start
Many services take seconds to minutes after the process starts before they
listen. "Process up, no listener" right after a restart is a cold start until
it lasts longer than the service's normal start time (write that time into the
server-role definition). Re-check before calling it a hang.

Files written in the first minutes after a start are often the service's own
startup work (translations, caches, compiled assets). Compare file times with
the process start before calling them tampering (see
`service-process-exploitation`, §5), and remember that a restart you caused
repeats those writes.

## 4. Monitor errors are not evidence
While a process is down, monitors that look inside it fail with errors such as
"no running process" or an unresolved `{pid:…}` path. That output says the target
was missing, not that a file appeared or a connection opened. Check the real
state (`host_list`, `ss`) before you reason from it.

## 5. When the cause cannot be found here
The exit code, an out-of-memory kill and the runtime's restart reason live with
whatever supervises the service (systemd, the container runtime, the
orchestrator). kodeblue may not see them: there may be no `journalctl`,
`dmesg` or runtime CLI where it runs, and the app's stdout and stderr may go to
pipes it cannot read. Check what is available
(`host_exec ["journalctl","-u","<unit>","--since","<time>","--no-pager"]`, `free -m`);
if it is not there, say so.

## Verdict
- Death explained (deploy, admin restart, a logged crash with a known cause) and
  the new process checks out: `benign_change`.
- Cause unknown, everything else clean: `inconclusive`, never benign. Ask the
  operator for the runtime's exit records.
- Attack traffic just before the death, a changed entrypoint, or files written
  long after the start: investigate as an attack (`service-process-exploitation`,
  `web-app-attack-chain`).

© Problem99-io · Apache-2.0 · Problem99-io/kodeblue

Similar skills

All skills for DevOps and infrastructure →

From the same set13

The whole set →
containment-verification containment-verification is a Claude Code skill that inspects the host after security actions like block_ip, kill_process, quarantine_file, or stop_unit to confirm they hold. CX Codex +1 ★ 71repo stars linux-intrusion-triage linux-intrusion-triage is a Claude Code skill for examining a Linux host that may have been compromised. It guides the initial checks in sequence, using kodeblue’s read-only tools. CX Codex +1 ★ 71repo stars false-positive-playbook false-positive-playbook is a Claude Code skill that helps agents prove security findings are benign. It checks package logs, deployments, and admin sessions instead of guessing. CX Codex +1 ★ 71repo stars web-app-attack-chain web-app-attack-chain is a Claude Code skill that rebuilds a web app attack from request logs. It identifies successful in-app actions and lists the cleanup a person must handle. CX Codex +1 ★ 71repo stars kodeblue-self-integrity kodeblue-self-integrity is a Claude Code skill that investigates changes to kodeblue binaries, engine, and configuration. It analyzes whether modifications or watcher downtime stem from tampering. CX Codex +1 ★ 71repo stars outbound-destination-check outbound-destination-check is a Claude Code skill that inspects unexpected outbound connections to separate regular vendor phone-home calls from potential intruder traffic. CX Codex +1 ★ 71repo stars service-process-exploitation service-process-exploitation is a Claude Code skill for detecting code execution inside a legitimate service process. It examines child processes, outbound connections, and file changes. CX Codex +1 ★ 71repo stars container-breakout-detection container-breakout-detection is a Claude Code skill that discovers code escapes from containers to the host. It inspects host namespaces, runtime sockets, and kernel parameters. CX Codex +1 ★ 71repo stars

Project sponsors

Companies that keep this analytics open