cursor

A Cursor agent setup that connects Cursor to gps, a local memory system for a code repository. It uses project rules, a command-line tool, and an MCP server to provide repository context.

In plain words
What is it for?
Use it when working in Cursor on a non-trivial repository and needing remembered project context, explicit preference capture, or guidance before edits.
Why use it?
It helps Cursor retain information about code symbols, tests, rules, preferences, decisions, and past lessons between tasks.

Agent

Install

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.

agentmods
npx agentmods add agents/invariance-ai/gps/cursor
Clone the repo
git clone --depth 1 https://github.com/invariance-ai/gps
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 690 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00690
Opus 5 $0.00000 $0.00345
Sonnet 5 $0.00000 $0.00138
Haiku 4.5 $0.00000 $0.00069

Measured 2d ago against content hash 4ba4dd9a44a1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cursor 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 2d 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.

docs/guide/agents/cursor.md · 62 lines

How it starts

The opening of the file, as written. The whole thing — 62 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cursor

gps gives Cursor durable, symbol-anchored repo memory. Because Cursor has no lifecycle hooks, the agent must call record_preference and record_directive MCP tools explicitly — the installed rule instructs the agent to do this automatically.

npx -y @invariance/gps setup --yes --with-cursor

Writes:

  • .cursor/rules/gps.mdc — Cursor project rule with alwaysApply: true. Attached to every request without the agent having to discover it.
  • .cursor/mcp.json — registers gps serve as an MCP server. Merged with any existing entries you already have.

What Cursor does with gps

The rule frontmatter:

---
description: gps — local repo memory (symbol graph, tests, invariants, lessons, decisions). Use the CLI before non-trivial edits.
alwaysApply: true
---

The body teaches the agent the standard gps calls and explains that Cursor has shell access — gps is a CLI, not a service. The MCP server in .cursor/mcp.json exposes the same surface as a tool set; the agent picks whichever fits.

Cursor doesn't expose pre/post-tool-use hooks. Index refresh happens lazily when gps prepare or gps context runs.

Explicit preference and directive capture (Cursor-specific)

Claude Code and Codex capture preferences and directives automatically via hooks. Cursor has no hooks, so the installed rule instructs the agent to call these MCP tools explicitly:

When the user gives a durable instruction ("from now on…", "always…", "i prefer…", "don't ever…") — call record_preference:

record_preference { "text": "<the user's instruction>" }

When the user gives a location-scoped instruction ("don't do X here", "always Y in this folder", "in the home page, avoid Z") — call record_directive:

record_directive { "text": "<instruction>", "area": "<directory or alias>" }

gps stores preferences in a managed block (global scope) and directives as area-scoped notes that resurface whenever you edit files in that directory. The installed .cursor/rules/gps.mdc reminds the agent to make these calls — no manual setup is needed beyond running gps setup --yes --with-cursor.

Read the full file on GitHub · 62 lines

Changes

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.

  1. 2d ago First seen · 62 lines · 0 tokens per session scan A 4ba4dd9a44a1

Subscribe to this mod's changes

cursor is an agent published in the GitHub repository invariance-ai/gps (19 stars, last pushed 3mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 690 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-08-30.