GitHub Issue: Handle Claude Code paste preview and permission prompts
Repository: https://github.com/longbkit/clisbot
Issue Title
[Feature] Auto-confirm Claude Code paste preview and permission prompts
Issue Body
Problem
When using clisbot with Claude Code CLI, multi-line messages trigger Claude's paste preview feature:
❯ [Pasted text #1 +46 lines]
Claude Code waits for a second Enter to confirm the paste before processing. However, clisbot only sends one Enter after pasting text, causing:
Error: TmuxSubmitUnconfirmedError: tmux submit was not confirmed after Enter.
The pane state did not change, so clisbot did not treat the prompt as truthfully submitted.
Similarly, Claude Code shows permission prompts that require user confirmation:
Do you want to create SKILL.md?
❯ 1. Yes
2. Yes, and allow Claude to edit its own settings
3. No
These prompts block execution until confirmed.
Expected Behavior
clisbot should:
- Detect when Claude Code shows paste preview (
[Pasted text #N +X lines]) and auto-send Enter
- Optionally auto-approve permission prompts when configured
Proposed Solution
Option A: Built-in detection in runner
Add to agents.defaults.runner.claude config:
{
"claude": {
"pastePreview": {
"autoConfirm": true,
"pattern": "\\[Pasted text #\\d+"
},
"permissions": {
"autoApprove": true,
"patterns": ["Do you want to (proceed|create|allow|accept|run)"]
}
}
}
Option B: Post-submit hook
Add a postSubmitCheck hook in runner that:
- After sending Enter, wait briefly and check pane content
- If paste preview pattern detected, send another Enter
- If permission prompt detected and
autoApprove: true, send Enter
Workaround (Current)
Created external monitor script that polls tmux pane and auto-sends Enter:
#!/bin/bash
# ~/.clisbot/bin/paste-monitor.sh
SOCKET="~/.clisbot/state/clisbot.sock"
declare -A LAST_HASH
while true; do
for SESSION in $(tmux -S "$SOCKET" list-sessions -F "#{session_name}" 2>/dev/null); do
CONTENT=$(tmux -S "$SOCKET" capture-pane -t "$SESSION" -p | tail -15)
CONTENT_HASH=$(echo "$CONTENT" | md5sum | cut -d" " -f1)
[ "${LAST_HASH[$SESSION]}" = "$CONTENT_HASH" ] && continue
if echo "$CONTENT" | grep -q "\[Pasted text #"; then
tmux -S "$SOCKET" send-keys -t "$SESSION" Enter
LAST_HASH[$SESSION]="$CONTENT_HASH"
elif echo "$CONTENT" | grep -qE "(Do you want to|Allow|Approve)" && \
echo "$CONTENT" | grep -qE "❯.*Yes|1\. Yes"; then
tmux -S "$SOCKET" send-keys -t "$SESSION" Enter
LAST_HASH[$SESSION]="$CONTENT_HASH"
fi
done
sleep 0.1
done
Run as systemd user service for persistence.
Environment
- clisbot version: 0.1.53
- CLI: Claude Code (claude)
- OS: Ubuntu 22.04 (VPS)
- tmux: 3.2a
Related
- Claude Code uses Ink-based TUI with bracketed paste detection
- This is Claude-specific; Codex/Gemini may not have this behavior
Labels
enhancement, claude-cli, runner
Optional: PR Implementation Notes
If implementing as PR:
- File:
src/runner/claude-runner.ts (or equivalent)
- Changes:
- Add
pastePreview and permissions config schema
- After
send-keys, poll pane for patterns
- If matched, send additional Enter
- Config: Add to
agents.defaults.runner.claude in schema
- Docs: Update
docs/user-guide/claude-cli.md with new options
GitHub Issue: Handle Claude Code paste preview and permission prompts
Repository: https://github.com/longbkit/clisbot
Issue Title
[Feature] Auto-confirm Claude Code paste preview and permission promptsIssue Body
Problem
When using clisbot with Claude Code CLI, multi-line messages trigger Claude's paste preview feature:
Claude Code waits for a second Enter to confirm the paste before processing. However, clisbot only sends one Enter after pasting text, causing:
Similarly, Claude Code shows permission prompts that require user confirmation:
These prompts block execution until confirmed.
Expected Behavior
clisbot should:
[Pasted text #N +X lines]) and auto-send EnterProposed Solution
Option A: Built-in detection in runner
Add to
agents.defaults.runner.claudeconfig:{ "claude": { "pastePreview": { "autoConfirm": true, "pattern": "\\[Pasted text #\\d+" }, "permissions": { "autoApprove": true, "patterns": ["Do you want to (proceed|create|allow|accept|run)"] } } }Option B: Post-submit hook
Add a
postSubmitCheckhook in runner that:autoApprove: true, send EnterWorkaround (Current)
Created external monitor script that polls tmux pane and auto-sends Enter:
Run as systemd user service for persistence.
Environment
Related
Labels
enhancement,claude-cli,runnerOptional: PR Implementation Notes
If implementing as PR:
src/runner/claude-runner.ts(or equivalent)pastePreviewandpermissionsconfig schemasend-keys, poll pane for patternsagents.defaults.runner.claudein schemadocs/user-guide/claude-cli.mdwith new options