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.
git clone --depth 1 https://github.com/PaulJPhilp/EffectPatternsWrote 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.
[](https://agentmods.dev/rules/pauljphilp/effectpatterns/add-timeouts-to-http-requests)<a href="https://agentmods.dev/rules/pauljphilp/effectpatterns/add-timeouts-to-http-requests"><img src="https://agentmods.dev/badge/rules/pauljphilp/effectpatterns/add-timeouts-to-http-requests/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/pauljphilp/effectpatterns/add-timeouts-to-http-requests"><img src="https://agentmods.dev/badge/rules/pauljphilp/effectpatterns/add-timeouts-to-http-requests.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01112 | $0.01112 |
| Opus 5.5 | $0.00445 | $0.00445 |
| Sonnet 5.5 | $0.00222 | $0.00222 |
| Haiku 4.5 | $0.00111 | $0.00111 |
Grade A, and why
add-timeouts-to-http-requests 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 190 lines — stays where its author put it; the contents beside it link to each section on GitHub.
description: Always set timeouts on HTTP requests to ensure your application doesn't hang. globs: "**/*.ts" alwaysApply: true
Add Timeouts to HTTP Requests
Rule: Always set timeouts on HTTP requests to ensure your application doesn't hang.
Example
import { Effect, Duration, Data } from "effect"
import { HttpClient, HttpClientRequest, HttpClientResponse } from "@effect/platform"
// ============================================
// 1. Basic request timeout
// ============================================
const fetchWithTimeout = (url: string, timeout: Duration.DurationInput) =>
Effect.gen(function* () {
const client = yield* HttpClient.HttpClient
return yield* client.get(url).pipe(
Effect.flatMap((r) => HttpClientResponse.json(r)),
Effect.timeout(timeout)
)
// Returns Option<A> - None if timed out
})
// ============================================
// 2. Timeout with custom error
// ============================================
class RequestTimeoutError extends Data.TaggedError("RequestTimeoutError")<{
readonly url: string
readonly timeout: Duration.Duration
}> {}
const fetchWithTimeoutError = (url: string, timeout: Duration.DurationInput) =>
Effect.gen(function* () {
const client = yield* HttpClient.HttpClient
return yield* client.get(url).pipe(
Effect.flatMap((r) => HttpClientResponse.json(r)),
Effect.timeoutFail({
duration: timeout,
onTimeout: () => new RequestTimeoutError({
url,
timeout: Duration.decode(timeout),
}),
})
)
})
// ============================================
// 3. Different timeouts for different phases
// ============================================
const fetchWithPhasedTimeouts = (url: string) =>
Effect.gen(function* () {
const client = yield* HttpClient.HttpClient
// Connection timeout (initial)
const response = yield* client.get(url).pipe(
Effect.timeout("5 seconds"),
Effect.flatten,
Effect.mapError(() => new Error("Connection timeout"))
)
// Read timeout (body)
const body = yield* HttpClientResponse.text(response).pipe(
Effect.timeout("30 seconds"),
Effect.flatten,
Effect.mapError(() => new Error("Read timeout"))
)
return body
})
// ============================================
// 4. Timeout with fallback
// ============================================
interface ApiResponse {
data: unknown
cached: boolean
}
const fetchWithFallback = (url: string): Effect.Effect<ApiResponse> =>
Effect.gen(function* () {
const client = yield* HttpClient.HttpClient
return yield* client.get(url).pipe(
Effect.flatMap((r) => HttpClientResponse.json(r)),
Effect.map((data) => ({ data, cached: false })),
Effect.timeout("5 seconds"),
Effect.flatMap((result) =>
result._tag === "Some"
? Effect.succeed(result.value)
: Effect.succeed({ data: null, cached: true }) // Fallback
)
)
})
// ============================================
// 5. Timeout with interrupt
// ============================================
const fetchWithInterrupt = (url: string) =>
Effect.gen(function* () {
const client = yield* HttpClient.HttpClient
return yield* client.get(url).pipe(
Effect.flatMap((r) => HttpClientResponse.json(r)),
Effect.interruptible,
Effect.timeout("10 seconds")
)
// Fiber is interrupted if timeout, freeing resources
})
// ============================================
// 6. Configurable timeout wrapper
// ============================================
interface TimeoutConfig {
readonly connect: Duration.DurationInput
readonly read: Duration.DurationInput
readonly total: Duration.DurationInput
}
const defaultTimeouts: TimeoutConfig = {
connect: "5 seconds",
read: "30 seconds",
total: "60 seconds",
}
const createHttpClient = (config: TimeoutConfig = defaultTimeouts) =>
Effect.gen(function* () {
const baseClient = yield* HttpClient.HttpClient
return {
get: (url: string) =>
baseClient.get(url).pipe(
Effect.timeout(config.connect),
Effect.flatten,
Effect.flatMap((r) =>
HttpClientResponse.json(r).pipe(
Effect.timeout(config.read),
Effect.flatten
)
),
Effect.timeout(config.total),
Effect.flatten
),
}
})
// ============================================
// 7. Usage
// ============================================
const program = Effect.gen(function* () {
yield* Effect.log("Fetching with timeout...")
const result = yield* fetchWithTimeoutError(
"https://api.example.com/slow",
"5 seconds"
).pipe(
Effect.catchTag("RequestTimeoutError", (error) =>
Effect.gen(function* () {
yield* Effect.log(`Request to ${error.url} timed out`)
return { error: "timeout" }
})
)
)
yield* Effect.log(`Result: ${JSON.stringify(result)}`)
})
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.
- 1mo ago First seen · 190 lines · 1,112 tokens per session scan A 94118e5dedf4
add-timeouts-to-http-requests is a cursor rule published in the GitHub repository PaulJPhilp/EffectPatterns (807 stars, last pushed 4mo ago), licensed MIT. It adds 1,112 tokens to every session, about $0.0044 per session on Opus 5.5. 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-30.
Other cursor rules, from other repositories
workflow
This file provides rules and context for generating or understanding Go code related to a custom Domain Specific Language (DSL) for defining Temporal workflows within this project.
activities
This file provides rules and context for generating or understanding Go code related to Temporal activities within this project with the specific purpose of using a simple DSL to specify workflows.
go-api-development-general-rules
General rules for Go API development using the net/http package, focusing on code quality, security, and best practices.
backend-general-expert
General rule for backend development expertise across the project.
service-class-conventions
Defines the structure and implementation of service classes, enforcing the use of interfaces, ServiceImpl classes, DTOs for data transfer, and transactional management.
repository-class-conventions
Governs the structure and functionality of repository classes, emphasizing the use of JpaRepository, JPQL queries, and EntityGraphs to prevent N+1 problems.