Borrowing it
Nothing to install: this file belongs to fitchmultz/pi-cursor-sdk. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/fitchmultz/pi-cursor-sdk/main/AGENTS.mdgit clone --depth 1 https://github.com/fitchmultz/pi-cursor-sdkWrote 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/instructions/fitchmultz/pi-cursor-sdk/agents-md)<a href="https://agentmods.dev/instructions/fitchmultz/pi-cursor-sdk/agents-md"><img src="https://agentmods.dev/badge/instructions/fitchmultz/pi-cursor-sdk/agents-md/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/instructions/fitchmultz/pi-cursor-sdk/agents-md"><img src="https://agentmods.dev/badge/instructions/fitchmultz/pi-cursor-sdk/agents-md.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.07890 | $0.07890 |
| Opus 5.5 | $0.03156 | $0.03156 |
| Sonnet 5.5 | $0.01578 | $0.01578 |
| Haiku 4.5 | $0.00789 | $0.00789 |
Grade A, and why
pi-cursor-sdk AGENTS.md 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 yesterday.
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 — 244 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
Purpose
This repository is a pi provider extension that registers Cursor SDK-backed models under the cursor provider. Agent work is successful when changes preserve pi-native model/thinking/session behavior, keep Cursor API keys out of repo state and logs, and pass the local validation commands below.
Repository map
src/index.tsregisters the pi extension, provider, fallback warnings, Cursor runtime controls, native replay wrappers, question tool, and pi tool bridge hooks.src/model-discovery.tsdiscovers Cursor models, builds pi model metadata, stores per-model metadata, and defines fallback models.shared/cursor-model-selection-identities.mjsowns canonical selectable model/context/fast identities and context-window key normalization shared by runtime discovery and the snapshot generator; its.d.mtsfile owns the TypeScript contract.src/cursor-provider.tsis a thinstreamCursor()wrapper that delegates turn execution to the turn runner.src/cursor-provider-turn-runner.tsorchestrates provider turns (pre-send drain, prepare, send, finalize, emit, cleanup).src/cursor-provider-turn-prepare.tsowns turn prepare (auth, MCP timeout install, effective local HTTP transport configuration, session agent, live-run setup, coordinator).src/cursor-provider-turn-send.tsowns SDKagent.send()wiring and abort listener registration.src/cursor-provider-turn-finalize.tsowns unifiedawaitFinalizeCursorRunOutcome()(wait, transcript replay, incomplete tools, artifacts, context cache).src/cursor-provider-turn-emit.tsowns live vs direct emission from finalized outcomes.src/cursor-provider-turn-types.tsowns immutable turn phase data and explicit phase result types; phase-local cleanup stays inside the owning phase.src/cursor-provider-run-outcome.tsowns the discriminatedCursorRunOutcomemodel and terminal emission classification.src/cursor-local-run-terminal-error.tsowns cancelling a failed LOCAL run from its SDK terminal error run-row write (before the SDK changesrun.status, so native tool processes stop) and restoring the SDK error from the resulting cancelled wait result; session stores are wrapped at open.src/cursor-provider-run-finalizer.tsowns live-run wait completion, outcome application, debug finalization, and SDK abort-suppression disposal.src/cursor-run-final-text.tsowns final assistant text selection for run outcomes and live-run drain.src/cursor-provider-errors.tsowns scrubbed Cursor SDK run failure detail, abort reason formatting, and provider error sanitization.src/cursor-provider-lazy.tsowns thestreamSimplewrapper that defers Cursor provider execution to invocation and converts provider runtime failures into stream errors; the provider module stays in Pi's static extension graph so host peers resolve through Pi's loader.src/cursor-session-scope.tsowns SessionManager-bound runtime scope keys/generations separately from stable persistent session identity, cwd/name/trust, process-wide started-session liveness and stale-extension detection, and lifecycle registration for pools, cloud names and debug grouping.src/cursor-provider-binding.tsowns public native Cursor auth/catalog publication, per-ExtensionAPI provider closures, and one-shot process-wide native header receipts capturing scope, usage origin, canonical projection, operation purpose and owning session state (an unstarted registrant delegates the turn to the receipt owner's module, which follows the native provider's catalog issue and model metadata);src/cursor-request-provenance.tsresolves actual-request-equivalent source-ordered occupancy floors and operation-signal summary purpose without text/clocks or sibling scans.src/cursor-session-settings.tsowns branch-scoped runtime/cloud acknowledgement, mode, fast, and HTTP preferences plus owner-scoped CLI snapshots/one-shot consumption across reload; SDK transport configuration and environment/user defaults remain process-global.src/cursor-custom-store-path.tsowns native custom-root validation, trusted-system alias/private directory preparation, fixed SQLite leaf and before/after-open identity guards (pathname/Windows ACL ceilings are explicit).src/cursor-session-store.tsowns captured default/custom-domain leases, exact custom-session and current/legacy default cwd/session-derived SQLite identity admission, contract-verified pre-migration layout safety, exact identity admission before bounded path walks, atomic derived cwd ownership through admission/open/disposal, temporary stores, and owned-prefix/removal guards (default-domain higher user-managed links allowed; persistent opens retain an active matching lease).src/cursor-http1.tsowns branch-scoped local HTTP/1.1 session state, global-preference override tracking, and the process-wide configured SDK handle/null reset.src/cursor-ripgrep-path.tsowns shared SDK-relative platform package resolution and local-agent ripgrep initialization;src/cursor-sdk-runtime.tsinitializes the native parser vendor path before shared SDK imports.src/cursor-session-agent.tsowns runtime-scoped SDK agent pooling, durable transport-aware compatibility identity, send-state commits, busy tracking for in-flight SDKrun.wait()work, and scoped acquire/dispose state;src/cursor-local-agent-ownership.tsowns atomic process-wide exact store/agent claims shared across extension copies and resume cleanup (release only on proven SDK disposal).src/cursor-session-agent-lineage.tsowns non-resumable per-session local agent lineage custom entries independent of local resume.src/cursor-session-agent-lifecycle.tsowns lazy session-agent lifecycle invalidation on model select, compaction, tree navigation, shutdown, and scope changes, including shutdown-time HTTP transport reset when no started live session remains across module copies.src/cursor-session-compaction-prep.tsownsprepareCursorSessionForCompaction()(release scoped live runs and reset the conversation pool) wired fromsession_before_compactinsrc/index.ts; isolated summary agents never commit ordinary resume handles.src/cursor-session-send-policy.tsowns session send planning (bootstrapvsincremental), periodic agent rebootstrap threshold, and prompt mode selection.src/cursor-provider-live-run-drain.tsowns live-run drain/replay mirroring, pre-send continuation, and native replay turn emission.src/cursor-provider-turn-coordinator.tsorchestrates SDK delta/step handling during a turn over focused collaborators.src/cursor-provider-turn-shell-output.tsowns shell-output-delta tracking and merging into completed shell tool calls.src/cursor-provider-turn-tool-ledger.tsowns started/completed tool identities, fingerprints, and duplicate suppression.src/cursor-provider-turn-sdk-normalizer.tsnormalizes SDK delta/step completions via the ledger and shell tracker.src/cursor-provider-turn-display-router.tsowns trace vs native-replay display routing during a turn.src/cursor-provider-turn-lifecycle-emitter.tsowns deferred in-progress lifecycle labels during a turn.src/cursor-tool-lifecycle.tsowns low-noise deferred in-progress lifecycle labels for long-running Cursor tools (coalesced with completed replay cards; bridge excluded).src/cursor-tool-visibility.tsowns canonical Cursor tool visibility classification for lifecycle, incomplete-tool, and replay activity titles.src/cursor-incomplete-tool-visibility.tsowns bounded user-visible labels/traces for started Cursor SDK tool calls discarded without completion.src/cursor-sdk-event-debug.tsowns opt-in provider event artifact capture for Cursor SDK callbacks, stream events, replay/drain/bridge decisions, final partials, and summaries under.debug/cursor-sdk-events/, including discarded incomplete started tool calls whenPI_CURSOR_SDK_EVENT_DEBUG=1.shared/cursor-sdk-event-debug-env.mjsowns canonical Cursor SDK event-debug env names;src/cursor-sdk-event-debug-constants.tsre-exports them and owns debug artifact base-dir resolution.src/cursor-sdk-event-debug-session.tsowns debug session grouping, turn artifact directory allocation, and session manifest updates.src/cursor-agents-context.tsowns Cursor-model suppression of pi<project_context>/AGENTS.mdduplication andPI_CURSOR_PRESERVE_PI_AGENTS_MD;src/cursor-agents-context-registration.tsowns the static lifecycle registration for that suppression.src/cursor-sdk-output-filter.tsexposes the shared exact-frame SDK output filter. Extension initialization installs one process-lifetime lease, including detached rules/skills work and asynchronous reload gaps; the versioned process singleton shares sink ownership and async attribution across reevaluation, with canonical test-only reset.src/cursor-edit-diff.tsowns canonical edit diff fallback resolution for replay/display paths.src/cursor-record-utils.tsowns shared record/string-key parsing and neutral unknown-value stringification helpers used across bridge and transcript layers.src/cursor-partial-content-emitter.tsowns shared thinking/text block emission for live-run drain and turn coordinator paths.shared/cursor-cloud-lifecycle-constants.mjsowns the canonical Cursor Cloud agent ID pattern, lifecycle entry type, and journal prefix;src/cursor-cloud-lifecycle.tsandscripts/cloud-runtime-smoke.mjsconsume it for provider runtime and maintainer scripts.shared/cursor-sensitive-text.mjsowns canonical secret scrubbing;src/cursor-sensitive-text.tsand maintainer scripts import it directly.shared/cursor-setting-sources.mjsowns canonicalPI_CURSOR_SETTING_SOURCESparsing/serialization;src/cursor-setting-sources.tsand maintainer scripts import it directly.src/cursor-usage-accounting.tsowns coherent native current-context mapping from LOCAL turn-ended usage or estimates; cumulative bills never enter native usage.src/cursor-sdk-billed-usage.tsowns bounded publicAgent.getUsage()observation and disjoint aggregate-safe validation; no UUID watermarks or guessed client-run billing joins.src/cursor-usage-ledger.tsowns unique public native origin claims, validated fsynced session-ID journals, raw/reported/terminal/billed facts and canonical branch views;src/cursor-usage-command.tsowns truthful/cursor-usageview/refresh/export/help with the default footer unchanged.src/cursor-provider-turn-summary.tsowns fresh text-only LOCAL compaction/tree agents, ephemeral stores and disposal before terminal emission, independent of ordinary conversation tools/mode/resume.scripts/lib/cursor-smoke-env.mjs,scripts/lib/cursor-smoke-shell.sh, andscripts/lib/cursor-visual-render.mjsown maintainer smoke PATH/env isolation and browser-rendered visual artifacts; smoke runners should consume these helpers instead of duplicating debug env names, sealed Node PATH logic, or xterm/Playwright rendering.scripts/release-review.mjsandscripts/lib/release-review-*.mjsown exact-diff review, catalog, registry, package, and PR/issue evidence receipts; their commands are indocs/development.md.scripts/lib/cloud-smoke-github.mjsowns throwaway GitHub repository identity, provisioning, and deletion proof;scripts/lib/cloud-smoke-cleanup-evidence.mjsowns Cloud agent cleanup, retained evidence/provenance, and release-gate resource coordination;scripts/lib/cloud-smoke-shutdown.mjsowns signal-safe detached-child shutdown;scripts/lib/cloud-smoke-pi-runner.mjsowns print/RPC child transport;scripts/lib/cloud-smoke-artifacts.mjsowns metadata and lifecycle artifact readers.scripts/cloud-runtime-smoke.mjskeeps concrete lane orchestration.scripts/platform-smoke/artifact-bundle-contract.mjsowns the canonical platform artifact bundle path/size/shape contract;scripts/platform-smoke/artifact-fs-safety.mjsowns no-follow traversal, bounded reads, extraction preflight, and spill writes;scripts/platform-smoke/artifact-anchored-extract.mjsplusartifact-openat-extract.cown descriptor-relative POSIX extraction/rollback and fail-closed Windows-controller handling;scripts/platform-smoke/artifact-secrets.mjsowns bundle secret-scan/redaction;scripts/platform-smoke/wrapped-line-match.mjsowns terminal-wrap-aware line matching. Platform smoke scripts should consume these instead of duplicating fs-safety or redaction logic.src/cursor-tool-presentation-registry.tsis the canonical typed registry for Cursor tool names, labels, visibility, lifecycle, replay metadata (legacy wrapper names, wrapper labels, side-effect policy, call-summary policy), web remapping, alias normalization, and bridge exclusions for internal replay wrappers only (cursor,cursor_*); sibling modules derive from it.src/cursor-transcript-tool-specs.tsowns per-tool transcript formatters and pi display builders;TOOL_DISPLAY_IMPLEMENTATIONSis a typedRecord<CursorNormalizedToolName, ToolDisplaySpec>that requires every normalized tool key and rejects extra keys.src/cursor-pi-tool-bridge-types.tsowns shared bridge/MCP type contracts.src/cursor-env-boolean.tsowns canonical env boolean parsing (default and tri-state optional) for bridge diagnostics, flags, and native replay gating.src/cursor-live-run-coordinator.tsowns live Cursor run registry/scope matching, queued events, drain leases, idle disposal timers, and release cleanup.src/cursor-pi-tool-bridge.tsre-exports bridge registration and snapshot helpers; exposes active pi tools to local Cursor agents through a per-run loopback stable MCP v2 bridge.src/cursor-pi-tool-bridge-snapshot.tsowns bridge snapshot building, env gating, and surface signatures.src/cursor-pi-tool-bridge-server.tsowns loopback Hono HTTP routing,Host/Originvalidation, and run endpoint registry for bridge runs.src/cursor-pi-tool-bridge-run.tsowns MCP transport setup, pending bridge calls, pi tool dispatch, cancellation, and run lifecycle.src/cursor-pi-tool-bridge-abort.tsowns bridge pi tool execution abort tracking and process signal handling.src/cursor-pi-tool-bridge-diagnostics.tsowns bridge debug diagnostics serialization and stderr logging.src/cursor-pi-tool-bridge-mcp.tsowns MCP name/schema conversion and pi-to-MCP content helpers for the bridge.src/cursor-model-lifecycle.tsowns the canonical effective Cursor model lifecycle/sync helper forsession_start,before_agent_start,model_selectwith event-model override, andturn_start; callers keep Cursor-only filtering explicit.src/cursor-fallback-warning.tsowns per-session Cursor fallback catalog warning activation.src/cursor-question-tool.tsowns the bridge-exposedcursor_ask_questionpi UI tool and thepi-cursor-sdk:ask-question:blockedwait-state event.src/cursor-native-tool-display-registration.tsowns native replay tool registration and model-scoped activation.src/cursor-native-replay-routing.tsowns canonical native replay disposition (queue_replay/inactive_trace/transcript_trace) and context-tool partitioning for drain.src/cursor-native-replay-trace.tsowns inactive native replay trace formatting (title: summary).src/cursor-pi-context.tsowns the stock/transcript Pi context boundary; it uses Pi's required public replay helpers, not a local replay implementation.src/cursor-context-tools.tsowns request tool snapshots at provider stream start (tools replayed from transcript declarations or shorthandsystemPrompt/toolscontexts), distinct from the registry-owned bridge snapshot.src/cursor-display-text.tsowns shared single-line sanitization and 240-char truncation for replay/trace display.src/cursor-native-tool-display-replay.tsowns replay card rendering and diff/preview formatting.src/cursor-native-tool-display-tools.tsowns native/replay tool definition factories and replay execute wrappers.src/cursor-native-tool-display-state.tsowns native replay display state, env gating, and record/consume helpers.src/cursor-tool-result-display-readers.tsowns canonical result readers shared by transcript/replay paths, including MCP-like content display normalization.src/cursor-tool-transcript.tsowns the rawunknown toolCall -> transcript/displayfaçade;src/cursor-transcript-tool-specs.ts,src/cursor-transcript-utils.ts, andsrc/cursor-transcript-tool-formatters.tsimplement spec dispatch and formatting.src/cursor-mcp-timeout-override.tsowns Cursor SDK MCP timeout overrides: 3600s default forcallTool, 10s default for verified initialize/listTools paths on first send, and SDK-default behavior for unknown MCP protocol stacks.src/cursor-config.tsowns Cursor SDK config loading, parsing, source precedence, safety-cap resolution, cloud environment selection, and legacy fast-default config persistence.src/cursor-custom-subagent-definitions.tsmaps validated named config to public SDK agents with independent catalog selection; SDK 1.0.37 LOCAL conversion is ID/inherit-only, while Cloud retains params. Ordinary turn acquisition hashes nonempty resolved definitions; summaries remain definition-free.src/cursor-cloud-options.tsowns cloud SDK option mapping and fail-closed preflight.src/cursor-cloud-local-state.tsowns canonical cloud starting-ref normalization, hermetic Git probes, remote identity/refspec validation, and reasoned local-state inspection.src/cursor-cloud-lifecycle.tsowns session-branch cloud lifecycle ledger entries and explicit/cursor-cloudlist/archive/delete command behavior.src/cursor-durable-fs.tsowns no-follow regular-file opens, exclusive private creation, fsync, and bounded validated frame IO shared by usage journals, Cloud lifecycle and local cleanup; preserve descriptor/path identity guards.src/cursor-state.tsowns Cursor fast/mode controls,/cursor-httpsession/user persistence,/cursor-tools, and local config refresh/cleanup wiring.src/cursor-runtime-state.tsowns effective Cursor config/runtime resolution, cloud/local runtime flags, runtime status helpers, cloud acknowledgement, and/cursor-runtime//cursor-cloudwiring.src/context.ts,src/context-window-cache.ts, andsrc/bundled-context-windows.tshandle prompt conversion and context-window caches.src/cursor-bridge-contract.tsowns pi bridge MCP naming, the model-facing bridge preference text, and concise MCP descriptions that point to the bootstrap tool-surface rules.src/cursor-tool-manifest.tsowns bootstrap callable-surface manifest text (PI_CURSOR_TOOL_MANIFEST, default on).test/**/*.test.tscontains Vitest coverage for provider registration, discovery, state, context, bridge, replay, and streaming behavior.test/native-cursor-ownership.test.mjsowns native concurrent and same-file-manager lifecycle/resume/bridge ownership contracts, using the shared native harness and explicit compatibility CI routes.test/helpers/pi-harness.tsis the canonical fake pi/extension harness (createPiHarness, shared model/context/event runners, tool factories).test/helpers/cursor-provider-harness.tsowns Cursor SDK provider mocks/stream helpers and re-exports pi-harness fixtures for provider tests.test/helpers/cursor-provider-ownership.tssupplies explicit direct-provider fixtures with real public SessionManager/captured accounting; binding/native tests own actual header-receipt proof.docs/cursor-model-ux-spec.mdis the maintainer design source of truth for Cursor model UX. Keep it aligned with behavior changes.docs/cursor-testing-lessons.mdis the maintainer source of truth for regression testing lessons (auth.json, isolated smoke harnesses, JSONL replay scans, plan-mode replay traps).docs/cursor-dogfood-checklist.mdis the minimal one-session dogfood checklist (baseline env, JSONL ID patterns, bootstrap manifest, edit diff card).
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.
- yesterday Changed · +57 tokens per session e232ac17054d
- 3d ago Changed · +4 tokens per session a4004e1ebd95
- 4d ago Changed · +3 lines · +106 tokens per session 96ddfe636733
- 11d ago Changed · +1 lines · +59 tokens per session 70c1e898e0bd
- 14d ago Changed 0cc6f05ca610
- 15d ago Changed · -5 tokens per session 534b3204bcd7
- 17d ago Changed · +36 tokens per session ae783682ee6c
- 25d ago Changed aca7cc8fb172
- 1mo ago Changed · +1 lines · +81 tokens per session b9bb88d951cf
- 1mo ago First seen · 239 lines · 7,552 tokens per session scan A 3a6b70b42bc3
pi-cursor-sdk AGENTS.md is an instructions file published in the GitHub repository fitchmultz/pi-cursor-sdk (348 stars, last pushed 2d ago), licensed MIT. It adds 7,890 tokens to every session, about $0.0316 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.
pi-cursor-sdk AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| pi-cursor-sdk AGENTS.mdfitchmultz/pi-cursor-sdk | Instructions file | 348 | 2d ago | MIT | A | 7,890 | Codex, OpenCode |
| data-scientist copilot-instructions.mdrealnghon/data-scientist | Instructions file | 2 | 4mo ago | MIT | A | 373 | GitHub Copilot |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | today | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |