yt-mem-ai: Instructions file for Claude Code

CLAUDE.md

yt-mem-ai CLAUDE.md is an instructions file for Claude Code, Codex from dasein108/yt-mem-ai. It costs 4,462 tokens per session, scanned D, original, MIT.

Repository instructions for yt-mem-ai, a local-first YouTube command-line tool. It downloads audio, transcribes videos, stores searchable chunks in LanceDB, and creates summaries, highlights, and question answers.

In plain words
What is it for?
Use them when working on the CLI, configuration files, transcription and discovery, LanceDB storage, embeddings, summaries, or the MCP server.
Why use it?
They explain the project's architecture and conventions so changes preserve its local storage, configuration, transcription, and AI workflows.

Instructions file for Claude CodeCodex

Written for Claude Code and Codex: Claude Code plugin machinery, but also reads ~/.codex or $CODEX_HOME. Also seen: reads .claude/ paths; mentions CLAUDE.md; mentions Claude Code.

This is dasein108/yt-mem-ai's own configuration. It tells Claude Code and Codex how to work on yt-mem-ai 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 yt-mem-ai configures →

Reuse

Borrowing it

Nothing to install: this file belongs to dasein108/yt-mem-ai. 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/dasein108/yt-mem-ai/main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/dasein108/yt-mem-ai

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 yt-mem-ai CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/dasein108/yt-mem-ai/claude-md/github.svg)](https://agentmods.dev/instructions/dasein108/yt-mem-ai/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/dasein108/yt-mem-ai/claude-md"><img src="https://agentmods.dev/badge/instructions/dasein108/yt-mem-ai/claude-md/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 yt-mem-ai CLAUDE.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/dasein108/yt-mem-ai/claude-md"><img src="https://agentmods.dev/badge/instructions/dasein108/yt-mem-ai/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 4,462 This file is loaded in full into every session.
When invoked 4,462 The same file — it is already loaded in full.
Security scan D 3 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.04462 $0.04462
Opus 5 $0.02231 $0.02231
Sonnet 5 $0.00892 $0.00892
Haiku 4.5 $0.00446 $0.00446

Measured 10d ago against content hash 59ea5dc4a25a, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade D, and why

yt-mem-ai CLAUDE.md scanned grade D with 3 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 10d 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.

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

self-contained, no helper files, so `curl … | sh` works: a **two-step wizard**

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

MCP `~/.gemini/config/mcp_config.json`). **Claude Desktop plugins are

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

self-contained, no helper files, so `curl … | sh` works: a **two-step wizard**
CLAUDE.md · 248 lines

How it starts

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

CLAUDE.md — yt-mem-ai

Guidance for Claude Code (and any LLM) working in this repo.

What this is

A local-first YouTube AI CLI (yt-ai): download audio, transcribe (captions → faster-whisper fallback), store everything in an embedded LanceDB with per-chunk embeddings, discover subscription uploads, and produce summaries/highlights/Q&A. Heavy IO lives in the CLI; summarization is skills-primary (Claude Code skills, not an API) to keep it free and high-quality.

