Skip to content

/genesis

Initialize cortex vault — set up config, vault structure, and rebuild index

From plugin
cortexes
256 skills6 commands2 hooks
> /plugin marketplace add XBlueSky/cortexes
> /plugin install cortexes@cortex

Command definition

genesis.md
name: genesis
description: Initialize cortex vault — set up config, vault structure, and rebuild index
argument-hint: "[vault path, e.g. /srv/cortex or ~/cortex]"
allowed-tools:
  - Read
  - Write
  - Edit
  - Bash
  - Glob
  - Grep
  - AskUserQuestion

Initialize or reconfigure the cortex memory vault. Run once per machine, or again after switching machines to rebuild local state.

Steps

1. Check the cortex-vec CLI

Run `command -v cortex-vec`. If it is not on PATH, tell the user the vault's indexing and search need the CLI, and offer to install it now:

# Recommended: isolated tool install via uv
uv tool install cortex-vec

# Or with pip
pip install cortex-vec

If they decline, continue anyway — recording and the skills degrade gracefully — but note that semantic indexing and `cortex-vec` search stay unavailable until it is installed.

2. Check for existing config

Read `~/.cortex/config.json`. If it exists, show current config and ask if the user wants to reconfigure or abort.

3. Ask for vault path

If the user provided an argument, use that as the vault path. Otherwise, ask: "Where is the cortex vault? (e.g. /srv/cortex, ~/cortex)"

If the path exists and contains Notes/ or Projects/ or Raw/, recognize it as an existing vault. If the path doesn't exist, ask if they want to create it.

4. Ask for author info

Ask for:

  • Author name (for git commits)
  • Author email (for git commits)

5. Write config

Create `~/.cortex/` directory if needed, then write `~/.cortex/config.json`:

{
  "vault_path": "<user's answer>",
  "author": "<name>",
  "author_email": "<email>",
  "git": {
    "auto_commit": true,
    "auto_push": false,
    "commit_trailer": ""
  }
}

`git.commit_trailer` (string, optional, defaults to `""`): when non-empty, the distill and evolve skills append it as the last line of their commit messages, for git hosting setups that expect a specific trailer. Only those two commits, the ones that add new Notes / Projects pages, carry it; raw and broadcast commits do not.

The raw commit is also path-scoped (`git commit -- <paths>`: the Raw just written plus any snapshot reclaim removed), so it never carries what another session has staged in the shared vault index — a new page with a non-ASCII name, committed without the trailer, is exactly what a hosting secrets hook chokes on.

6. Initialize vault structure

Ensure these directories exist in the vault:

  • `Raw/`
  • `Notes/`
  • `Projects/`

Those three are the whole taxonomy. Do **not** create `Weekly/` — it is no longer a Cortexes content type. If an existing vault already has a `Weekly/` directory, leave it and its files exactly where they are: never move, rewrite, or delete them. Tell the user it is no longer created, indexed, or searched, and that anything still worth keeping should be moved into `Notes/` or `Projects/` by hand, at their own pace.

Ensure `log.md` exists at the vault root. If missing, create it with:

---
created: <today>
---

# Cortex Log

Append-only record of vault operations (distill, evolve).

---
````

The file is append-only; do not overwrite if it exists.

### 7. Initialize git

If the vault is not a git repo, run `git init` and create an initial commit.

### 8. Rebuild _index.md

Scan every page under `Notes/<topic>/` and `Projects/<repo>/`, skipping any path
containing `_archive`. For each page extract the title, the tags from
frontmatter, and a one-line summary.

`Raw/` is deliberately NOT indexed — it is chronological and navigated by date,
so an index table would only duplicate the directory listing. A leftover
`Weekly/` is not indexed either, and is not listed in `_index.md`.

Write `<vault_path>/_index.md`. Both top-level sections group their rows into
`###` sub-sections — by topic under Notes, by repo under Projects — so the
index mirrors the on-disk layout:

```markdown
---
updated: <today>
---

# Cortex Index

## Projects

### <repo-name>

| Project | Tags | Summary |
|---------|------|---------|
| [[topic-title]] | tags | summary |

## Notes

### <topic>

| Note | Tags | Summary |
|------|------|---------|
| [[note-title]] | tags | summary |

Do NOT add an `entries:` count to the frontmatter. It is a derived value with no reader, and a hand-maintained copy of it drifts the moment a page is merged away or renamed. `cortex-vec status` reports the live count instead.

Legacy `Projects/<repo>/_index.md` files are not index rows — skip them. To check an existing index against the files on disk (and for the regex traps that make a naive check silently wrong), see `docs/index-audit.md`.

9. Show summary

Display:

✓ Cortex vault initialized
  Vault: <path>
  Config: ~/.cortex/config.json
  Author: <name> <email>
  Index: <N> pages in _index.md

  Next steps:
  - Sessions auto-record to Raw/ on exit
  - /cortexes:evolve → save notes or project info
  - /cortexes:distill → refine raw records
  - /cortexes:query → search your vault
Read more
@xbluesky
Ships withcortexes

Personal knowledge vault plugin for Claude Code — session recording, memory distillation, and hybrid semantic + BM25 retrieval.

Stars on GitHub

Momentum

stars in total
25
Star history of XBlueSky/cortexes on GitHub, a chart by star-history.com

Other commands on cortexes.

broadcast
Auto-invoked

broadcast

Command

Run broadcast on a distilled Raw — update related existing pages conversationally

@xbluesky@xblueskyInstall Command
distill
Auto-invoked

distill

Command

Distill raw session records into refined Notes and Projects

@xbluesky@xblueskyInstall Command
evolve
Auto-invoked

evolve

Command

Save knowledge to the cortex vault (Notes or Projects) and update index

@xbluesky@xblueskyInstall Command
query
Auto-invoked

query

Command

Manually search the cortex vault (Notes, Projects, Raw) for existing notes

@xbluesky@xblueskyInstall Command
takeoff
Auto-invoked

takeoff

Command

Create, resume, or clear a session hand-off baton (one per work line)

@xbluesky@xblueskyInstall Command

More commands from other plugins.

analyze-cohorts

analyze-cohorts

Command

Perform cohort analysis on user data — retention curves, feature adoption, and engagement trends

@phuryn@phurynInstall Command
again

again

Command

PUA Again — 用于再试试、换个方法、别放弃、为什么还不行、同一路径失败多次;要求停止微调同一思路,改用本质不同方案。

pua2mo20k
@tanweai@tanweaiInstall Command