Skip to content

[Feature]: Chapters — save selected terminal output as durable bookmarks that survive scrollback trims #19048

Description

@samithaj

Problem or use case

Long Claude Code / Codex sessions in the regular terminal produce thousands of lines. The outputs I actually need again — a final answer, a decision, a command that worked — get buried, and then disappear entirely once scrollback trims: the renderer ring buffer at 5k rows by default, the daemon's 5k-row cap (#12864), checkpoint byte caps and log-cap rotation (#17114), recovery snapshots (#14593).

Today there is no way to keep a handful of important outputs reachable. Terminal Search only covers what is still in the buffer, and scrolling back through hours of tool output is slow.

Proposed solution

Chapters: user-chosen, durable bookmarks on terminal output.

  • Select text in a terminal pane → right-click → Save selection as chapter (plus a configurable shortcut). Title defaults to the first line and is editable.
  • A new Chapters tab in the right sidebar (alongside Explorer / Agents / Source Control / Checks) lists the active worktree's chapters, grouped by terminal, newest first.
  • Click a chapter: if the text is still in that pane's scrollback, scroll it to the top of the viewport and briefly highlight it; otherwise open the saved copy in a read-only view inside the panel — a chapter never goes dead.
  • Durability: each chapter stores the captured text plus a content hash, pane identity, timestamp, and the agent session id when known. Persisted per worktree, so it survives terminal close and app restart.
  • Recovery: when the pane ran a known agent (Claude Code, Codex, …) and the output is gone, Orca looks the snippet up in that session's transcript — the same files Agent Session History already discovers, including on SSH hosts — and shows the full untruncated message.
  • Search: the Chapters tab has a search box that full-text searches saved chapters immediately, and — once transcript search ([Feature]: Full-text search over agent conversations (Cmd+J indexes metadata only; AI Vault search stops at the 5-message preview) #17422 / feat(ai-vault): local full-text search over agent session history #18112) lands — the worktree's agent transcripts too, so past agent output remains findable even after the terminal trimmed it, with a one-click "Save as chapter" on any hit.
  • Agent-neutral capture (from the xterm buffer); transcript recovery and search are per-provider enhancements. Works in folder workspaces and SSH worktrees.

Alternatives or additional context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions