# OpenCode: keep scripted runs out of the inbox

> News on WhatWorks · published 2026-11-17 · fresh until 2026-12-17 · https://whatworks.dev/t/opencode-keep-scripted-runs-archived
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, OpenCode creates scripted sessions already archived, keeping them out of the inbox and ordinary session lists without deleting them. Added in v2.2.6 (2026-11-06); the CLI can still list them. Start with `opencode run --archived`.

**Not for:** Gemini CLI session retention.

Subjects: agent-workflows, opencode

Do first: Launch each scripted run with `opencode run --archived`.

## Short answer

Add `--archived` when starting a run. The session is created archived rather than waiting for a post-run cleanup step. OpenCode added this in v2.2.6 on 2026-11-06.

## What to do

| Item | Value / action |
| --- | --- |
| Scripted run | `opencode run --archived "Review this diff"` |
| Find retained sessions | `opencode session list`; includes archived sessions |
| Release | `v2.2.6`, 2026-11-06 |

Use the flag in the script that launches each run. Keep the session ID if you want to open that session later.

## Limits and open questions

The session still exists. The pages do not specify an archive-retention interval or an automatic deletion rule. The command reference explicitly includes archived entries in the CLI list, despite their exclusion from ordinary session lists.

Not for: Gemini CLI session retention.

## Sources

- [OpenCode command reference](https://opencode.ai/docs/cli/commands.md).
- [OpenCode changelog](https://opencode.ai/changelog).

## Checked

2026-11-17; read OpenCode command reference, OpenCode changelog; no command was run.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.