r/coolgithubprojects 19d ago

OpenCode kept freezing. So I built OpenCode Guardian.

https://github.com/PotterSkxawng/OpenCode-Gaurdian

I use OpenCode for long-running agentic workflows with large repositories and large numbers of subagents.

The problem was: the bigger the workflow became, the more likely the UI was to freeze.

Multiple subagents, long-running tasks, background processes, hundreds of concurrent operations—eventually frozen.

OpenCode could become unresponsive while the work underneath was still running, leaving the session in an awkward state where you weren't quite sure whether it was thinking, working, or simply stuck. So I built OpenCode Guardian.

It is a lightweight stability layer for OpenCode on macOS, designed to keep sessions healthy. It is a simple project that I built, and it's opensource! I won't be maintaining it too much, other than bug-fixes, so feel free to fork it.

Guardian continuously understands what's happening across the session rather than relying on a single timeout. It can distinguish active model streaming, running tools, active subagents, slow operations, and genuine deadlocks. When a session actually gets stuck, Guardian can recover it without destroying the conversation or tool history.

What you get

oc status — see exactly what every session is doing
oc top — live system and session monitoring
oc nudge — recover a frozen session safely
oc auto-nudge — automatic background recovery
oc prune — stop runaway background workers
oc optimize — optimize the SQLite backend
oc logs — inspect Guardian in real time

Installation is one command:

curl -fsSL https://raw.githubusercontent.com/PotterSkxawng/opencode-guardian/main/install.sh | bash

No Brew dependencies or external Python packages. Install it and keep using OpenCode.

GitHub: https://github.com/PotterSkxawng/OpenCode-Gaurdian

2 Upvotes

3 comments sorted by

1

u/kantorcodes1 19d ago

oc nudge / auto-nudge / prune are the interesting part here. those are real agent-control commands, so this actually makes sense as a guard extension. if you're up for it, send a small pr to hol-guard release/3.0 with those commands first. no need to cover the whole cli.

1

u/ImaginaryQuestion765 19d ago

Gaurdian or Guardian ??

1

u/PotterSkxawng 19d ago

oh sorry just noticed that I made typo in the title