cursor

A setup guide for connecting Code Context Engine to Cursor, a code editor with an AI assistant. Code Context Engine finds relevant code, compresses the context sent to the agent, follows code relationships, and keeps memory across sessions.

In plain words
What is it for?
Use it to configure Cursor, search for relevant code chunks, trace imports and calls, recall earlier project decisions, and track token savings.
Why use it?
It can reduce the amount of code Cursor needs to process and preserve decisions after a restart. It also lets you measure token savings while using Cursor's built-in code search.

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/elara-labs/code-context-engine/cursor
Clone the repo
git clone --depth 1 https://github.com/elara-labs/code-context-engine
Per session 8 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 578 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.00008 $0.00578
Opus 5 $0.00004 $0.00289
Sonnet 5 $0.00002 $0.00116
Haiku 4.5 $0.00001 $0.00058

Measured yesterday against content hash 887c479beb19, 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 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.

docs-src/src/content/docs/agents/cursor.md · 77 lines

How it starts

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

Cursor has built-in codebase indexing, but CCE adds compressed retrieval, cross-session memory, and token savings tracking on top.

Quick setup

cce init              # Auto-detects Cursor if .cursor/ exists
cce init --agent all  # Explicitly includes Cursor

Files created

.cursor/mcp.json

Registers the CCE MCP server for Cursor's agent mode.

{
  "mcpServers": {
    "context-engine": {
      "command": "cce",
      "args": ["serve", "--project-dir", "/path/to/your/project"]
    }
  }
}

.cursorrules

Contains instructions for Cursor's AI to prefer context_search over raw file reads. The CCE block is wrapped in markers so your own rules are preserved.

Working with Cursor's built-in indexing

Cursor indexes your codebase for its own retrieval. CCE complements this by:

  • Compressed context that uses fewer tokens per query (Cursor's index returns full file content, CCE returns relevant chunks with signature compression)
  • Token savings tracking so you can measure the cost difference
  • Graph-aware retrieval that follows code relationships (imports, calls)
  • Cross-session memory that persists decisions across restarts

Both systems run side by side without conflict. Cursor's indexing handles in-editor completions, CCE handles chat/agent queries.

Verify it's working

  1. Restart Cursor after running cce init
  2. Open the Composer or Chat panel
  3. Ask a code question:
Where is the database connection configured?
  1. Check the tool call output. If Cursor used context_search, CCE is active
  2. Run cce savings in your terminal to see token savings

Troubleshooting

Cursor ignores CCE and reads files directly

Cursor may prefer its built-in indexing for some queries. Check that .cursorrules contains the CCE instructions block. The instructions tell Cursor to prefer context_search, but Cursor's own heuristics may override this for simple lookups.

"cce: command not found"

Cursor inherits PATH from how it was launched. Ensure ~/.local/bin (or wherever cce is installed) is in your shell profile, then launch Cursor from a terminal with cursor .

Read the full file on GitHub · 77 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. yesterday First seen · 77 lines · 8 tokens per session scan A 887c479beb19

Subscribe to this mod's changes

cursor is an agent published in the GitHub repository elara-labs/code-context-engine (407 stars, last pushed 8d ago), licensed MIT. It adds 8 tokens to every session and 578 once invoked, about $0.0000 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.