Skip to content

Document agent tabs design decisions in CLAUDE.md - #267

Closed
patrickdappollonio wants to merge 2 commits into
server-modefrom
agent-tabs-claudemd
Closed

patrickdappollonio wants to merge 2 commits into
server-modefrom
agent-tabs-claudemd

Conversation

@patrickdappollonio

Copy link
Copy Markdown
Owner

Adds an Agent Tabs subsection to the CLAUDE.md design tenets (under "Agents and Providers"), capturing the locked design decisions for the upcoming agent-tabs feature so future work does not drift.

Documented decisions:

  • A tab is a provider session inside the agent's one shared worktree (not a new worktree, not a new sidebar row); the unified strip also holds companion terminals.
  • Exactly one tab resumes, positionally (leftmost); all others always start fresh, because continue is directory-scoped. Single resume_eligible_tab source of truth; should_resume_session delegates to it.
  • Primary tab = the agent, pinned leftmost; close primary = detach, close secondary = remove (destructive, confirmed when live); delete agent tears down every tab's PTY.
  • New tabs default to the project provider and start fresh; provider is per-tab, changed via ctrl+p (TUI) / ⋯ (web), effective next launch.
  • Tab state is derived runtime state: additive agent_tabs SQLite table (backward compatible), never portable config; the primary has no row.
  • Runtime state (providers, pins, resume-fallback, activity maps) keyed by tab id, with the primary tab id == session id.
  • Tabs honor the existing per-surface UI tenets (theme engine, Center-scope actions, ⋯-menu/destructive-confirm/touch-target/working-bob).

Base is server-mode (this is unreleased server-mode work). Docs-only; no code changes. The full design spec, implementation plan, and an interactive HTML mockup live under docs/superpowers/ (gitignored) alongside this.

🤖 Generated with Claude Code

patrickdappollonio and others added 2 commits July 1, 2026 16:24
…ry-bar newline key

The web terminal now inserts a soft newline (LF / Ctrl-J) on Shift-Enter
instead of submitting. xterm collapses Enter and Shift-Enter to CR before
the data layer, so the two are intercepted at the key-event layer via
attachCustomKeyEventHandler. The decision lives in pure, unit-tested
termkeys.ts helpers (softNewline, softNewlineAction) and the component is a
thin applicator: it cancels the key, owner-gates the write, replicates the
scroll/clear side effects the early return skips, and consumes any armed
Ctrl/Alt latch. The chord is left alone mid-IME-composition so a CJK confirm
keystroke is never rewritten.

Because a soft keyboard can't produce Shift-Enter, the mobile accessory bar
gains a dedicated newline key. The bar is reorganized: modifier/special keys
(incl. newline) on top, navigation (cursor arrows plus PgUp/PgDn) below, with
a divider separating the focus-keeping arrows from the keyboard-dismissing
page keys. Both newline entry points share one writeSoftNewline helper so
their landing behavior can't drift.

The TUI deliberately does not disambiguate Shift-Enter (it would require the
Kitty keyboard protocol and would break verbatim PTY passthrough); Ctrl-J is
the supported soft-newline key there. Documented in CLAUDE.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Capture the load-bearing decisions for the upcoming agent-tabs feature as
design tenets: tabs are provider sessions in one shared worktree, exactly
one leftmost tab resumes, primary-vs-secondary close semantics, per-tab
provider defaulting to the project provider, additive agent_tabs SQLite
storage kept out of portable config, tab-id keyed runtime state, and how
tabs honor the existing TUI and web UI tenets.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@patrickdappollonio
patrickdappollonio deleted the agent-tabs-claudemd branch July 2, 2026 03:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant