Break through Cursor / Windsurf quota limits and achieve true autonomous programming loops.
Often, your Agent is forced to stop due to exhausted Fast Request quota, or gets stuck in loops due to context pollution.
10x-Agent-Loop brings you through file watching technology and multi-runtime support:
- π° Infinite Refills: One Fast Request, unlimited interactionsβmake your 500 quota feel like 5000.
- π§ Consultant Mode: When AI gets stuck, automatically generate structured consultation emails and leverage external clean environments (Gemini/Claude) to break through.
- π‘οΈ Context Cleaning: Force structured thinking to prevent Agents from falling into local optima.
β οΈ Prerequisites:
- One of the following runtimes (prefer system-built-in versions, no installation required):
β οΈ Important: Using Composer Agent Mode in Cursor or Windsurf (not normal chat mode). This solution only works in Agent mode because it requires AI to execute terminal commands.
Core Principle: 1. Script suspends the process; 2. Rules tell AI to run the script.
ββββββββ ββββββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ
β User ββββ>βCursor Composerββββ>βRules Fileββββ>βAI Executesββββ>βRun Scriptβ
ββββββββ β (Agent Mode) β βcursor-rulesβ ββββββ¬ββββ βask-followupβ
ββββββββββββββββ ββββββββββββ β βββββββ¬βββββ
β β
β βΌ
β ββββββββββββββββ
β β File Watch β
β βNEXT_STEP.md β
β ββββββββ¬ββββββββ
β β
β βΌ
β ββββββββββββββββ
β βUser Input β
β ββββββββ¬ββββββββ
β β
ββββββββββββββββββ
β
βΌ
ββββββββββββββββ
βAI Continues β
ββββββββ¬ββββββββ
β
βββ> (Loop continues...)
Copy the corresponding files directly to your project. All versions have the same functionality, choose one that fits your environment.
| Your Environment | Copy Script (to project root) | Copy Rules (to .cursor/rules/ or root) |
|---|---|---|
| Windows (Recommended, built-in) | files/pwsh/ask-followup.ps1 |
files/pwsh/cursor-rules.mdc |
| Mac / Linux (Built-in) | files/shell/ask-followup.sh |
files/shell/cursor-rules.mdc |
| Node.js | files/node/ask-followup.js |
files/node/cursor-rules.mdc |
| Python | files/python/ask-followup.py |
files/python/cursor-rules.mdc |
| Bun | files/bun/ask-followup.ts |
files/bun/cursor-rules.mdc |
β οΈ Important: Copy the file itself directly. Manually creating and pasting may cause encoding format (UTF-8/BOM) or line ending (CRLF/LF) issues, preventing script execution.Rules File Location:
- Recommended for newer Cursor: Copy to
.cursor/rules/directory (ensure "Rules for AI" is enabled in Cursor settings)- Or root directory: Copy to project root and name it
.cursorrulesLinux/Mac Users: Remember to add execute permission:
chmod +x ask-followup.sh
ββββββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββ
βOpen Composer βββ>βEnter Req βββ>βAI Executesβββ>βRun Scriptβββ>βShow Spinnerβ
β (Ctrl+I) β ββββββββββββ ββββββββββββ βask-followupβ βSpinning..β
ββββββββββββββββ βββββββ¬βββββββ βββββββ¬βββββ
β β
β βΌ
β ββββββββββββββββ
β βGenerate β
β βNEXT_STEP.md β
β ββββββββ¬ββββββββ
β β
β βΌ
β ββββββββββββββββ
β βUser Edits Fileβ
β βEnter Command β
β ββββββββ¬ββββββββ
β β
β βΌ
β ββββββββββββββββ
β β Save File β
β ββββββββ¬ββββββββ
β β
β βΌ
β ββββββββββββββββ
β βAI Detects β
β ββββββββ¬ββββββββ
β β
β βΌ
β ββββββββββββββββ
β β Continue? β
β ββββββββ¬ββββββββ
β β
β ββββββββ΄βββββββ
β β β
β βΌ βΌ
β ββββββββββ ββββββββββββ
β β Yes β β No β
β βββββ¬βββββ βββββββ¬βββββ
β β β
β β βΌ
β β ββββββββββββ
β β βEnd Loop β
β β ββββββββββββ
β β
β βββ> (Return to AI Executes)
Steps:
- Open Cursor Composer (
Ctrl+I/Cmd+I), ensure you're in Agent mode. - Enter your requirements, ensure AI references the rules file (you can manually type
@cursor-rules.mdcto confirm). - After AI completes work, it will automatically run the script and display Spinning (progress bar).
- Open the generated
NEXT_STEP.mdin the root directory, enter your instruction and save. - AI automatically wakes up and continues working.
- Normal End: Type
stoporendinNEXT_STEP.md, AI will exit the loop normally. - Force Terminate: Press
Ctrl+Cin the terminal to kill the script process.
This is a counter-intuitive design. Why not just chat directly in the IDE?
Core Philosophy: Context Cleaning
Rather than "asking for help," it's more about "noise reduction".
-
Break Free from Agent Framework Constraints: In IDE programming tools like Cursor, LLMs are actually fed a large number of system prompts (System Prompts), tool definitions (Tool Definitions), and role definitions (Role Definitions). This noise (some of which may bring unnecessary constraints) causes AI to lose its original rich and powerful capabilities.
-
Escape Context Pollution: In long conversations, Cursor's Session accumulates a large amount of trial-and-error history, code snippets, and error logs. This noise forms thinking inertia, causing AI to fall into local optima.
-
Force Structured Summarization: The email format requires AI to structure goals, current state, error logs, and configuration files. This process itself is a form of "Rubber Duck Debugging."
-
Fresh Perspective: Feed this email containing complete information to a completely clean external environment. External models don't have Cursor's historical baggage, nor do they have complex Agent tool interference. They only see the "facts (Context Dump)" you provide.
Best Practice: Copy the generated email content directly to Gemini 3 Pro, Claude 4.5, DeepSeek V3.2, Qwen Max. Get advice based on pure logic, then paste it back into NEXT_STEP.md for Cursor to execute the fix.
Problem: Cursor's integrated terminal often intercepts or disables standard input (stdin), preventing interactive scripts from receiving user commands.
Solution: Abandon unstable stdin and switch to File Watching. The script generates a NEXT_STEP.md file, and users only need to modify and save this file for the script to capture commands.
Technical Innovation: Compared to the old Python input() approach, this solution uses file watching, perfectly bypassing Cursor's terminal keyboard input (stdin) blocking restrictions, making it extremely stable.
Problem: IDEs will forcefully kill processes with no output for extended periods, causing loop interruption.
Solution: The script has a built-in Anti-Timeout Spinner (heartbeat keep-alive), continuously printing a dynamic progress bar in the terminal to trick the IDE into thinking the process is active, thus achieving "infinite suspension."
Pain Point: Cursor's 500 Fast Request quota per month runs out quickly.
Principle Comparison:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Traditional Mode β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β User Input ββ> AI Reply ββ> End Chat ββ> β Consume 1 Requestβ
β β
β (Each conversation consumes 1 Request) β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 10x Mode β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β User Input ββ> AI Executes ββ> Run Script Suspend β
β β
β β² β β
β β βΌ β
β β User Modifies File β
β β β β
β β βΌ β
β βββββββββββ AI Continues ββββββββββββββ β
β β
β β
Consume 1 Request (no matter how many loops) β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Core Advantage:
- Traditional Mode: Each conversation = Consume 1 Fast Request
- 10x Mode: No matter how many times this loops (as long as the Session isn't closed), typically consumes only 1 Fast Request (mainly consuming Tokens, not Request count)
Technical Implementation: Use file watching instead of unstable terminal input, and leverage dynamic progress bars to prevent IDEs from killing processes due to timeout.
Pain Point: AI repeatedly tries the same bug, falls into local optima, wasting context window.
Workflow:
ββββββββββββββββ ββββββββββββ ββββββββββββ ββββββββββββββββ ββββββββββββββββ
βAI Hits Error βββ>βIn Loop? βββ>β Yes βββ>βTrigger βββ>βGenerate Emailβ
ββββββββββββββββ βββββββ¬βββββ ββββββββββββ βConsultant β β(Goal/Error/ β
β ββββββββββββββββ β Code/Context)β
β ββββββββ¬ββββββββ
β β
β βΌ
β ββββββββββββββββ
β βUser Copies β
β βEmail Content β
β ββββββββ¬ββββββββ
β β
β βΌ
β ββββββββββββββββ
β βSend to Ext β
β βGemini/Claude β
β ββββββββ¬ββββββββ
β β
β βΌ
β ββββββββββββββββ
β βExternal Modelβ
β βAnalyzes β
β β(Clean Advice)β
β ββββββββ¬ββββββββ
β β
β βΌ
β ββββββββββββββββ
β βPaste to β
β βNEXT_STEP.md β
β ββββββββ¬ββββββββ
β β
β βΌ
β ββββββββββββββββ
β βCursor Reads β
β ββββββββ¬ββββββββ
β β
β βΌ
β ββββββββββββββββ
β βBreak Pattern β
β ββββββββ¬ββββββββ
β β
β βΌ
β ββββββββββββββββ
β βFix in One Go β
β ββββββββ¬ββββββββ
β β
β βΌ
β ββββββββββββββββ
β ββ
Problem β
β β Solved β
β ββββββββββββββββ
β
βββ> [No] ββ> ββββββββββββββββ
βContinue Normalβ
ββββββββββββββββ
Detailed Steps:
-
Trigger: When AI encounters persistent errors or cannot make decisions.
-
Draft: AI automatically generates a structured consultation email in the dialog (containing logs, code, context) according to rules.
-
Seek Help: You copy this "email" and send it to external clean environments: Gemini 3 Pro, Claude 4.5, DeepSeek V3.2, Qwen Max. These external models don't have Cursor's historical baggage or complex Agent tool interferenceβthey only see the clean facts you provide.
-
Fill Back: Paste the external model's suggestions back into
NEXT_STEP.md. -
Resolve: Cursor reads external suggestions, breaks thinking patterns, and fixes the problem in one go.
Q: Why these runtimes?
A: This project supports multiple runtimes. All versions have the same functionality. We recommend using system-built-in versions (PowerShell/CMD/Shell) first, as they require no installation. If you already have Bun, Node.js, or Python installed, you can use those versions as well.
Q: Will long suspension disconnect?
A: Yes. If suspended for too long (usually 2-5 minutes, depending on IDE settings), the cloud connection may disconnect. It's recommended to complete the NEXT_STEP.md response within 2-5 minutes.
Q: Does this solution consume Tokens?
A: Yes. While it saves Request count, long conversations accumulate a large number of Tokens. Please monitor your Token usage and start a new Session when appropriate.
Q: What if the rules file doesn't work?
A: If the rules don't take effect, you can:
- Manually add the rules file content to the conversation context
- Directly reference the rules file in the conversation (e.g.,
@cursor-rules.mdc) - Confirm "Rules for AI" is enabled in Cursor settings
- Check if the rules file is in the correct location (
.cursor/rules/or root directory as.cursorrules)
Problem: Script fails with permission error on Linux/macOS.
Solution:
chmod +x ask-followup.sh # or ask-followup.pyProblem: AI completes task but doesn't run the script, just replies directly.
Solution:
- Check if rules file is read correctly: Type
@cursor-rules.mdcin the conversation to confirm - Manually prompt AI:
Please run the ask-followup.* script - Confirm you're using Composer Agent Mode, not normal chat mode
Problem: Chinese characters display as garbled text in Windows.
Solution:
- PowerShell: Ensure script file encoding is UTF-8 (no BOM)
- CMD: May need to set code page:
chcp 65001
Problem: Cursor doesn't read the rules file.
Solution:
- Confirm file location:
.cursor/rules/cursor-rules.mdcor root directory.cursorrules - Check file format: Ensure it's
.mdcor.cursorrulesextension - Restart Cursor to apply rules
- Confirm "Rules for AI" is enabled in Cursor settings
If you find this tool helpful, you can support me by:
- Buying me a coffee at Ko-fi
If you need other runtime versions or have more suggestions, please feel free to open an Issue or submit a Pull Request!
MIT