ZoFiles: Instructions file for Claude Code

CLAUDE.md

ZoFiles CLAUDE.md is an instructions file for Claude Code from X1AOX1A/ZoFiles. It costs 2,420 tokens per session, scanned A, original, MIT.

A development guide for ZoFiles, a Zotero plugin that mirrors Zotero's research-library folders as directories on your computer. Each paper folder can contain files such as a PDF, Markdown, BibTeX, notes, and review data.

In plain words
What is it for?
Use it when installing, building, running, or changing ZoFiles, especially its event handling, export queue, folder mapping, and per-file content providers.
Why use it?
It gives developers one place to understand how the plugin starts, responds to Zotero changes, builds folder trees, and writes files. This reduces the time needed to navigate an unfamiliar codebase.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: reads .claude/ paths; mentions CLAUDE.md.

This is X1AOX1A/ZoFiles's own configuration. It tells Claude Code how to work on ZoFiles 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 ZoFiles configures →

Reuse

Borrowing it

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

Made for: Claude Code.

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 ZoFiles CLAUDE.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/x1aox1a/zofiles/claude-md.svg)](https://agentmods.dev/instructions/x1aox1a/zofiles/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/x1aox1a/zofiles/claude-md"><img src="https://agentmods.dev/badge/instructions/x1aox1a/zofiles/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 2,420 This file is loaded in full into every session.
When invoked 2,420 The same file — it is already loaded in full.
Security scan A 0 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.02420 $0.02420
Opus 5 $0.01210 $0.01210
Sonnet 5 $0.00484 $0.00484
Haiku 4.5 $0.00242 $0.00242

Measured 8d ago against content hash 05809be05062, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

ZoFiles CLAUDE.md scanned grade A with 0 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 8d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 197 lines

How it starts

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

CLAUDE.md — Development Guide for ZoFiles

Quick Start

npm install
npm run build        # → .scaffold/build/zo-files.xpi
npm start            # dev mode with hot reload

What Is This

ZoFiles is a Zotero 7/8 plugin (TypeScript, esbuild) that mirrors Zotero's collection hierarchy as real filesystem directories, with per-paper folders containing PDF, Markdown, BibTeX, Kimi review, notes, and arXiv ID files.

Built on zotero-plugin-template by windingwind.

Architecture Overview

Zotero.Notifier events
    ↓
notifier.ts (dispatch + filter)
    ↓
exporter.ts (ExportQueue / incrementalRebuild / fullRebuild)
    ↓
tree-builder.ts (collection → directory mapping)
    ↓
content-providers/*.ts (pluggable per-file generators)
    ↓
filesystem (IOUtils / PathUtils)

Data Flow

  1. Notifier (notifier.ts) listens to item, collection, collection-item events
  2. Exporter (exporter.ts) orchestrates: resolves paths via tree-builder, runs providers, manages index
  3. Tree Builder (tree-builder.ts) maps Zotero collection hierarchy → filesystem directory tree
    • Each CollectionNode has itemIds (direct items) and allItemIds (direct + all descendant items)
    • Allin/ directory: created when a collection has subcollections and allItemIds.length > 0. Contains every paper from the collection and all its descendants — a flat view of the entire subtree. This means even if the parent collection has no direct items, Allin/ is still created as long as subcollections have papers.
  4. Content Providers (content-providers/*.ts) generate individual files (PDF, Markdown, etc.)
  5. Index (.zofiles-index.json) tracks exported items, paths, and files for incremental operations

Key Files

File Purpose When to touch
src/modules/exporter.ts Core export logic, queue, rebuild, index management Export behavior, path resolution, cleanup
src/modules/notifier.ts Event dispatch, progress notifications Adding new event handlers
src/modules/tree-builder.ts Collection → directory mapping, Allin/ logic Changing how collections map to folders
src/modules/preferences.ts Settings panel wiring, rebuild buttons Adding new preferences
src/modules/content-providers/ Pluggable content generators Adding new export file types
src/modules/arxiv-id.ts arXiv ID extraction from multiple fields Changing paper identification
src/modules/utils.ts ensureDir, joinPath, removeDir, formatPaperFolder, getCachePath Filesystem operations
src/hooks.ts Plugin lifecycle (startup, shutdown, window load) Init/cleanup logic
addon/prefs.js Default preference values Adding new settings
addon/content/preferences.xhtml Settings panel UI (XUL/XHTML) Settings UI changes
addon/locale/{en-US,zh-CN}/preferences.ftl Localization strings Any user-facing text

Read the full file on GitHub · 197 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. 8d ago First seen · 197 lines · 2,420 tokens per session scan A 05809be05062

Subscribe to this mod's changes

ZoFiles CLAUDE.md is an instructions file published in the GitHub repository X1AOX1A/ZoFiles (30 stars, last pushed 3mo ago), licensed MIT. It adds 2,420 tokens to every session, about $0.0121 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

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

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

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