Skip to content

feat: session loop command with TUI display - #3

Open
mgajda wants to merge 3 commits into
devfrom
feat/loop-command-updated
Open

mgajda wants to merge 3 commits into
devfrom
feat/loop-command-updated

Conversation

@mgajda

@mgajda mgajda commented Sep 10, 2026

Copy link
Copy Markdown
Owner

Summary

This PR adds a built-in /loop command and TUI display for the loop goal.

Backend (loop command)

  • /loop <prompt> starts a self-paced loop
  • /loop 5m <prompt> starts a scheduled loop
  • /loop stop stops the active loop
  • Uses .claude/loop.md when no prompt is provided

TUI Display

  • Detects loop messages and extracts the goal
  • Displays goal prominently in warning color with bold styling
  • Shows +/- toggle for expand/collapse
  • Instructions hidden by default, expandable on click

Files Changed

  • packages/opencode/src/command/index.ts
  • packages/opencode/src/command/template/loop.txt
  • packages/opencode/src/session/prompt.ts
  • packages/opencode/test/session/prompt.test.ts
  • packages/tui/src/util/loop-prompt.ts
  • packages/tui/src/routes/session/index.tsx
  • packages/tui/test/util/loop-prompt.test.ts

Closes anomalyco#23578

Vipul Javeri and others added 3 commits July 17, 2026 16:47
Add parseLoopPrompt utility to detect loop messages and extract the goal.
Modify UserMessage to render loop messages with a collapsible disclosure:
- Goal displayed prominently in warning color with bold styling
- Instructions hidden by default, expandable on click
- Follows same pattern as thinking/reasoning blocks
@github-actions

Copy link
Copy Markdown

This PR doesn't fully meet our contributing guidelines and PR template.

What needs to be fixed:

  • PR description is missing required template sections. Please use the PR template.

Please edit this PR description to address the above within 2 hours, or it will be automatically closed.

If you believe this was flagged incorrectly, please let a maintainer know.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Add /loop command for automated iterative task execution

1 participant