cortex-engine CLAUDE.md

Project instructions for Cortex Engine, a portable cognitive engine for AI agents distributed as an npm package. They describe its commands, source layout, release rules, and supported services.

In plain words
What is it for?
Use them when working on the TypeScript source, cognitive processing, memory, providers, plugins, REST or MCP servers, and release-related files.
Why use it?
They give an agent the project context needed to build, test, serve, and change the code without breaking its workflow conventions.

Instructions file

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/fozikio/cortex-engine/claude-md
Clone the repo
git clone --depth 1 https://github.com/Fozikio/cortex-engine
Per session 671 This file is loaded in full into every session.
When invoked 671 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.00671 $0.00671
Opus 5 $0.00336 $0.00336
Sonnet 5 $0.00134 $0.00134
Haiku 4.5 $0.00067 $0.00067

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

Security

Grade A, and why

cortex-engine CLAUDE.md 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 2d 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.

CLAUDE.md · 65 lines

How it starts

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

cortex-engine

Portable cognitive engine for AI agents. Published as @fozikio/cortex-engine on npm.

Workflow tier: Production

Conventional commits with scopes and explanatory bodies, PR-required (no direct pushes to master), CI as a hard merge gate, Keep-a-Changelog CHANGELOG.md with semver tags. New clones: run git config core.hooksPath .githooks once to activate the commit-msg lint hook.

Commands

npm run build        # tsc → dist/
npm run dev          # tsc --watch
npm run test         # vitest (requires --experimental-vm-modules)
npm run serve        # Start MCP server (node dist/bin/serve.js)

Architecture

src/
├── bin/            # CLI entry points (serve.js, cortex-engine CLI)
├── bridges/        # Cross-namespace bridging
├── core/           # Config, types, utilities
├── engines/        # Cognitive processing, memory consolidation, FSRS, dream pipeline
├── mcp/            # MCP server with 27+ cognitive tools
├── namespace/      # Multi-namespace management
├── plugins/        # Plugin system
├── providers/      # LLM/embedding providers (Anthropic, OpenAI, Vertex, HuggingFace)
├── rest/           # REST API server
├── stores/         # Storage backends
│   ├── sqlite.ts   # Local SQLite (better-sqlite3)
│   └── firestore.ts # Cloud Firestore
├── tools/          # Tool definitions
├── triggers/       # Event triggers
└── index.ts        # Main entry + re-exports

Key Exports

  • . — Core engine, types, tools
  • ./stores/sqlite — SQLite storage backend
  • ./stores/firestore — Firestore storage backend
  • ./mcp — MCP server
  • ./rest — REST API

Critical Rules

  • ESM only ("type": "module") — all imports need .js extensions
  • Target: ES2022, Module: NodeNext
  • Strict TypeScript — noUnusedLocals, noUnusedParameters, noImplicitReturns
  • LLM/embedding providers are peer dependencies (optional) — don't add them as direct deps
  • SQLite via better-sqlite3 (native addon) — needs rebuild on Node version changes

Read the full file on GitHub · 65 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. 2d ago First seen · 65 lines · 671 tokens per session scan A d8bdd62cc743

Subscribe to this mod's changes

cortex-engine CLAUDE.md is an instructions file published in the GitHub repository Fozikio/cortex-engine (49 stars, last pushed 14d ago), licensed MIT. It adds 671 tokens to every session, about $0.0034 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.

Related

Other instructions, from other repositories

llm-wiki-agent GEMINI.md

Gemini CLI instructions for SamurAIGPT/llm-wiki-agent, covering llm wiki agent — schema & workflow instructions, how to use, directory layout, page format and ingest workflow.

SamurAIGPT/llm-wiki-agent · 1,590 tokens

m_flow AGENTS.md

AGENTS.md instructions for FlowElement-xinliuyuansu/m_flow, covering m-flow — developer & agent reference, 1. repository map, extension points, 2. local development and python backend (requires python 3.10 – 3.13).

FlowElement-xinliuyuansu/m_flow · 1,075 tokens

obsidian-llm-wiki AGENTS.md

Instructions for green-dalii/obsidian-llm-wiki, covering llm wiki plugin project development standards, 🛡️ six-gate quality closure, gate 1: five-gate automated, gate 2: no side effects and gate 3: no breaking changes.

green-dalii/obsidian-llm-wiki · 7,700 tokens

remnic AGENTS.md

Instructions for joshuaswarren/remnic, covering remnic - agent guide, architecture boundaries (non-negotiable), upstream references, adapter implementation rules and openclaw compatibility window.

joshuaswarren/remnic · 31,441 tokens

LeanKG AGENTS.md

Instructions for FreePeak/LeanKG, covering leankg — agent context, build & test, cli quick reference, mandatory: docker mcp project paths and tool discovery prefer-order.

FreePeak/LeanKG · 1,827 tokens

ontology-atlas AGENTS.md

Instructions for wlsdks/ontology-atlas, covering agents.md — ontology-atlas, product and non-negotiable architecture, start here, structure and routes and operating gates and skills.

wlsdks/ontology-atlas · 2,685 tokens