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.
npx agentmods add rules/pauljphilp/effectpatterns/accessing-the-current-time-with-clockgit 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/accessing-the-current-time-with-clock)<a href="https://agentmods.dev/rules/pauljphilp/effectpatterns/accessing-the-current-time-with-clock"><img src="https://agentmods.dev/badge/rules/pauljphilp/effectpatterns/accessing-the-current-time-with-clock.svg" alt="Measured on agentmods" 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 | $0.00747 | $0.00747 |
| Opus 5 | $0.00374 | $0.00374 |
| Sonnet 5 | $0.00149 | $0.00149 |
| Haiku 4.5 | $0.00075 | $0.00075 |
Grade A, and why
accessing-the-current-time-with-clock 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 3d 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 — 89 lines — stays where its author put it; the contents beside it link to each section on GitHub.
description: Use the Clock service to get the current time, enabling deterministic testing with TestClock. globs: "**/*.ts" alwaysApply: true
Accessing the Current Time with Clock
Rule: Use the Clock service to get the current time, enabling deterministic testing with TestClock.
Example
This example shows a function that checks if a token is expired. Its logic depends on Clock, making it fully testable.
import { Effect, Clock, Duration } from "effect";
interface Token {
readonly value: string;
readonly expiresAt: number; // UTC milliseconds
}
// This function is pure and testable because it depends on Clock
const isTokenExpired = (
token: Token
): Effect.Effect<boolean, never, Clock.Clock> =>
Clock.currentTimeMillis.pipe(
Effect.map((now) => now > token.expiresAt),
Effect.tap((expired) =>
Clock.currentTimeMillis.pipe(
Effect.flatMap((currentTime) =>
Effect.log(
`Token expired? ${expired} (current time: ${new Date(currentTime).toISOString()})`
)
)
)
)
);
// Create a test clock service that advances time
const makeTestClock = (timeMs: number): Clock.Clock => ({
currentTimeMillis: Effect.succeed(timeMs),
currentTimeNanos: Effect.succeed(BigInt(timeMs * 1_000_000)),
sleep: (duration: Duration.Duration) => Effect.succeed(void 0),
unsafeCurrentTimeMillis: () => timeMs,
unsafeCurrentTimeNanos: () => BigInt(timeMs * 1_000_000),
[Clock.ClockTypeId]: Clock.ClockTypeId,
});
// Create a token that expires in 1 second
const token = { value: "abc", expiresAt: Date.now() + 1000 };
// Check token expiry with different clocks
const program = Effect.gen(function* () {
// Check with current time
yield* Effect.log("Checking with current time...");
yield* isTokenExpired(token);
// Check with past time
yield* Effect.log("\nChecking with past time (1 minute ago)...");
const pastClock = makeTestClock(Date.now() - 60_000);
yield* isTokenExpired(token).pipe(
Effect.provideService(Clock.Clock, pastClock)
);
// Check with future time
yield* Effect.log("\nChecking with future time (1 hour ahead)...");
const futureClock = makeTestClock(Date.now() + 3600_000);
yield* isTokenExpired(token).pipe(
Effect.provideService(Clock.Clock, futureClock)
);
});
// Run the program with default clock
Effect.runPromise(
program.pipe(Effect.provideService(Clock.Clock, makeTestClock(Date.now())))
);
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.
- 3d ago First seen · 89 lines · 747 tokens per session scan A c3080ffb90c8
accessing-the-current-time-with-clock is a cursor rule published in the GitHub repository PaulJPhilp/EffectPatterns (796 stars, last pushed 2mo ago), licensed MIT. It adds 747 tokens to every session, about $0.0037 per session on Opus 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
transcreveai
Required handoff contract for nested TranscreveAI executions.
convex-development---general
Applies general rules for Convex development, emphasizing schema design, validator usage, and correct handling of system fields.
hub-spoke-graph
Hub-and-spoke (MOC) linking for Obsidian vault notes — no peer mesh, leaves up-link only.
langgraph-best-practices
Comprehensive reference for building LangGraph agent workflows including core concepts, graph construction patterns, state management, advanced patterns like Send API and Command, and production-ready code examples.
no-apologies-rule
This rule prevents the AI from using apologies in its responses.
no-summaries-rule
This rule instructs the AI not to summarize changes made.