service-restart-forensics — скилл для Claude Code: разбор рестартов
Скилл service-restart-forensics для Claude Code расследует остановки и перезапуски сервиса. Он проверяет новый процесс и помогает определить, когда причину нельзя найти на этом хосте.
Apache-2.0 ★ 71 обновлён 2026-11-15
npx skills add Problem99-io/kodeblue --skill service-restart-forensics -a claude-codeЧто делает service-restart-forensics
Скилл сопоставляет последние успешные и первые неудачные проверки сервиса, чтобы найти момент остановки. Он проверяет запросы в этом промежутке и исключает остановку через kill_process или stop_unit.
Для нового процесса сверяются исполняемый файл, командная строка и пользователь, а также время изменения точки входа. Скилл учитывает задержку холодного старта и отличает её от зависания; ошибки монитора сверяются с реальным состоянием через host_list и ss.
Код завершения и причина рестарта могут храниться у внешнего супервизора: например, в systemd, среде контейнера или оркестраторе. Если логи и сведения о завершении недоступны на хосте, результат остаётся неопределённым, а не считается безопасным.
Какие задачи решает
- найти события перед остановкой сервиса
- проверить, соответствует ли новый процесс прежнему
- отличить холодный старт от зависания
- сверить ошибки монитора с состоянием хоста
- определить, когда причину нужно искать у супервизора
Примеры запросов агенту
- Разбери, почему сервис остановился и запустился снова.
- Проверь, настоящий ли процесс слушает порт после рестарта.
- Сопоставь ошибки монитора с состоянием сервиса и выясни, где искать причину завершения.
Как установить service-restart-forensics
1Через Skills CLI (Vercel)
npx skills add Problem99-io/kodeblue --skill service-restart-forensics -a claude-code2Вручную: положить файлы
~/.claude/skills/service-restart-forensics/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/service-restart-forensics/
1Через Skills CLI (Vercel)
npx skills add Problem99-io/kodeblue --skill service-restart-forensics -a codex2Вручную: положить файлы
.agents/skills/service-restart-forensics/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add Problem99-io/kodeblue --skill service-restart-forensics -a cursor2Вручную: положить файлы
.cursor/skills/service-restart-forensics/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install Problem99-io/kodeblue blue/skills/service-restart-forensics2Вручную: положить файлы
.github/skills/service-restart-forensics/SKILL.md1Через Skills CLI (Vercel)
npx skills add Problem99-io/kodeblue --skill service-restart-forensics -a gemini-cli2Командой платформы
gemini skills install https://github.com/Problem99-io/kodeblue --path blue/skills/service-restart-forensicsВручную: положить файлы
.devin/skills/service-restart-forensics/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Claude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о service-restart-forensics
Как установить service-restart-forensics в Claude Code?
Выполни npx skills add Problem99-io/kodeblue --skill service-restart-forensics -a claude-code. Файл скилла находится по пути ~/.claude/skills/service-restart-forensics/SKILL.md.
Что делает service-restart-forensics?
Скилл расследует остановку или перезапуск сервиса: сопоставляет сигналы мониторов, проверяет новый процесс и помогает понять, доступна ли причина на этом хосте.
Почему причина рестарта может остаться неизвестной?
Код завершения и причина рестарта могут быть доступны только у супервизора, например в systemd, контейнерной среде или оркестраторе. Если хост не видит эти сведения, результат остаётся неопределённым.
Исходный текст
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