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 instructions/fitchmultz/pi-cursor-sdk/agents-mdgit clone --depth 1 https://github.com/fitchmultz/pi-cursor-sdkWhat 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.06666 | $0.06666 |
| Opus 5 | $0.03333 | $0.03333 |
| Sonnet 5 | $0.01333 | $0.01333 |
| Haiku 4.5 | $0.00667 | $0.00667 |
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 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 — 223 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-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 pi session cwd, session file/id/name/generation scope keys, andsession_start/session_info_changedregistration for session-agent pooling, cloud agent names, and debug grouping.src/cursor-session-store.tsowns per-session Cursor SDK SQLite store identity derivation, open/disposal, temporary fileless stores, and guarded removal.src/cursor-http1.tsowns branch-scoped local HTTP/1.1 session state, global-preference override tracking, and extension-owned SDK configuration/null reset.src/cursor-ripgrep-path.tsowns bundled Cursor SDK platform ripgrep resolution and local-agent environment initialization.src/cursor-session-agent.tsowns session-scoped SDK agent pooling, transport-aware pool identity, send-state commits, busy tracking for in-flight SDKrun.wait()work, and scoped acquire/dispose state.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 before module reload.src/cursor-session-compaction-prep.tsownsprepareCursorSessionForCompaction()(release scoped live runs, reset pooled agent, suppress summarizer resume-handle persist) wired fromsession_before_compactinsrc/index.ts.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.tssuppresses Cursor SDK integrator bootstrap noise from pi's TUI.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 pi usage mapping from local turn-ended and billedAgent.getUsage()spend, plus post-compaction occupancy floors.src/cursor-sdk-billed-usage.tsownsAgent.getUsage()fetch, local usage-UUID watermarks, and billed turn selection.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/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 keyed by normalized tool name; its display implementation keys must match registry entries exactly (CURSOR_TOOL_DISPLAY_SPEC_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 MCP bridge.src/cursor-pi-tool-bridge-snapshot.tsowns bridge snapshot building, env gating, and surface signatures.src/cursor-pi-tool-bridge-server.tsowns loopback HTTP routing 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-context-tools.tsownscontext.toolssnapshot helpers at provider stream start.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-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 the canonical no-follow regular-file open (openExistingRegularFileNoFollow) and read-write fsync (fsyncExistingRegularFile) helpers used to durably fsync session/journal files without following an attacker-replaced symlink;src/cursor-cloud-lifecycle.tsandsrc/cursor-session-agent-cleanup.tsconsume it instead of duplicating the identity-check logic.src/cursor-state.tsowns Cursor fast/mode controls,/cursor-httpsession/user persistence,/cursor-tools, local config refresh/cleanup wiring, and stable state re-exports.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 description helpers and the exported full bridge contract text (bootstrap/manifest carry the user-facing contract; MCP descriptions use a one-line pointer).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/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.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.
- 3d ago First seen · 223 lines · 6,666 tokens per session scan A ff495fc4786a
pi-cursor-sdk AGENTS.md is an instructions file published in the GitHub repository fitchmultz/pi-cursor-sdk (314 stars, last pushed 15d ago), licensed MIT. It adds 6,666 tokens to every session, about $0.0333 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 instructions, from other repositories
pi-agent-browser-native AGENTS.md
Instructions for fitchmultz/pi-agent-browser-native, covering pi-agent-browser-native, product-specific guidance, documentation placement, upstream capability baseline and command reference and tool result categories.
pi-subagents AGENTS.md
Instructions for tintinweb/pi-subagents, covering development rules, conversational style, code quality, documentation and commands.
pi-extensions AGENTS.md
Instructions for narumiruna/pi-extensions, covering repository guidelines, documentation and communication, repository structure, commands and tooling and dependency safety.
pi-codex-goal AGENTS.md
Instructions for fitchmultz/pi-codex-goal, covering pi-codex-goal — agent notes, local pi install policy, verify before finishing and layout.
pi-commandcode-provider AGENTS.md
Instructions for patlux/pi-commandcode-provider, a project described as: pi custom provider for the Command Code API — 18 models including Claude, GPT, DeepSeek, Kimi, GLM, MiniMax, and Qwen.
pi-fancy-footer AGENTS.md
Instructions for mavam/pi-fancy-footer, covering pi-fancy-footer, setup, development and release engineering.