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
npx skills add Problem99-io/kodeblue --skill service-restart-forensics -a claude-codeWhat 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-code2Manually: put the files in place
~/.claude/skills/service-restart-forensics/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/service-restart-forensics/
1Skills CLI (Vercel)
npx skills add Problem99-io/kodeblue --skill service-restart-forensics -a codex2Manually: put the files in place
.agents/skills/service-restart-forensics/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Problem99-io/kodeblue --skill service-restart-forensics -a cursor2Manually: put the files in place
.cursor/skills/service-restart-forensics/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Problem99-io/kodeblue blue/skills/service-restart-forensics2Manually: put the files in place
.github/skills/service-restart-forensics/SKILL.md1Skills CLI (Vercel)
npx skills add Problem99-io/kodeblue --skill service-restart-forensics -a gemini-cli2Platform CLI
gemini skills install https://github.com/Problem99-io/kodeblue --path blue/skills/service-restart-forensicsManually: put the files in place
.devin/skills/service-restart-forensics/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
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