Back to blog
Workflow
Opencode

How I run opencode in CI without flooding my session inbox

Thắng Đoàn
Thắng Đoàn

Automated opencode runs pile up in your inbox and session lists, burying the interactive sessions you actually care about. The --archived flag creates scripted runs already archived so they stay out of the way.

What it is

opencode run is the scripted, non-interactive entry point for opencode. New flags let runs start archived (--archived) or in a fresh git worktree (-w or --worktree=<name>).

Applied case

A developer wires opencode into a CI pipeline to generate code reviews on every pull request. Without the flag, each run would appear in the inbox, home, and TUI session list. By adding --archived, the session is created already archived: hidden from the inbox, home, and session lists, and skipped by --continue. For runs that need isolation, -w starts the session in a new git worktree, with --worktree=<name> to choose the name, though it cannot combine with --continue or --session.

  • Add --archived so CI runs never appear in your inbox or session list

When to use it

Use when scripted, scheduled, or CI-driven opencode runs clutter your interactive workflow.
Skip when you want the run visible for follow-up by hand. Note: --archived hides sessions but does not delete them or manage retention.

Read more

opencode release notes

PR: archived runs

PR: worktree runs

Share:

Recommended for you

Enjoyed this article?

Subscribe for new articles. No spam. Unsubscribe anytime.

By subscribing you agree to receive the newsletter. No spam, and you can unsubscribe anytime.