egc-context

Project memory rules that let an agent save, recall, search, and compress information from earlier work sessions.

In plain words
What is it for?
Use them to resume work, record decisions, recall past lessons, search project history, detect recurring mistakes, and reduce an overloaded session.
Why use it?
They reduce repeated explanations and help the agent recover decisions, lessons, and temporary notes when context is missing or too large.

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/fmarzochi/egc/egc-context
Clone the repo
git clone --depth 1 https://github.com/Fmarzochi/EGC

Made for: Cursor.

Per session 364 This file is loaded in full into every session.
When invoked 364 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.00364 $0.00364
Opus 5 $0.00182 $0.00182
Sonnet 5 $0.00073 $0.00073
Haiku 4.5 $0.00036 $0.00036

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

Security

Grade A, and why

egc-context 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.

.cursor/rules/egc-context.mdc · 46 lines

What it actually says

EGC Project Memory

EGC Natural Language Interface

Detect user intent in any language and call the matching EGC tool — no keywords required:

Session

  • User resumes work (any language) → get_state
  • User ends session (any language) → update_state

Diagnosis — when AI seems confused or hallucinating

  • User questions whether things are working → get_project_state
  • User asks what mistakes keep repeating → detect_patterns
  • User asks what was learned in past sessions → lesson_recall

Memory — user forces a save

  • User asks to record a decision → store_decision
  • User asks AI not to repeat a mistake → lesson_save
  • User confirms a past lesson happened again → lesson_reinforce
  • User wants to store something temporarily → working_memory_set
  • User asks what is in temporary memory → working_memory_get / working_memory_list

Search — when AI forgot something

  • User asks about past decisions on a topic → search_history
  • User asks for recent decisions chronologically → query_history

Context — when heavy

  • User says context is full or heavy → reduce_context
  • User asks to compress session observations → compress_observations

Safety — when user is suspicious

  • User asks if a shell command is safe → validate_command
  • User asks if a file path is safe to write → validate_write
  • User asks to organize a complex task → orchestrate_task
  • User asks AI to learn from session errors → auto_learn

EGC Project Memory

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. 3d ago First seen · 46 lines · 364 tokens per session scan A 76626605e1f0

Subscribe to this mod's changes

egc-context is a cursor rule published in the GitHub repository Fmarzochi/EGC (46 stars, last pushed 7d ago), licensed Apache-2.0. It adds 364 tokens to every session, about $0.0018 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.