Paperclip is a Node.js server and React application for coordinating AI agents as a business team, with goals, organizational roles, budgets, governance, and work tracking in one interface. It is used by people managing multiple agents or autonomous agent organizations across tools such as OpenClaw, Claude Code, Codex, and Cursor. The catalogue includes skills, agents, an MCP add-on, and an instruction for working with Paperclip.
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/paperclipai/paperclipWrote 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/paperclipai/paperclip/sleep-aware-background-work)<a href="https://agentmods.dev/rules/paperclipai/paperclip/sleep-aware-background-work"><img src="https://agentmods.dev/badge/rules/paperclipai/paperclip/sleep-aware-background-work/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/paperclipai/paperclip/sleep-aware-background-work"><img src="https://agentmods.dev/badge/rules/paperclipai/paperclip/sleep-aware-background-work.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.00000 | $0.01463 |
| Opus 5.5 | $0.00000 | $0.00585 |
| Sonnet 5.5 | $0.00000 | $0.00293 |
| Haiku 4.5 | $0.00000 | $0.00146 |
Grade A, and why
sleep-aware-background-work 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.
How it starts
The opening of the file, as written. The whole thing — 120 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Background work must become idle
Apply to new or materially changed background work, its producers, and its
startup/lifecycle wiring. This includes server/src/index.ts, service workers,
DB connection management, adapters, and plugin or runner background activity.
This is a prospective review requirement, not a demand to migrate every existing loop. Do not block unrelated edits on untouched polling. Adding a duty to an existing heartbeat or sweep, extending its lifetime, or copying its polling pattern is new behavior and must meet this rule. An unchanged adjacent loop is not precedent or permission.
Choose the trigger before the mechanism
An idle subsystem must not repeatedly query the database or contact another service merely to discover that it is still idle. Ask: if nothing changes, is there a real obligation to act at a future time?
| Obligation | Required approach |
|---|---|
| Local state changes or an operation completes | Direct call, event, promise, or completion callback |
| A database write creates work | Transaction-aware notification from the supported producer |
| A routine, expiry, or retry is due later | Register its actual next deadline with the shared scheduler |
| Delivery, cleanup, a claim, or a write remains unresolved | Recovery tied to that concrete obligation and its resolution |
| Work must survive restart | Reconstruct from the existing durable source of truth at startup/resume |
Split mixed duties. Deliver on an event; schedule a retry only after failure or
while an obligation remains. Do not add setInterval, recursive timeouts, sleep
loops, or heartbeat callbacks that scan empty work indefinitely. Putting the
same scan behind the scheduler is still polling. A larger interval or .unref()
does not establish idle behavior. Configuration or retained completed history
alone must not keep an otherwise idle worker scanning.
Reuse the shared lifecycle
- Server workers use delivery-work-coordinator.ts
and its work-scheduler.ts for
coalescing, non-overlapping execution, retries, and named deadlines. Do not
create a per-feature scheduler or independent maintenance timer in
index.ts. Adapter, plugin, and runner work uses the owning host's lifecycle interface; extend that boundary when needed instead of importing server internals. - Register, replace, and cancel the actual next deadline. No pending work,
unresolved write, or future obligation means no scheduled scan. An unconditional
nextRunAt = now + intervalis not a deadline unless a real obligation requires it. - Existing rows remain durable truth; notifications are hints to inspect them. Do not add a table per timer or thread recovery bookkeeping through callers. Keep work predicates and provider behavior in their owning services, consistent with module-boundaries.mdc.
- Use notifyDeliveryWork and work-signals.ts for database-produced work. Await intent registration before the relevant write in its transaction. A nested savepoint release is not an outer commit. Preserve uncertainty until the transaction protocol establishes settlement; one empty query or elapsed timeout cannot prove an uncertain write will not commit later.
- Account for every supported producer. Process-local notifications do not cover other replicas, independent SQL writers, or external events without ingress. Do not remove their only recovery path without replacing that contract.
- Use the shared database client for idle connection release and reconnect. Do not add permanent DB keepalives/listeners or scattered connect/disconnect wrappers as a substitute for a wake contract.
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.
- 4d ago First seen · 120 lines · 0 tokens per session scan A 7d9500845bcc
sleep-aware-background-work is a cursor rule published in the GitHub repository paperclipai/paperclip (107,300 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 1,463 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-10-22.
Other cursor rules, from other repositories
frontend-architecture
// Request interceptor for ecosystem ID const injectEcosystemId = (config: any) => { let ecosystemId = window.getCurrentEcosystemId() || localStorage.getItem('ecosystemId'); if (ecosystemId && config.headers) { config.headers['X-Ecosystem-ID'] = ecosystemId; } return config; }.
backend-architecture
Cursor rule "backend-architecture" from EricLortie/laborforge-release, covering backend architecture and api structure, core backend components, api endpoints structure, core modules and ai provider integrations.
titanclip-packages
Shared packages — db, shared, adapters, plugin SDK.
titanclip-server
TitanClip server — Express ESM, routes, heartbeat, adapters.
ponytail
Ponytail, lazy senior dev mode. Always pick the simplest solution that works.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.