Architecture (module map)

  • config.py.env loading (Config). Secrets only from .env (gitignored). use_webshare (YT_USE_WEBSHARE, default off) gates the Webshare proxy; discover_feed_limit/discover_overlap_s tune incremental discovery. load_config precedence is global config file < project .env < process env: the global file ($YT_MEM_AI_HOME/config.env, default ~/.yt-mem-ai/config.env) lets settings applied from chat persist for the MCP server no matter its cwd.
  • settings.py — runtime get/set of the .env variables, powering yt-ai config {list,get,set,unset,path} and the MCP config_* tools (so an agent/user can set Webshare creds, swap the embedding model, etc. from chat). KNOWN registry covers the .env.example variables plus a couple of desktop-backend knobs (validates keys + choices, masks secrets); set_setting writes the global config file by default (scope="project"./.env) and flags when a process env var would override the write.
  • obs.py — unified logging. log_event(source, event, level="info", msg="", *, log_file=None, **ctx) never raises (append fails silently); blog(...) is the source="backend" shorthand used across cli.py. Writes one JSON line ({ts, source, level, event, msg, ...ctx}) to Config.log_file (YT_LOG_FILE env, default logs/common.jsonl; gitignored).
  • proxy.py / cookies.py — Webshare rotating proxy + Chrome cookies for yt-dlp. Both ytdlp_proxy_url and webshare_config return None unless cfg.use_webshare and creds are set — so a system-level VLESS/VPN carries traffic by default (stacking Webshare on the authed subscription feed 405s).
  • download.py — yt-dlp download + metadata; build_opts(cfg, download_audio). download_metadata(url, cfg) fetches metadata only (no audio) for the captions-only path; uses process=False so meta survives the missing JS challenge solver (which otherwise fails format selection). Both extract calls go through _extract, which maps YouTube's bot check ("Sign in to confirm you're not a bot") to SignInRequired so cli.fetch can print the config set YT_COOKIES_BROWSER <browser> fix (exit 4) instead of a traceback.
  • transcript/captions.py (youtube-transcript-api) → whisper.py (faster-whisper) fallback, orchestrated by get_transcript. fetch_captions tries cfg.caption_langs (YT_CAPTION_LANGS, default en) then falls back to ANY available track (manual over auto-generated), so non-English videos ingest via the fast captions path; the source language is stored in transcripts.lang (exposed as transcript_lang in show --json). Skills produce artifacts in the video's original language by default (user preference); translate only when a target language is requested.
  • discovery.py — subscription feed extraction (discover), injectable extract_fn seam. Flat feed pull is capped (playlistend=discover_feed_limit) and stamped with approximate per-entry timestamp via youtubetab:approximate_date — dates in one call, no per-video N+1. Cutoff is epoch-based: after_ts (incremental high-water) beats after (YYYY-MM-DD), minus overlap_s; newest-first with an early break. Video.published_ts (epoch, not persisted — absent from VideoSchema) carries the high-water back to run_discover. Per-video date fallback (_published_ts, process=False) only fires for entries lacking an inline timestamp (e.g. live premieres).
  • channel-list (CLI) — channel_videos enumerates a channel's recent uploads (reuses discovery's flat-extract), date-filtered then capped to --limit; the yt skill's "group" scenario uses it to ingest + review an arbitrary set → groups/<label>.md. The underlying fetch is bounded by YT_DISCOVER_FEED_LIMIT (default 60), so --limit/date windows beyond the newest ~60 uploads need it raised.
  • store/models.py (dataclasses + LanceModel schemas + chunk_schema), embeddings.py (build_embedder, chunk_segments), db.py (LanceDB CRUD + search).
  • reembed (CLI) — run_reembed rebuilds the chunks table with the current build_embedder(cfg) (via store.rebuild_chunks), migrating the library to a new embedding model without re-fetching.
  • memory.py — status-based is_seen / mark_status.
  • recommend.py — taste-centroid ranking over chunk embeddings (like − dislike).
  • compile.pycompile_highlights builds a deep-linked highlights doc from summarized videos' summaries.highlights + chunks spans (chunk_span snaps each highlight to its containing/nearest chunk, falling back to a fixed window), newest-video-first and budget-bounded by --max-minutes (accumulate). render_markdown emits watch?v=ID&t=<start>s links per clip; no media rendering here.
  • supercut.py — renders compile_highlights' clip selection as an actual video reel instead of a doc: pure command-builders (download_section_opts — 720p download_range_func section + build_opts proxy/cookies; normalize_label_cmd — scale/pad/fps + drawtext=textfile=<label_file>, which sidesteps drawtext text-escaping entirely; concat_cmd — concat demuxer; label_text/refs_markdown — clip label/sidecar refs text) plus the orchestrator build_supercut(db, since, max_minutes, out_path, cfg=, workdir=, download_fn=, ffmpeg_fn=), which takes injectable download_fn/ffmpeg_fn so the whole flow is unit-tested offline, and continues past a clip whose download/render fails (recorded in the .refs.md sidecar's skipped list) rather than aborting the run. Real rendering (actual yt-dlp downloads + ffmpeg) is manual smoke only, not in the test suite.
  • frame.py — single still-frame grab: grab_frame(db, video_id, at_s, out_path, cfg=, workdir=, download_fn=, ffmpeg_fn=) downloads a 1s 720p section at the timestamp (reusing supercut's _FORMAT + download_range_func) and extracts the first frame via ffmpeg. parse_timestamp accepts seconds or H:M:S. Injectable seams keep it offline-testable; real yt-dlp/ffmpeg is manual smoke.
  • cli.py — Typer app; thin run_* cores are the testable seam. fetch --captions-only runs the metadata+captions path (no audio/whisper). run_discover is incremental: cutoff precedence is explicit --after > stored epoch last_discover_ts (−overlap_s) > legacy last_discover_at date > 7-day default; it drops is_seen videos and advances last_discover_ts (never regressing) from the discovered published_ts.
  • mcp_server.pyFastMCP server (yt-ai-mcp console entry, optional [mcp] extra) exposing the engine to any MCP host. Thin protocol adapter: each @mcp.tool() loads config, opens the store, and calls the matching run_* core, returning JSON-safe dicts (no business logic here). The yt/yt-agent scenarios ship as @mcp.prompt()s whose bodies are loaded from the checked-in SKILL.md files (_load_skill: source skills/<name>/SKILL.md, or the force-included yt_mem_ai/_skills/*.md in a built wheel) — single source of truth, no drift. Host packaging lives under integrations/ (see below).
  • integrations/ — host packaging. Native skills (symlinked, never copied, from the canonical skills/) drive the yt-ai CLI via uvx yt-mem-ai <cmd>: claude-code/ (.claude-plugin/{plugin,marketplace}.json + commands/ + skills/), codex/ (.codex-plugin/plugin.json + skills/ + prompts/ + AGENTS.md; → ~/.codex/skills/), cursor/ (skills/~/.cursor/skills/
    • MCP ~/.cursor/mcp.json), antigravity/ (skills/~/.gemini/skills/ + MCP ~/.gemini/config/mcp_config.json). Claude Desktop plugins are account-side, not on disk~/.claude/plugins is Claude Code's store and Desktop chat does not read it, so no script can install/uninstall a Desktop plugin; the installer prints the in-app steps (Customize → Plugins → add the repo-root marketplace) and claude-desktop/ covers the scriptable path, a claude_desktop_config.json MCP entry (the .mcpb bundle was dropped as fussy). MCP (yt-ai-mcp) is an optional typed-tool surface on any host; mcp/ documents it, and the server ships an instructions string so MCP-only hosts still know the workflow. Any MCP install uses a persistent, absolute-path yt-ai-mcp binary (uv tool install 'yt-mem-ai[mcp]') so GUI hosts start it instantly. One installer at the repo rootinstall.sh (+ install.ps1), self-contained, no helper files, so curl … | sh works: a two-step wizard (step 1 = single choice plugin|mcp, step 2 = host checkboxes; menu rows are ASCII and truncated to tput cols with a per-line \033[2K, since a wrapped row desynced the cursor-up redraw) over the five hosts, keyed by method:host pairs. Install detection is exact — an mcpServers key lookup (json_has_server, recursing into Claude Code's project-scoped maps) and "yt-mem-ai@yt-mem-ai" in settings.json, because a loose name grep matched githubRepoPaths and made MCP look installed after a plugin install; claude mcp add/remove use -s user so the server is global, not bound to the cwd the installer ran in. plugin also runs uv tool install yt-mem-ai (the CLI the skills shell out to); mcp runs uv tool install 'yt-mem-ai[mcp]'. Installed pairs come pre-ticked and unticking removes (diff-based, extra confirm); a method not ticked in step 1 is never touched, and flag runs are additive-only. Anything unautomatable (Desktop plugins, a missing host CLI, a skill fetch that failed) prints a bright warnbox with manual steps. Flags: --plugin --mcp | --claude-code --claude-desktop --codex --cursor --antigravity --openclaw --hermes | --all --all-hosts --all-methods -y --bootstrap. OpenClaw (skills ~/.agents/skills, MCP via openclaw mcp add or openclaw.json's mcp.servers — note the non-standard shape) and Hermes (skills ~/.hermes/skills, MCP in ~/.hermes/config.yaml's mcp_servers:) are hosts 6-7; the Hermes writer splices a fixed YAML block by hand because neither sh nor python3's stdlib can emit YAML. curl … | sh with no flags re-execs itself: stdin is the script text, so it re-downloads a copy to a temp file and runs it with < /dev/tty (guarded by YT_INSTALL_REEXEC; YT_INSTALL_RAW_ROOT overrides the source for tests) — that's what makes the one-line install interactive. No TTY at all (CI, or the refetch failed) falls back to bootstrapping the CLI only. PROMPT.md is the paste-into-any-agent installer; skills/README.md documents installing/pasting the skills by hand.
  • REST API — moved out to the yt-mem-ai-desktop repo (FastAPI backend that imports this package and reuses cli.py's run_*/ open_store cores). This repo is the engine: library + data/pipeline CLI only.
  • frontend/moved out to the standalone repo yt-mem-ai-desktop (React+TS desktop UI + Electron wrapper). It consumes this engine as a Python package (its FastAPI backend imports yt_mem_ai's CLI cores directly) and the packaged app bundles the engine. This repo is the engine: library + CLI + skills, published to PyPI as yt-mem-ai.

Read the full file on GitHub · 248 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. 10d ago First seen · 248 lines · 4,462 tokens per session scan D 59ea5dc4a25a

Subscribe to this mod's changes

yt-mem-ai CLAUDE.md is an instructions file published in the GitHub repository dasein108/yt-mem-ai (7 stars, last pushed 18d ago), licensed MIT. It adds 4,462 tokens to every session, about $0.0223 per session on Opus 5. A static security scan graded it D with 3 findings (downloads and executes remote code, reads agent configuration directories, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

next.js AGENTS.md

AGENTS.md instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,153 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,469 tokens