Nothing reclaims per-repo .gstack state — browse-audit.jsonl is append-only by design and bin/ has no cleanup verb
- Dominant language
- TypeScript
- Stars
- 133k
- Forks
- 19.9k
- Avg merge
- 18h 46m
- Merged PRs (30d)
- 26
Description
Ran a full disk audit on a box with gstack installed across seven repos and noticed there's no way to reclaim the per-repo `.gstack/` state short of deleting the directory by hand.
`browse/src/audit.ts:6` states the intent plainly:
> restarts and is never truncated by the server
That's a reasonable default for an audit log, but nothing else rotates it either, so it's monotonic for the life of the repo:
```
472K 2026-08-06 /root/ArceHubBot/.gstack/browse-audit.jsonl
28K 2026-07-12 /root/read-only/.gstack/browse-audit.jsonl
8K 2026-07-28 /root/.claude/.gstack/browse-audit.jsonl
```
`browse-network.log` and `browse-console.log` sit beside it with the same shape. And `.gstack/tmp/` collects codex scratch — `codex-err-*.txt`, `codex-review-iter*.{err,out}` — which is pure byproduct:
```
8.3M /root/ArceHubBot/.gstack (8.0M of it in tmp/)
```
I'm not going to pretend this is urgent. Busiest repo here is 8 MB after six weeks. The reason I'm filing is the structural bit: `bin/` has 76 commands and the only two that remove anything are `gstack-uninstall` and `gstack-brain-uninstall`, both all-or-nothing. There's no `gstack-clean`, and `/browse` gives you no way to say "keep the audit trail, drop the console spam."
What would cover it:
A `gstack-clean` verb, dry-run by default, scoped to `.gstack/` in the current repo. Delete `tmp/codex-*` past some age, truncate `browse-{network,console}.log` over a size threshold, and rotate `browse-audit.jsonl` keeping a retention window rather than truncating it — the audit log is the one file in there with a reason to survive.
Liveness gates worth having before it removes anything: no `codex` process, no browse daemon listening, file mtime older than an hour. Cheap to check and it makes the command safe to run from a cron.
Environment: gstack 1.60.1.0, Ubuntu 22.04, Claude Code 2.1.220.
Contributor guide
Research direction
Start by reading browse/src/audit.ts and inspecting the existing commands in bin/ for cleanup, dry-run, and liveness-check conventions. Define the gstack-clean scope and retention behavior for tmp/codex-* and browse logs, then verify that audit history is rotated rather than truncated and that active processes or recent files prevent removal.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100