long_running_tasks

long_running_tasks is a cursor rule for Cursor from learnwithcc/tally-mcp. It costs 0 tokens per session (781 once invoked), scanned A, original, ISC.

Rules for handling long-running work in Cursor, a coding editor with an AI assistant.

In plain words
What is it for?
Use them to split lengthy commands into short stages, stop old processes, and run unavoidable long tasks outside the limited tool call.
Why use it?
They reduce timeout errors and port conflicts during builds, tests, and other lengthy operations.

Cursor rule for Cursor

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/learnwithcc/tally-mcp/long_running_tasks
Clone the repo
git clone --depth 1 https://github.com/learnwithcc/tally-mcp

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for long_running_tasks

README.md
[![agentmods](https://agentmods.dev/badge/rules/learnwithcc/tally-mcp/long_running_tasks.svg)](https://agentmods.dev/rules/learnwithcc/tally-mcp/long_running_tasks)
Your own site
<a href="https://agentmods.dev/rules/learnwithcc/tally-mcp/long_running_tasks"><img src="https://agentmods.dev/badge/rules/learnwithcc/tally-mcp/long_running_tasks.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Nothing until a file matches its globs; then the whole rule loads.
When invoked 781 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00781
Opus 5 $0.00000 $0.00391
Sonnet 5 $0.00000 $0.00156
Haiku 4.5 $0.00000 $0.00078

Measured 4d ago against content hash a9e4aec008a4, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

long_running_tasks scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.cursor/rules/long_running_tasks.mdc · 56 lines

How it starts

The opening of the file, as written. The whole thing — 56 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Handling Long-Running Processes in Cursor

To avoid connection failed or timeout errors during long-running operations like performance tests, builds, or complex tool calls, follow these guidelines.

1. Acknowledge Cursor's Timeout Limits

  • Fixed Timeouts: Cursor imposes a non-configurable timeout on tool calls and other background processes initiated from chat. This can be as short as 5 seconds.
  • No User Control: There is currently no setting to extend this timeout.

2. Best Practices for Long-Running Tasks

  • Break Down Tasks: Sub-divide long processes into smaller chunks.

    • Target Duration: Aim for each chunk to complete in under 5 seconds to be safe.
    • Example (Artillery): Instead of one long test, run multiple short tests targeting specific phases or scenarios.
  • Kill Previous Processes: Before starting a new instance of a server or long-running task, always ensure the previous one is terminated to avoid port conflicts (EADDRINUSE).

    • Command: Use kill $(lsof -t -i:<port>) 2>/dev/null || true to gracefully kill any process on a given port.
  • Execute Externally (If Necessary): For tasks that cannot be broken down (e.g., a full production build), the best practice is to run them in a separate, dedicated terminal outside of the agent's control and then report the results back.

  • Provide Feedback: Continue to report when timeouts occur, as this helps refine our internal best practices and provides data for potential future feature requests to the Cursor team.

3. Primary Strategy: Decompose and Conquer

  • Break Down Tasks: The most effective strategy is to break down long-running commands into smaller, incremental steps that can each complete within the timeout window.
  • Example (Artillery): Instead of running a full 10-minute test suite, run a single, short scenario first to verify configuration. Then, run shorter phases of the test separately.
    # Instead of this:
    npx artillery run long-test-suite.yml
    
    # Do this:
    # Step 1: Verify a single scenario
    npx artillery run --scenario "Quick Smoke Test" test-suite.yml
    
    # Step 2: Run a shorter phase
    npx artillery run --phase "Warm-up" test-suite.yml
    
  • Example (Builds/Tests): Instead of running npm test, run tests for a specific file or component: jest src/components/MyComponent.test.ts.

Read the full file on GitHub · 56 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 56 lines · 0 tokens per session scan A a9e4aec008a4

Subscribe to this mod's changes

long_running_tasks is a cursor rule published in the GitHub repository learnwithcc/tally-mcp (8 stars, last pushed 1y ago), licensed ISC. It costs nothing until one of its globs matches a file; then it loads 781 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.