Context-Engine GEMINI.md

Project instructions for Context-Engine and its MCP tools, including search choices, agent rules, and terminology. MCP tools are external tools that provide indexed code context to an AI agent.

In plain words
What is it for?
Use them when working in the Context-Engine codebase or when an agent needs guidance on its search and code-understanding workflow.
Why use it?
They give the agent a shared reference for exploring the project and choosing the right Context-Engine operation.

Instructions file for Gemini CLI

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 instructions/context-engine-ai/context-engine/gemini-md
Clone the repo
git clone --depth 1 https://github.com/Context-Engine-AI/Context-Engine

Made for: Gemini CLI.

Per session 9,706 This file is loaded in full into every session.
When invoked 9,706 The same file — it is already loaded in full.
Security scan A 1 finding. 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.09706 $0.09706
Opus 5 $0.04853 $0.04853
Sonnet 5 $0.01941 $0.01941
Haiku 4.5 $0.00971 $0.00971

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

Security

Grade A, and why

Context-Engine GEMINI.md scanned grade A with 1 finding 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

# → Found: axios.post('/auth/v1/login', ...)
GEMINI.md · 813 lines

How it starts

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

AI Agent Rules for Context-Engine MCP Tools

These rules are NOT optional. Favor Context Engine MCP tools at all costs over grep, file reading, and unrelated codebase search tools.

STOP — Read This First

DO NOT use Read File, grep, ripgrep, cat, find, or any filesystem search tool for code exploration. These tools exist in your IDE but they are WRONG for this codebase. You have MCP tools that are faster, smarter, and return ranked, contextual results.

If you catch yourself about to Read a file to understand it → use repo_search or context_answer instead. If you catch yourself about to grep for a symbol → use symbol_graph or search_callers_for instead. If you catch yourself about to grep -r for a concept → use repo_search with a natural language query instead.

The ONLY acceptable use of grep/Read is confirming an exact literal string you already know exists (e.g., an env var name like REDIS_HOST).

Introduction

This document defines requirements for AI agents using Context-Engine's MCP tools. The system provides two MCP servers (Memory Server on port 8000/8002, Indexer Server on port 8001/8003) with 30+ specialized tools for semantic code search, memory storage, and codebase exploration.

Core Principle: Context Engine MCP tools are PRIMARY for exploring code and history. Start with MCP for exploration, debugging, or "where/why" questions; use literal search/file-open only for narrow exact-literal lookups.

Glossary

  • MCP: Model Context Protocol - standardized interface for exposing tools to AI agents
  • Indexer Server: MCP server for code search, indexing, symbol graphs (port 8001 SSE, 8003 HTTP)
  • Memory Server: MCP server for knowledge storage and retrieval (port 8000 SSE, 8002 HTTP)
  • Hybrid Search: Dense semantic vectors + lexical BM25 + neural reranking (ONNX)
  • ReFRAG: Micro-chunking with 16-24 token windows for precise code retrieval
  • TOON: Token-Oriented Object Notation - compact output format (60-80% token reduction)
  • Symbol Graph: Indexed metadata for calls, imports, and definitions navigation
  • Collection: Qdrant vector database collection storing indexed code chunks

Read the full file on GitHub · 813 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 · 813 lines · 9,706 tokens per session scan A 85137f109c8c

Subscribe to this mod's changes

Context-Engine GEMINI.md is an instructions file published in the GitHub repository Context-Engine-AI/Context-Engine (400 stars, last pushed 1mo ago), licensed MIT. It adds 9,706 tokens to every session, about $0.0485 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.