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.
curl -O https://raw.githubusercontent.com/dasein108/yt-mem-ai/main/CLAUDE.mdgit clone --depth 1 https://github.com/dasein108/yt-mem-aiWrote 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.
[](https://agentmods.dev/instructions/dasein108/yt-mem-ai/claude-md)<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.
<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>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.
| Model | Per session | Once 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 |
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** 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—.envloading (Config). Secrets only from.env(gitignored).use_webshare(YT_USE_WEBSHARE, default off) gates the Webshare proxy;discover_feed_limit/discover_overlap_stune incremental discovery.load_configprecedence 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.envvariables, poweringyt-ai config {list,get,set,unset,path}and the MCPconfig_*tools (so an agent/user can set Webshare creds, swap the embedding model, etc. from chat).KNOWNregistry covers the.env.examplevariables plus a couple of desktop-backend knobs (validates keys + choices, masks secrets);set_settingwrites 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 thesource="backend"shorthand used acrosscli.py. Writes one JSON line ({ts, source, level, event, msg, ...ctx}) toConfig.log_file(YT_LOG_FILEenv, defaultlogs/common.jsonl; gitignored).proxy.py/cookies.py— Webshare rotating proxy + Chrome cookies for yt-dlp. Bothytdlp_proxy_urlandwebshare_configreturnNoneunlesscfg.use_webshareand 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; usesprocess=Falseso 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") toSignInRequiredsocli.fetchcan print theconfig set YT_COOKIES_BROWSER <browser>fix (exit 4) instead of a traceback.transcript/—captions.py(youtube-transcript-api) →whisper.py(faster-whisper) fallback, orchestrated byget_transcript.fetch_captionstriescfg.caption_langs(YT_CAPTION_LANGS, defaulten) 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 intranscripts.lang(exposed astranscript_langinshow --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), injectableextract_fnseam. Flat feed pull is capped (playlistend=discover_feed_limit) and stamped with approximate per-entrytimestampviayoutubetab:approximate_date— dates in one call, no per-video N+1. Cutoff is epoch-based:after_ts(incremental high-water) beatsafter(YYYY-MM-DD), minusoverlap_s; newest-first with an early break.Video.published_ts(epoch, not persisted — absent fromVideoSchema) carries the high-water back torun_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_videosenumerates a channel's recent uploads (reuses discovery's flat-extract), date-filtered then capped to--limit; theytskill's "group" scenario uses it to ingest + review an arbitrary set →groups/<label>.md. The underlying fetch is bounded byYT_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_reembedrebuilds thechunkstable with the currentbuild_embedder(cfg)(viastore.rebuild_chunks), migrating the library to a new embedding model without re-fetching.memory.py— status-basedis_seen/mark_status.recommend.py— taste-centroid ranking over chunk embeddings (like − dislike).compile.py—compile_highlightsbuilds a deep-linked highlights doc from summarized videos'summaries.highlights+chunksspans (chunk_spansnaps each highlight to its containing/nearest chunk, falling back to a fixed window), newest-video-first and budget-bounded by--max-minutes(accumulate).render_markdownemitswatch?v=ID&t=<start>slinks per clip; no media rendering here.supercut.py— renderscompile_highlights' clip selection as an actual video reel instead of a doc: pure command-builders (download_section_opts— 720pdownload_range_funcsection +build_optsproxy/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 orchestratorbuild_supercut(db, since, max_minutes, out_path, cfg=, workdir=, download_fn=, ffmpeg_fn=), which takes injectabledownload_fn/ffmpeg_fnso the whole flow is unit-tested offline, and continues past a clip whose download/render fails (recorded in the.refs.mdsidecar'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 (reusingsupercut's_FORMAT+download_range_func) and extracts the first frame via ffmpeg.parse_timestampaccepts seconds orH:M:S. Injectable seams keep it offline-testable; real yt-dlp/ffmpeg is manual smoke.cli.py— Typer app; thinrun_*cores are the testable seam.fetch --captions-onlyruns the metadata+captions path (no audio/whisper).run_discoveris incremental: cutoff precedence is explicit--after> stored epochlast_discover_ts(−overlap_s) > legacylast_discover_atdate > 7-day default; it dropsis_seenvideos and advanceslast_discover_ts(never regressing) from the discoveredpublished_ts.mcp_server.py—FastMCPserver (yt-ai-mcpconsole 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 matchingrun_*core, returning JSON-safe dicts (no business logic here). Theyt/yt-agentscenarios ship as@mcp.prompt()s whose bodies are loaded from the checked-in SKILL.md files (_load_skill: sourceskills/<name>/SKILL.md, or theforce-includedyt_mem_ai/_skills/*.mdin a built wheel) — single source of truth, no drift. Host packaging lives underintegrations/(see below).integrations/— host packaging. Native skills (symlinked, never copied, from the canonicalskills/) drive theyt-aiCLI viauvx 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/pluginsis 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) andclaude-desktop/covers the scriptable path, aclaude_desktop_config.jsonMCP entry (the.mcpbbundle was dropped as fussy). MCP (yt-ai-mcp) is an optional typed-tool surface on any host;mcp/documents it, and the server ships aninstructionsstring so MCP-only hosts still know the workflow. Any MCP install uses a persistent, absolute-pathyt-ai-mcpbinary (uv tool install 'yt-mem-ai[mcp]') so GUI hosts start it instantly. One installer at the repo root —install.sh(+install.ps1), self-contained, no helper files, socurl … | shworks: a two-step wizard (step 1 = single choice plugin|mcp, step 2 = host checkboxes; menu rows are ASCII and truncated totput colswith a per-line\033[2K, since a wrapped row desynced the cursor-up redraw) over the five hosts, keyed bymethod:hostpairs. Install detection is exact — anmcpServerskey lookup (json_has_server, recursing into Claude Code's project-scoped maps) and"yt-mem-ai@yt-mem-ai"insettings.json, because a loose name grep matchedgithubRepoPathsand made MCP look installed after a plugin install;claude mcp add/removeuse-s userso the server is global, not bound to the cwd the installer ran in.pluginalso runsuv tool install yt-mem-ai(the CLI the skills shell out to);mcprunsuv 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 brightwarnboxwith 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 viaopenclaw mcp addoropenclaw.json'smcp.servers— note the non-standard shape) and Hermes (skills~/.hermes/skills, MCP in~/.hermes/config.yaml'smcp_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 … | shwith 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 byYT_INSTALL_REEXEC;YT_INSTALL_RAW_ROOToverrides 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.mdis the paste-into-any-agent installer;skills/README.mddocuments installing/pasting the skills by hand.
- MCP
- REST API — moved out to the
yt-mem-ai-desktoprepo (FastAPI backend that imports this package and reusescli.py'srun_*/open_storecores). This repo is the engine: library + data/pipeline CLI only. frontend/— moved out to the standalone repoyt-mem-ai-desktop(React+TS desktop UI + Electron wrapper). It consumes this engine as a Python package (its FastAPI backend importsyt_mem_ai's CLI cores directly) and the packaged app bundles the engine. This repo is the engine: library + CLI + skills, published to PyPI asyt-mem-ai.
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.
- 10d ago First seen · 248 lines · 4,462 tokens per session scan D 59ea5dc4a25a
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.
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.
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.
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).
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.
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).
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.