Skip to content

Instantly share code, notes, and snippets.

@possibilities
Created March 19, 2026 23:45
Show Gist options
  • Select an option

  • Save possibilities/73da76528aae7fdf7f2f1c00bec50784 to your computer and use it in GitHub Desktop.

Select an option

Save possibilities/73da76528aae7fdf7f2f1c00bec50784 to your computer and use it in GitHub Desktop.
Plan: Ingest Claude Session Markdown into qmd on Artbird

Ingest Claude Session Markdown into qmd on Artbird

Context

On greybird, claudectl sync-sessions chunks session markdown, embeds it via vectorctl, and stores in ChromaDB for semantic search. Separately, claudectl mirror-sessions renders sessions to ~/code/content/sessions/ as plain markdown files. Two other content directories (content/links, content/topics) already sync to artbird via Syncthing and get indexed by qmd. Sessions are the missing piece — the markdown exists, it just isn't syncing or indexed.

Plan

Step 1: Create qmd.yaml in sessions directory

File: ~/code/content/sessions/qmd.yaml

name: content-sessions
description: Claude Code session transcripts and agent conversations organized by project
multi: true

multi: true makes each project subdirectory (e.g. -Users-mike-code-arthack) its own qmd collection (content-sessions:-Users-mike-code-arthack). Follows the exact pattern of content-topics/qmd.yaml. ~140 project dirs become ~140 collections — same scale as content-topics (64 subtopics).

Step 2: Create .stignore to exclude junk

File: ~/code/content/sessions/.stignore

-private-var*
-private-tmp*

Excludes ~22 pytest temp directories with long names and negligible content.

Step 3: Add Syncthing folder via config-driven sync

Config: ~/.config/watchctl/folders.yaml (stowed from system/watchctl/)

folders:
  - id: arthack
    path: ~/code/arthack
    type: sendonly
    devices: [artbird]
  - id: content-links
    path: ~/code/content/links
    type: sendonly
    devices: [artbird]
  - id: content-topics
    path: ~/code/content/topics
    type: sendonly
    devices: [artbird]
  - id: content-sessions
    path: ~/code/content/sessions
    type: sendonly
    devices: [artbird]

New subcommand: watchctl sync-folders reads this config, resolves device names to IDs via Syncthing REST API, and ensures all folders exist. Called from scripts/install.sh with fingerprinting.

Library additions: cli_common/syncthing.py gains REST API functions: get_local_device_id(), resolve_device_names(), list_folders_api(), add_folder(), update_folder().

Step 4: Fix new-subdirectory detection gap

File: apps/qmdctl/qmdctl/run_watch_collections.py

watch-collections now re-resolves multi collections on every reindex cycle (not just when qmd.yaml changes), so new project subdirectories from mirror-sessions get registered automatically. The old rescan_event / needs_rescan conditional branch is removed.

Verification

  1. After creating qmd.yaml + .stignore, verify locally: ls ~/code/content/sessions/qmd.yaml
  2. Run watchctl sync-folders — should show content-sessions as added/unchanged
  3. On artbird, accept the folder in Syncthing and verify: ssh artbird ls /home/artbird/collections/content-sessions/qmd.yaml
  4. Check qmdctl watcher logs on artbird: journalctl --user -u qmdctl-watch-collections -f — should show new collections being registered
  5. After indexing, search: qmd search "some query" --collection content-sessions:-Users-mike-code-arthack

Files modified

  • ~/code/content/sessions/qmd.yamlnew (collection config)
  • ~/code/content/sessions/.stignorenew (Syncthing ignore)
  • apps/qmdctl/qmdctl/run_watch_collections.pyedit (always re-resolve multi collections)
  • system/watchctl/.config/watchctl/folders.yamlnew (Syncthing folder config)
  • apps/watchctl/watchctl/config_schema.pyedit (add SyncthingFoldersConfig model)
  • apps/watchctl/watchctl/run_sync_folders.pynew (sync-folders subcommand)
  • apps/watchctl/watchctl/cli.pyedit (register sync-folders, update AGENT_HELP)
  • apps/cli_common/cli_common/syncthing.pyedit (REST API folder management functions)
  • scripts/install.shedit (fingerprinted watchctl sync-folders call)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment