Cursor實踐項目-06-10倍次數用量

項目說明

cursor項目實踐-06-10倍次數用量

耗費時間:1小時左右

近期,Cursor調整了使用規則,auto模式名義上不限量不限次數,但是實際上,是改為了20$的token用量,實際使用很容易就超量,就需要額外購買。好在Cursor依然可以選擇使用次數來計算,但Claude4的價格是之前的兩倍,實際也是大大降低了可使用的量。

本項目就是通過github上的一個非常簡單的開源項目,變相的實現使用次數的擴展。

在Cursor再次修改規則前愉快地使用吧

成果展示

  • 一次請求,生成了10個超1000行的教程文件,大大擴展了使用的次數 結果動圖
    • 一次請求即將結束,調起命令input,輸入後繼續進行
    • 又計劃結束本地請求,調起命令input,輸入後繼續進行
    • 第三次想結束,調起命令input,輸入後再次繼續
    • 用滿25次tools調用請求,終於結束

前置準備

  • Cursor

    • 版本:1.2.4
    • cursor rules : Cursor Rules
    • agent: claude-4-sonnet-thinking
  • git項目地址

  • 整體流程

    • 設置cursor規則->設置項目規則->描述需求->cursor編碼->調試輸出

問題記錄

  1. 問題1:命令行中編輯指令,不那麼方便
    • 解決方式:編輯好命令後,copy到命令行中,然後執行。
  2. 問題2:不支持圖片輸入,文件導入等
    • 解決方式:只能使用文本輸入。圖片或者文件輸入stop結束本地對話後,重新用cursor指令框輸入。

使用心得

  1. 區分使用場景,如果需要生成大量內容,可以考慮使用次數模式。調試時,可以考慮使用stop結束本地對話,然後重新用cursor指令框輸入。

項目詳細步驟

  1. 創建項目規則,在項目的根目錄下創建.cursor/rules文件夾,創建文件rules.md,內容如下:
---
description: 
globs: 
alwaysApply: true
---

### ✅ Task: Interactive Task Loop with User Feedback

1. **Check if `userinput.py` exists** in the root directory.

   * If it doesn't exist, create it with the following content:

     ``python
     # userinput.py
     user_input = input("prompt: ")
     ``

2. **Main Workflow**:

   * Perform your assigned tasks.

   * Run:

     ``bash
     python3 userinput.py
     ``
   * The terminal should be opened in the chat window itself.

   * Read the user's input.

   * Based on the input, perform the next set of tasks.

   * Repeat the process.

3. **Exit Condition**:

   * If the user enters `"stop"` when prompted, exit the loop and terminate the process.
step-1
  1. 在根目錄下創建userinput.py文件,內容如下:
  user_input = input("prompt: ")
step-2
  1. 開始輸入需求,準備使用cursor

  2. 在cursor準備結束請求時,會提示你輸入prompt,輸入你的指令,繼續讓cursor執行,直到25個請求tools用滿再結束

step-4
  1. 在Cursor再次修改規則前愉快地使用吧!