Skip to content

Conversation

@dongsjoa-byte
Copy link

Summary

Improve the cursor-agent skill for AI agent automation scenarios.

Changes

  • Recommend -p (print) mode for cleaner non-interactive output
  • Smart completion detection by checking shell prompt instead of fixed sleep
  • Add cursor-run.sh helper script for convenient automation
  • Keep interactive mode as alternative for complex tasks
  • Add detailed explanation of why -p mode is better for automation

Why -p mode is better

  1. Clean output - No TUI, just text/JSON
  2. Auto-exit - Exits when task completes
  3. Predictable - Works with --output-format text/json

Smart wait mechanism

Instead of:

sleep 60  # Fixed wait, may be too short or too long

Use:

# Check for shell prompt to detect completion
while true; do
  last_line=$(tmux capture-pane -t cursor -p | grep -v '^$' | tail -1)
  if echo "$last_line" | grep -qE '(\$|%)\s*$'; then
    break
  fi
  sleep 3
done

Testing

Tested on macOS with OpenClaw agent:

  • agent -p 'simple query' - works, exits cleanly
  • ✅ Smart wait detects completion correctly
  • ✅ Timeout protection works

/cc @swiftlysingh (original author)

dongsjoa added 2 commits February 3, 2026 03:17
- Monitor Claude subscription usage (Pro/Max 5x/Max 20x/Team)
- Query usage via browser at claude.ai/settings/usage
- Calculate daily budget based on weekly limits
- Provide alert thresholds and best practices
- Support session (5h) and weekly (7d) reset cycles

Author: xiaoyaner
…t wait

- Recommend using -p (print) mode for cleaner non-interactive output
- Add smart completion detection by checking shell prompt instead of fixed sleep
- Include cursor-run.sh helper script for convenient automation
- Keep interactive mode as alternative for complex tasks
- Add detailed explanation of why -p mode is better for automation
@openclaw-barnacle
Copy link

Thanks for the pull request! This repository is read-only and is automatically synced from https://clawhub.ai, so we can’t accept changes here. Please make updates on the website instead.

@openclaw-barnacle openclaw-barnacle bot closed this Feb 2, 2026
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