Borrowing it
Nothing to install: this file belongs to FedgeNo/conventions-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/FedgeNo/conventions-mcp/main/AGENTS.mdgit clone --depth 1 https://github.com/FedgeNo/conventions-mcpWrote 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.
[](https://agentmods.dev/instructions/fedgeno/conventions-mcp/agents-md)<a href="https://agentmods.dev/instructions/fedgeno/conventions-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/fedgeno/conventions-mcp/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/fedgeno/conventions-mcp/agents-md"><img src="https://agentmods.dev/badge/instructions/fedgeno/conventions-mcp/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.06372 | $0.06372 |
| Opus 5.5 | $0.02549 | $0.02549 |
| Sonnet 5.5 | $0.01274 | $0.01274 |
| Haiku 4.5 | $0.00637 | $0.00637 |
Grade B, and why
conventions-mcp AGENTS.md scanned grade B 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 1mo 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.
Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
Three hooks, configured in `~/.claude/settings.json` (not this repo — see How it starts
The opening of the file, as written. The whole thing — 443 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md — Conventions MCP
A personal memory MCP server: local SQLite storage, local embeddings, hybrid
(vector + keyword) search, MCP over stdio. See README.md for the pitch and
setup steps. This file is guidance for any coding agent working on the server's
own code, plus client-specific instructions for wiring the finished server into
supported clients.
Architecture
src/db.js— SQLite (better-sqlite3) +sqlite-vec(vector search) + FTS5 (keyword search). Onethoughtstable; FTS5 stays in sync via triggers;sqlite-vecdoes not, sodeleteThoughtdeletes both rows explicitly in one transaction.hybridSearchmerges vector + FTS results with reciprocal rank fusion (1 / (k + rank)), not a raw score blend.DB_PATH(exported) resolves viaMEMORY_DB_PATH, elsedefaultDbPath():./data/memory.dbin a git checkout (detected by a sibling.gitdirectory — npm never publishes one), or~/.conventions-mcp/memory.dbotherwise, since an npm/npx install's own directory usually isn't user-writable and gets wiped on upgrade.getDb()creates that directory if missing, so nothing upstream needs tomkdirfirst. The DB runs in WAL mode withsynchronous=FULL, a bounded autocheckpoint, and a busy timeout. The WAL is part of the durable database state; writes do not force a checkpoint after commit because that can fail after a successful write or interfere with concurrent readers. Graceful shutdown checkpoints and closes the database. The database directory and files are private to the user on POSIX systems.backupDatabaseuses SQLite's online backup API, verifies the snapshot, and publishes it atomically without overwriting an existing file. Existing database parents must already be private; never chmod a caller's shared directory automatically. Backup and restore staging files are created exclusively with mode 0600 before SQLite writes any records.app_metadatarecords the storage schema, embedding model, and dimension. Unknown non-empty legacy stores are rejected untilmigrate-storagecreates a verified backup and re-embeds every row; declared incompatible formats are never silently adopted.restoreDatabaserequires a stopped service (no WAL/SHM sidecars), validates the source and current-format metadata, makes a non-overwriting online rollback backup, stages the source beside the live database, and uses same-filesystem renames with rollback on publication failure. Source staging uses SQLite's backup API so committed source WAL records are included. Initialization caches a connection only after schema/format checks succeed, and closes failed connections on every error path.src/load-env.js— side-effect module loading~/.conventions-mcp/.envintoprocess.env(without overriding anything already set), for entry points invoked without Node's own--env-fileflag — the installedconventions-mcpbin and the hook scripts run standalone. Import it FIRST in any file that readsprocess.envat module-load time, before importingdb.js; ES module static imports evaluate in file order, so a leading import guarantees this runs before those reads. Nothing in this codebase requires an env var; optional database, model-cache, transport, and timeout settings are listed in.env.example.src/embeddings.js— local embedding model (Xenova/bge-small-en-v1.5, quantized), downloaded once, loaded lazily on first call, and held resident for the server process's lifetime. Its cache is persistent at~/.conventions-mcp/modelsunlessMEMORY_MODEL_CACHE_PATHoverrides it, rather than living inside an npm installation that upgrades may replace. No GPU or hosted inference service. Concurrent callers share initialization; a rejected initialization is cleared so a later call can retry without restarting the process. The tracked.npmrcsetsonnxruntime-node-install-cuda=skip; do not remove it unless GPU inference is deliberately implemented and tested, because ONNX Runtime otherwise downloads an unused CUDA artifact on Linux x64.- Classification (type/topics/projectScoped) happens in the calling
agent, not the server —
capture_thought/update_thought's zodinputSchemainserver.js(CLASSIFICATION_FIELDS) carries the taxonomy via field descriptions, and the tool description instructs the caller to fill them in from the conversation the thought came from. The caller only judges whether a thought is scoped to the current project (projectScoped, defaulting tofalse/global unless the rule is specific to the current working directory) — it never has to name the project itself; seewithProjectStampinserver.js. There is no server-side classification step and no network call anywhere in the capture pipeline. db.js'slistRules({ project })— a plain deterministic SQL filter (project IS NULL OR project = ?), no embeddings, no LLM call. Backs thelist_rulesMCP tool — cheap enough to call on every turn.hooks/hooks.json— CodexSessionStartandPreToolUselifecycle configuration. The first runs the same fixed-size instruction used by Claude Code; the second denies every other tool until the agent callslist_rules. This avoids placing a potentially truncated rule set in hook output and reuses the same marker state on both clients.bin/session-rules.js(SessionStarthook),bin/prompt-reminder.js(UserPromptSubmithook), andbin/pre-tool-check.js(PreToolUsehook, matcher*) — see "Standing-rule hooks" below. None touch the database directly.session-rules.jsemits a short, fixed-size instruction telling the model to call thelist_rulesMCP tool itself; embedding the rule content directly in hook output doesn't scale — a large enough stored rule set gets silently truncated to a small preview before it ever reaches the model.pre-tool-check.jsis the enforcement layer: advisory instructions turned out to be ignorable in practice, so it denies any other tool call untillist_ruleshas run this session, tracked by a marker file. The gate fires once per session start, not once per turn —session-rules.jsre-arms it on every start, resume, compaction, or/clear, including when a resumed conversation retains an earlier rule load.prompt-reminder.jsno longer touches the gate at all; it just re-anchors, every turn, "follow the loaded conventions, and capture only durable rules intended to govern future sessions or repeated work." Task-specific directions, temporary choices, status/history, one-job commands, and descriptions of how an individual job was completed remain in conversation context. Each script has a.cmdsibling (session-rules.cmd,prompt-reminder.cmd,pre-tool-check.cmd) that Windowssettings.jsonentries point at — see "Platform support" below.src/server.js— registers the seven MCP tools (capture_thought,update_thought,delete_thought,search_thoughts,list_thoughts,list_rules,thought_stats) and connects over stdio by default or localhost-only Streamable HTTP whenMCP_TRANSPORT=http. HTTP exposes a database-backed/healthzreadiness check and bounds retained sessions withMCP_HTTP_MAX_SESSIONSandMCP_HTTP_SESSION_IDLE_MS. Both transports usesrc/shutdown.jsto bound graceful cleanup withMCP_SHUTDOWN_TIMEOUT_MS; failures are logged and set a failing process status while database cleanup is still attempted.update_thoughtis a real SQLUPDATE(preserves the row's id), not delete-then- reinsert — it re-embeds against the new content and takes fresh classification fields from the caller, then replaces the row'sthoughts_vecentry in the same transaction (vec0 has no in-place UPDATE, so that part is delete+insert internally, unlike thethoughts/FTS side which is a real UPDATE synced by the existing trigger).withProjectStampconverts the caller'sprojectScopedboolean into a deterministicprojectfield before storage — seesrc/project.jsbelow for why that split exists.list_rulesandlist_thoughtsrender each row by its#id(list_rulesordered by id ascending), so the ids the user sees are exactly the ones they pass back toupdate_thought/delete_thought.createConventionsServerandrunHTTPServeraccept an optional embedding function for deterministic tests; production entry points always use the real local model. HTTP integration tests must inject a 384-value embedding rather than downloading the model, so the suite is reproducible offline. HTTP startup must reject listener errors rather than reporting success. Unknown or expired session IDs return HTTP 404 to signal reinitialization; missing required session IDs return HTTP 400. Active tool calls suspend idle expiry. Shutdown drains both handlers and HTTP responses before closing transports; forced closure cancels pending writes. Roots resolution has a one-second deadline and caches the scope until a roots-change notification, or for 30 seconds after a failed lookup.src/project.js—getCurrentProject(cwd)derives a stable project id from the normalized absolute path prefixed bypath:, preserving separators. Legacy hyphen-based IDs require explicitmigrate-projectownership assignment with a verified backup; never infer ownership of a colliding ID. Used to stamp captures and to filterlist_rules, so "which project" is a deterministic lookup rather than free-text matching against whatever string an LLM happened to write.bin/cli.js— the npm"bin"entry (package.json's"bin": { "conventions-mcp": "bin/cli.js" }), so an installed copy resolves on PATH with no path management needed. Dispatches by subcommand (init-db,backup,warmup,doctor,codex-project-header, the two hook commands,--help,--version, or nothing → starts the MCP server) via dynamicimport()of the same modules thenpm runscripts already use — each does its work as a top-level side effect on import, so no refactor into exported functions was needed just for this.codex-project-headerprints the current working directory as theX-Conventions-ProjectJSON header expected by Codex'shttp_headers_helper. No config bootstrap step — nothing here requires a.envto exist.src/doctor.js— non-downloading operational diagnostics used by thedoctorCLI command. It checks the supported Node.js floor, opens and quick-checks SQLite, verifies the vec0 table and data permissions, and reports whether the configured model cache looks complete. A missing model is a warning; runtime/storage failures make the command exit nonzero.
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.
- 1mo ago Changed · +17 lines · +189 tokens per session dba2635855bb
- 1mo ago Changed · +51 lines · +733 tokens per session 7375fc4fc6d4
- 2mo ago First seen · 375 lines · 5,450 tokens per session scan B fb33c0390873
conventions-mcp AGENTS.md is an instructions file published in the GitHub repository FedgeNo/conventions-mcp (0 stars, last pushed 1mo ago), licensed MIT. It adds 6,372 tokens to every session, about $0.0255 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-08.
conventions-mcp AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| conventions-mcp AGENTS.mdFedgeNo/conventions-mcp | Instructions file | 0 | 1mo ago | MIT | B | 6,372 | Claude Code, Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |