process-lifecycle
БесплатноБез исполняемых скриптовНе проверенUse when changing subprocess execution, cancellation, process-tree cleanup, orphan reaping, or Windows child hardening.
от kunchenguid★ 9 314 звёзд на GitHubОб этом скилле
Context, Concurrency, and Processes
- Thread
context.Contextthrough long-running, subprocess, and networked work; preferexec.CommandContext; use derived contexts and timeouts for cleanup and HTTP calls. - Route every long-lived subprocess spawned for a cancellable step or agent invocation through the appropriate
shellenvlifecycle configurator. Agents and other subprocesses useConfigureShellCommand: it creates a process-tree boundary and installscmd.Cancelto kill the whole tree, so grandchildren (test workers, build watchers) cannot outlive cancellation and hold the next run's worktree locked. Repositorycommands.*and custom gates useConfigureCooperativeShellCommand: on Windows it sends targetedCTRL_BREAK, preserves up to a three-second cleanup window, then retains the same forced Job Object fallback. Regressions:TestConfigureCooperativeShellCommandCancelAllowsCleanup,TestConfigureCooperativeShellCommandCancelForcesNonCooperatingTree. cmd.Cancelcovers only cancellation; on clean exit or error the group is not reaped, and leaked grandchildren accumulate until the OS OOM-kills the daemon (surfacing asdaemon crashed during executionwith no stack trace). Useshellenv.RunShellCommand/OutputShellCommand/CombinedOutputShellCommandfor one-shot commands, orStartShellCommandplusTerminateShellCommandGroupwhen handling pipes manually; the helper doc comments ininternal/shellenvown the details.ConfigureShellCommandalso installs a 5scmd.WaitDelaybackstop so a grandchild holding an inherited pipe cannot wedgecmd.Waitforever. For Claude, Codex, and Pi, a cleanly exited agent's completed result remains usable when that backstop closes an inherited pipe; without a completed result, the parse failure is retained and reports whether a result event arrived. Claude also stops a process still openclaudeResultGraceafter its completed result (background work holds print mode open); aRequireCompletedChildrenturn fails there and never counts that result. Regressions:TestClaudeAgent_BackgroundWorkAfterResult,TestNativeAgents_FinishedResultSurvivesEscapedStdoutHolder,TestNativeAgents_UnfinishedRunKeepsParseErrorOverWaitDelay,TestCodexEmptyResultEventIsReportedAsReceived,TestCodexAgent_Run_ReapsLeakedGrandchildOnCleanExit,TestRunShellCommandWithEnv_ReapsGrandchildOnCleanExit,TestTerminateShellCommandGroup_*.- A process group is a lineage container, not a sandbox: a descendant that calls
setsid(2)/setpgid(2)(agent CLIs sandboxing their tool runners, any daemonizing worker script) leaves the group, and after its parent exits nothing lineage-based can name it again - it burns CPU and holds a deleted worktree's cwd forever.internal/procreapis the identity-based backstop: it matches a process by the run worktree its cwd resolves under (deliberately never argv, which a legitimategit worktree removealso carries), never touches pid<=1/itself/its ancestors, spares worktrees whose run is still pending or running, and escalates SIGTERM to SIGKILL only after a grace period. Reach is<NM_HOME>/worktreesby path shape plus exactly the run worktrees a caller names from run records (Options.Worktrees), never a configured worktree root by shape - an operator's own directory is unmatchable unless a run row names it. Every site that removes a run worktree sweeps it first throughprocreap.SweepRunWorktree(s)(run cleanup and setup failure viaRunManager.removeRunWorktree, startup cleanup, eject), scoped and therefore without age floor or run-active check; the unscoped startup sweep inrecoverOnStartupkeeps theorphanProcessMinAgefloor. All best effort. Windows needs none of this - job objects contain the whole tree - so the platform layer reports an empty table. Regressions:internal/procreap,TestSweepOrphanRunProcessesReapsFinishedRunAndSparesActiveOne,TestSweepRunWorktreeProcessesReapsLeakedChildAtRunCleanup,TestTerminateShellCommandGroup_AsksBeforeKilling,TestTerminateShellCommandGroup_EscalatesWhenSIGTERMIsIgnored. - On Windows the daemon runs console-less (#1653). The managed task launches
no-mistakes.exe daemon run --root <root>directly. Its XML definition setsDisallowStartIfOnBatteriesandStopIfGoingOnBatteriestofalseandExecutionTimeLimittoPT0S, because Task Scheduler's short-job defaults otherwise stop a long-running daemon on battery and after a fixed runtime; keep those settings. The binary embeds an application manifest withconsoleAllocationPolicy=detached, so Windows 11 24H2 / Server 2025 (build 26100) and later allocate no console when there is none to inherit, while a terminal, hook, or agent still shares its console. The manifest is owned byinternal/winres, which renderscmd/no-mistakes/rsrc_windows_{amd64,arm64}.syso(make winres;make lintand a go test fail on drift); never commit an object from another tool. Older builds ignore the manifest, so `daemon.P
Установить process-lifecycle в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл process-lifecycle?
Use when changing subprocess execution, cancellation, process-tree cleanup, orphan reaping, or Windows child hardening.
Как установить скилл process-lifecycle?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл process-lifecycle запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic