cognee: Skill for Claude Code

.agents/skills/cognee-migrations/SKILL.md

cognee-migrations is a skill for Claude Code, Codex from topoteretes/cognee. It costs 82 tokens per session (2,936 once invoked), scanned A, original, Apache-2.0.

A guide to updating Cognee's database structures and stored graph data as the software changes. A migration is a controlled change that keeps an existing database compatible with a newer version.

In plain words
What is it for?
Use it to check migration status, apply or reverse migrations, mark a revision, and create changes for relational, graph, or vector data.
Why use it?
It helps when a write is blocked by an unfinished migration or when database state needs checking or repair. It distinguishes ordinary database tables from graph and vector data changes.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is topoteretes/cognee's own configuration. It tells Claude Code and Codex how to work on cognee itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything cognee configures →

About the project

Cognee is an AI memory platform that stores information in a self-hosted knowledge graph so agents can retain context across sessions. It ingests data, connects related information, and helps agents retrieve it for reasoning and actions. The catalogue includes skills and instructions that extend agent workflows around Cognee.

topoteretes/cognee · 33,094 stars · on GitHub · cognee.ai

Reuse

Borrowing it

Nothing to install: this file belongs to topoteretes/cognee. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/topoteretes/cognee/main/.agents/skills/cognee-migrations/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/topoteretes/cognee

Made for: Claude Code, Codex.

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 cognee-migrations

README.md
[![agentmods](https://agentmods.dev/badge/skills/topoteretes/cognee/cognee-migrations/github.svg)](https://agentmods.dev/skills/topoteretes/cognee/cognee-migrations)
Your own site
<a href="https://agentmods.dev/skills/topoteretes/cognee/cognee-migrations"><img src="https://agentmods.dev/badge/skills/topoteretes/cognee/cognee-migrations/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.

agentmods 80×15 button for cognee-migrations

Your own site · 80×15
<a href="https://agentmods.dev/skills/topoteretes/cognee/cognee-migrations"><img src="https://agentmods.dev/badge/skills/topoteretes/cognee/cognee-migrations.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 82 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,936 The whole file, excluding the scripts and references it only reads on demand.
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.00082 $0.02936
Opus 5.5 $0.00033 $0.01174
Sonnet 5.5 $0.00016 $0.00587
Haiku 4.5 $0.00008 $0.00294

Measured 7d ago against content hash 4639bceaa81e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

cognee-migrations 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.

.agents/skills/cognee-migrations/SKILL.md · 216 lines

How it starts

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

Database migrations

cognee has two migration chains, run together:

Chain Changes Lives in Revision stored in
Relational schema (Alembic) Tables and columns of the relational DB (users, datasets, ACLs, pipeline runs, …) cognee/alembic/ (alembic.ini is in cognee/) alembic_version table
Graph/vector data Cross-store data rewrites (re-keying node ids, adding graph columns) across graph DB, vector DB and relational ledger cognee/modules/migrations/ (registry.py, versions/) Per dataset: dataset_database.migration_revision (access control on). Globally: global_database_version.global_migration_revision (access control off)

Use it

They run by themselves

run_migrations() applies the relational chain first, then the data chain. It runs:

  • at API server startup (and in the Docker entrypoint.sh before gunicorn);
  • on the first write in an SDK or CLI process (remember, add, cognify, improve, memory imports), once per process;
  • when you call await cognee.run_migrations().

A fresh database is built by running the whole chain (no stamping). At head, the first run in each process still does a no-op Alembic upgrade plus a scan of the per-database revision rows; later calls in the same process are skipped by an in-memory flag. ENABLE_AUTO_MIGRATIONS=false turns off all automatic runs; then run cognee-cli upgrade yourself.

Concurrent processes are serialized by a migration lock: a Postgres advisory lock (works across hosts) or a file lock next to the SQLite DB (one host only).

Check and repair

cognee-cli current                   # stamped revision per database, and the last failure
cognee-cli history                   # the data chain, newest first
cognee-cli upgrade                   # relational to head, then data chain to head
cognee-cli upgrade <slug>            # data chain up to and including <slug>
cognee-cli upgrade --alembic <rev>   # pin the relational target
cognee-cli downgrade <slug|base> [--dataset UUID ...] [--alembic REV] [--force]
cognee-cli stamp <head|base|slug> [--dataset UUID ...] [--force]

Read the full file on GitHub · 216 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 Changed · +15 lines 4639bceaa81e
  2. 21d ago Changed 6225026a0f2e
  3. 1mo ago First seen · 201 lines · 82 tokens per session scan A 325f8db66dec

Subscribe to this mod's changes

cognee-migrations is a skill published in the GitHub repository topoteretes/cognee (33,094 stars, last pushed today), licensed Apache-2.0. It adds 82 tokens to every session and 2,936 once invoked, about $0.0003 per session on Opus 5.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-09-30.

Related

cognee-migrations compared with skills from other repositories

cognee-migrations next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
cognee-migrationstopoteretes/cogneeSkill33ktodayApache-2.0A82Claude Code, Codex
omnigraphModernRelay/omnigraphSkill1.9ktodayMITA96Claude Code, Codex
openmemoryCaviraOSS/OpenMemorySkill4.6k19d agoApache-2.0A96Claude Code, Codex
forgetful-cli-setupScottRBK/forgetfulSkill3384d agoMITA84Claude Code
dkg-importerOriginTrail/dkgSkill138yesterdayApache-2.0A87Claude Code, Codex
memgraph-storage-reviewermemgraph/memgraphSkill4.6kyesterdaynoneA56Claude Code, Codex
crystalline-schemajordiboehme/crystallineSkill17todayMPL-2.0A52Claude Code, Codex