chromectx AGENTS.md

Repository instructions for a TypeScript command-line tool that saves, restores, lists, searches, and analyzes browser tabs.

In plain words
What is it for?
Use them when adding or changing commands, modules, tests, or skills in the chromectx codebase.
Why use it?
They keep changes small and organized by requiring focused commits and a consistent project structure.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/dyingg/chromectx/agents-md
Clone the repo
git clone --depth 1 https://github.com/dyingg/chromectx

Made for: Codex, OpenCode.

Per session 1,866 This file is loaded in full into every session.
When invoked 1,866 The same file — it is already loaded in full.
Security scan A 1 finding. Scan, not verified.
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 $0.01866 $0.01866
Opus 5 $0.00933 $0.00933
Sonnet 5 $0.00373 $0.00373
Haiku 4.5 $0.00187 $0.00187

Measured 2d ago against content hash f8afc9687eb1, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

chromectx AGENTS.md scanned grade A with 1 finding 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 2d 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.

Runs shell commandslowCapability

Expected in a hook, worth knowing in a rule or an instructions file.

- Source code must use `node:` stdlib modules (`node:child_process`, `node:fs/promises`, `node:path`, etc.) for portability. Do **not** use Bun-specific APIs (`Bun.spawn`, `Bun.write`, `Bun.file`, `Bun.Glob`) in producti
AGENTS.md · 97 lines

How it starts

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

Micro-commits

Commit immediately after completing each logical unit of work — do not batch unrelated changes and do not wait to be asked. A "logical unit" is one self-contained change to the codebase: implementing a function, adding a command, writing a test, fixing a bug, wiring up a new module, adding a skill, etc. A unit may touch multiple files if they belong together (e.g. a module + its test, or a skill's directory of files). When in doubt, commit more often rather than less.

Keep commits atomic: commit only the files you touched and list each path explicitly. For tracked files run git commit -m "<scoped message>" -- path/to/file1 path/to/file2. For brand-new files, use the one-liner git restore --staged :/ && git add "path/to/file1" "path/to/file2" && git commit -m "<scoped message>" -- path/to/file1 path/to/file2

Project shape

This repo is a TypeScript codebase (runs on Bun) with one executable surface:

  • chromectx doctor
  • chromectx restore ...
  • chromectx save ...
  • chromectx list ...
  • chromectx search ... — fast title+URL search; --deep fetches full page content
  • chromectx rag ... — RAG search across tabs (JSON output for agents/scripts)
  • chromectx mcp

The MCP server is local-only and uses stdio. Treat the CLI and MCP server as two transports around shared code rather than as separate applications.

Source layout

  • src/bin: executable entrypoints only
  • src/browser: browser-level type definitions (ChromeSession, ChromeTab, etc.) shared across commands, store, and platform
  • src/commands: CLI-facing orchestration — each command is a self-contained module exporting a CommandDefinition (see "Adding a CLI command" below); types.ts defines the shared CommandDefinition, CommandRunContext, and GlobalFlags interfaces; root.ts is the registry + dispatcher — each command is a self-contained module exporting a CommandDefinition (see "Adding a CLI command" below); types.ts defines the shared CommandDefinition, CommandRunContext, and GlobalFlags interfaces; root.ts is the registry + dispatcher
  • src/mcp: MCP protocol handling and tool registration
  • src/platform/macos: macOS-specific integrations and checks
  • src/platform/macos/chrome/: Chrome browser interaction (install detection, session/tab queries, page source retrieval)
  • src/lib: shared support modules such as config, errors, output, logging, concurrent.ts (sliding-window pMap), and http.ts (shared fetchSources with concurrency 15)
  • src/lib/tui/: interactive terminal UI components built on @clack/promptsselect.ts exports selectOne<T>() (and will gain selectMany<T>() later). Use these for any arrow-key selection in CLI commands; inject via deps for testing.
  • src/lib/store/: session persistence — types.ts defines the schema contract (Session, SessionWindow, SessionTab); io.ts handles read/write/list to {AppPaths.sessions}/*.json
  • src/lib/workflows/search/: BM25 search pipeline — preprocess.ts (HTML→markdown via turndown), chunk.ts (paragraph chunking ~500 chars), index.ts (buildIndex + SearchIndex with search and searchWithPages)
  • src/lib/workflows/rag.ts: shared RAG pipeline (executeRag) used by both CLI rag command and MCP rag_search tool

Read the full file on GitHub · 97 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. 2d ago First seen · 97 lines · 1,866 tokens per session scan A f8afc9687eb1

Subscribe to this mod's changes

chromectx AGENTS.md is an instructions file published in the GitHub repository dyingg/chromectx (4 stars, last pushed 5mo ago), licensed MIT. It adds 1,866 tokens to every session, about $0.0093 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.