# Igorwarzocha Opencode Background Process Background Process

> Background Process Best Practices

- Skill: `tomevault-io/igorwarzocha-opencode-background-process-background-process` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/igorwarzocha-opencode-background-process-background-process`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/igorwarzocha-opencode-background-process-background-process/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/igorwarzocha-opencode-background-process-background-process

---


# Background Process Best Practices

<housekeeping>

## Keep the Process List Clean

- Kill processes when done - don't leave stale servers running
- Use `background_process_cleanup` periodically to remove exited processes
- Before launching, check `background_process_list` to avoid duplicates
- Use `remove: true` when killing to clean up in one step

## Verify Startup

After launching, wait before reading output - servers need time to start:
1. Launch the process
2. Sleep at least 30 seconds (use bash `sleep` or just wait before next action)
3. `background_process_read` to confirm startup
4. If output is empty or incomplete, wait longer and re-read

Look for: "listening on", "ready", "started" - or errors like port conflicts

## Use Meaningful IDs

When running multiple processes, set custom `id` for clarity:
- `id: "frontend"` and `id: "backend"` instead of `vite-1`, `node-2`
- Makes kill/read commands unambiguous

</housekeeping>

<signals>

## When to Use Each Signal

| Signal | Use When |
|--------|----------|
| SIGTERM (default) | Normal shutdown - gives process time to cleanup |
| SIGINT | Simulate Ctrl+C - some processes handle this differently |
| SIGKILL | Process won't die with SIGTERM - force kill |

</signals>

<gotchas>

- Processes persist for the session - they don't auto-cleanup on conversation end
- Output buffer is limited (500 lines default) - increase `maxOutputLines` for verbose builds
- stderr is prefixed with `[stderr]` in output - helps distinguish errors

</gotchas>

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/igorwarzocha) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-12 -->

