sruja-context-host

sruja-context-host is a cursor rule for Cursor from sruja-ai/sruja. It costs 822 tokens per session, scanned A, original, Apache-2.0.

Rules for connecting Sruja's architecture context tools to an AI coding session. Sruja is a tool that tracks whether a project's code still matches its declared architecture.

In plain words
What is it for?
Use it when working with Sruja's MCP connection, architecture boundaries, drift reports, session context, or project workflow state.
Why use it?
It tells the assistant which project state and architecture warnings to inspect before making changes, so important design conflicts are not overlooked.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it when working with Sruja's MCP connection, architecture boundaries, drift reports…

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/sruja-ai/sruja/sruja-context-host
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.

Clone the repo
git clone --depth 1 https://github.com/sruja-ai/sruja

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sruja-context-host

README.md
[![agentmods](https://agentmods.dev/badge/rules/sruja-ai/sruja/sruja-context-host.svg)](https://agentmods.dev/rules/sruja-ai/sruja/sruja-context-host)
Your own site
<a href="https://agentmods.dev/rules/sruja-ai/sruja/sruja-context-host"><img src="https://agentmods.dev/badge/rules/sruja-ai/sruja/sruja-context-host.svg" alt="Measured on agentmods" height="20"></a>
Per session 822 This file is loaded in full into every session.
When invoked 822 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00822 $0.00822
Opus 5 $0.00411 $0.00411
Sonnet 5 $0.00164 $0.00164
Haiku 4.5 $0.00082 $0.00082

Measured 7d ago against content hash 88bb913b6649, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

sruja-context-host 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 7d 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/sruja-context-host.mdc · 64 lines

How it starts

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

Sruja context host (Phase 3 + 4)

When the sruja MCP server is enabled (see .cursor/mcp.json), follow this host contract. Sruja suggests; you apply.

Tool Profiles

Sruja MCP server supports tool profiles to control which tools are available:

  • minimal (~10-12 tools): Core ladder + focus briefing + essential utilities
  • coding (~15-18 tools, default): Minimal + hybrid query + critique + context pruning
  • arch: Coding + read-only authoring helpers
  • full: All tools (backward compatible)

The profile is controlled via:

  1. Environment variable: SRUJA_MCP_TOOL_PROFILE
  2. MCP initializationOptions (set in .cursor/mcp.json)
  3. Defaults to coding profile

Session start

  1. After MCP connects, if you receive notifications/drift_state (or SRUJA_MCP_WATCH_DRIFT=1 is set), treat params as authoritative session context:
    • schema_version must be drift_state/v1
    • Surface truth_status, health_score, and top violations before large edits
  2. If no notification arrived, call sruja_get_drift_state once at the start of architecture-bounded work.
  3. If aidlc-docs/aidlc-state.md or a workflow inception/aidlc-docs/aidlc-state.md exists, run sruja workflow status -r . (with --id when multiple workflows) to surface phase gates and aidlc stage before large SDLC edits.

Before precedent / “why did we…” questions

  1. Call sruja_search_memory with a short query (e.g. component name, decision topic).
  2. Prefer hits with trust: reviewed_truth (decision records) over hypothesis (learnings, events).
  3. Never treat memory hits as permission to edit repo.sruja without the normal proposal/review flow.

Long sessions (context budget)

When the conversation has accumulated many architecture element references (roughly 8+ tool turns on the same task, or token pressure):

  1. Call sruja_suggest_context_prune with:
    • active_element_ids: current focus (from sruja focus, sruja_get_focus_briefing, or scan-resolved module IDs — prefer graph IDs over bare C4 names when warnings appear)
    • session_element_ids: element/module IDs mentioned in the thread
  2. Omit transcript blocks for ids in compress_ids; keep full detail for keep_ids.
  3. After compressing, avoid re-expanding dropped ids unless the user asks.

Read the full file on GitHub · 64 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. 7d ago First seen · 64 lines · 822 tokens per session scan A 88bb913b6649

Subscribe to this mod's changes

sruja-context-host is a cursor rule published in the GitHub repository sruja-ai/sruja (23 stars, last pushed 6d ago), licensed Apache-2.0. It adds 822 tokens to every session, about $0.0041 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.