ctx

Build curated markdown context files from tagged notes.

Scans a directory of markdown files with YAML frontmatter, filters by tags, and produces a single merged context file — ideal for feeding to AI assistants.

$ npm install -g @nbaglivo/ctx
$ npx @nbaglivo/ctx --tag <tag>

how it works

  1. 01

    Tag your markdown notes with YAML frontmatter

    notes/auth-design.md
    ---
    tags: [project-x, auth]
    ---
    
    # Auth Design
    
    We're using JWT with a 15-minute expiry...
  2. 02

    Run ctx with a tag filter

    $ ctx --tag project-x --output .claude-context.md
      ✓ Scanned 24 files
      ✓ Matched 6 notes tagged [project-x]
      → .claude-context.md written (4.2kb)
  3. 03

    Feed the merged file to Claude

    $ claude --system-prompt-file .claude-context.md

example

Two notes tagged project-x:

notes/auth-design.md
---
tags: [project-x, auth]
---

JWT, 15min expiry.
Refresh via httpOnly cookie.
notes/db-schema.md
---
tags: [project-x, db]
---

Postgres. Users table
has uuid primary key.
ctx --tag project-x --output .claude-context.md
.claude-context.md — merged output
<!-- source: notes/auth-design.md -->
JWT, 15min expiry.
Refresh via httpOnly cookie.

<!-- source: notes/db-schema.md -->
Postgres. Users table has uuid primary key.