cursorrules

Rules for using ContextStream, a tool that stores and retrieves project context for an agent across messages.

In plain words
What is it for?
Loading project context, capturing decisions and lessons, and preparing focused context for code or file questions.
Why use it?
They tell the agent when to initialize context, retrieve relevant information, record decisions, and review lessons before risky work.

Cursor rule for Cursor

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 rules/contextstream/mcp-server/cursorrules
Clone the repo
git clone --depth 1 https://github.com/contextstream/mcp-server

Made for: Cursor.

Per session 1,317 This file is loaded in full into every session.
When invoked 1,317 The same file — it is already loaded in full.
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.01317 $0.01317
Opus 5 $0.00659 $0.00659
Sonnet 5 $0.00263 $0.00263
Haiku 4.5 $0.00132 $0.00132

Measured yesterday against content hash 89ad0e7f5016, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cursorrules 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.

.cursorrules · 68 lines

How it starts

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

Cursor Rules

ContextStream v0.4.x (Consolidated Domain Tools)

v0.4.x uses ~11 consolidated domain tools for ~75% token reduction vs previous versions. Rules Version: 0.4.27

Required Every Message

Message What to Call
1st message session_init(folder_path="<cwd>", context_hint="<user_message>"), then context_smart(user_message="<user_message>", format="minified", max_tokens=400)
2nd+ messages context_smart(user_message="<user_message>", format="minified", max_tokens=400)
Capture decisions session(action="capture", event_type="decision", title="...", content="...")
Before risky work session(action="get_lessons", query="<topic>")
On user frustration session(action="capture_lesson", title="...", trigger="...", impact="...", prevention="...")

Context Pack (Pro+): If enabled, use context_smart(..., mode="pack", distill=true) for code/file queries. If unavailable or disabled, omit mode and proceed with standard context_smart (the API will fall back).

Tool naming: Use the exact tool names exposed by your MCP client. Claude Code typically uses mcp__<server>__<tool> where <server> matches your MCP config (often contextstream). If a tool call fails with "No such tool available", refresh rules and match the tool list.

Quick Reference: Domain Tools

Tool Common Usage
search search(mode="semantic", query="...", limit=3) — modes: semantic, hybrid, keyword, pattern
session session(action="capture", ...) — actions: capture, capture_lesson, get_lessons, recall, remember, user_context, summary, compress, delta, smart_search
memory memory(action="list_events", ...) — CRUD for events/nodes, search, decisions, timeline, summary
graph graph(action="dependencies", ...) — dependencies, impact, call_path, related, ingest
project project(action="list", ...) - list, get, create, update, index, overview, statistics, files, index_status, ingest_local
workspace workspace(action="list", ...) — list, get, associate, bootstrap
integration integration(provider="github", action="search", ...) — GitHub/Slack integration
help help(action="tools") — tools, auth, version, editor_rules

Read the full file on GitHub · 68 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 · 68 lines · 1,317 tokens per session scan A 89ad0e7f5016

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository contextstream/mcp-server (40 stars, last pushed 13d ago), licensed MIT. It adds 1,317 tokens to every session, about $0.0066 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.