speclens: Instructions file for Claude Code

CLAUDE.md

speclens CLAUDE.md is an instructions file for Claude Code from dansreis/speclens. It costs 3,978 tokens per session, scanned A, original, Apache-2.0.

Project instructions for SpecLens, a desktop app built with Tauri and React that reads OpenSpec projects from local folders. OpenSpec is a file convention using documents such as proposals, task lists, and capability specifications.

In plain words
What is it for?
Use them when changing SpecLens’s interface, state management, local project loading, settings persistence, or markdown display while following its approved technology choices.
Why use it?
They prevent contributors from choosing incompatible technologies or misunderstanding how the app stores repositories and settings. They also clarify that the app works with local folders rather than GitHub.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Claude Code.

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

Reuse

Borrowing it

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

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/dansreis/speclens/claude-md.svg)](https://agentmods.dev/instructions/dansreis/speclens/claude-md)
Your own site
<a href="https://agentmods.dev/instructions/dansreis/speclens/claude-md"><img src="https://agentmods.dev/badge/instructions/dansreis/speclens/claude-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,978 This file is loaded in full into every session.
When invoked 3,978 The same file — it is already loaded in full.
Security scan A 0 findings. 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.1 $0.03978 $0.03978
Opus 5 $0.01989 $0.01989
Sonnet 5 $0.00796 $0.00796
Haiku 4.5 $0.00398 $0.00398

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

Security

Grade A, and why

speclens 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 6d 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 · 134 lines

How it starts

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

CLAUDE.md

Context for working on SpecLens with Claude Code. Read this before making changes.

What it is

Desktop reader (Tauri 2 + React 19) for OpenSpec - the markdown convention with proposal.md / tasks.md / specs/<capability>/spec.md inside <repo>/openspec/changes/<change-slug>/. Archived changes live under changes/archive/.

Reads OpenSpec projects from local folders at runtime via a Tauri command. Users add folders themselves via "Add repository" in the sidebar; the list is persisted. The app starts empty and users point it at whatever they want. GitHub integration is explicitly off the roadmap - see the no-GitHub direction memory.

Stack decisions

  • MUI + Emotion. Confirmed UI stack. Don't add Tailwind.
  • Zustand + SQLite write-through (not persist middleware). useAppStore holds UI state (theme, sidebar collapse, selected repo/change/tab, scroll target, markdownZoom, highlightEars, session-only panel state) plus repoSources: { path, missing }[] (the user-added folder list - paths persist, missing resets to false on cold start) plus settings: AppSettings. Persistence is done manually in src/store/bootstrap.ts: bootstrap() hydrates from SQLite on start, then attachWriteThrough() subscribes to each persisted slice and writes it back (UI keys → kv_state, sources → repo_sources). The loaded repos: Repo[] is not persisted - reloadAllSources() re-walks each path on mount. useCommentsStore persists via SQLite (comments table). useAiStore holds AI generation state + session summary caches.
  • Settings. AppSettings + DEFAULT_SETTINGS + HIGHLIGHT_COLORS + sanitizeSettings() live in useAppStore.ts; the whole object persists as one "settings" kv blob. Mutate via setSetting(key, value) / resetSettings(). The dialog is in src/sidebar/SidebarFooter.tsx (General / Reading / AI tabs). To add a setting: extend the type + defaults, add a validated branch in sanitizeSettings, read s.settings.<key> at the consumer, add a control to the dialog - no new subscription needed.
  • Tauri load_repo(path) command in src-tauri/src/lib.rs loads one project: walks its openspec/ subtree, reads markdown + yaml, and (when a .git/ exists at the project root or its immediate parent - see find_git_root) derives DocAuthorship per file via the git2 crate (vendored libgit2 - no git binary needed). Authorship comes from one history walk for all files (collect_file_histories) - see "Authorship pipeline". The git-root walk is intentionally capped at one level up so that loading a folder from inside an unrelated git checkout (e.g. somewhere under ~) doesn't pull authorship from that repo. JS calls the command once per source and catches per-source errors to mark missing: true. Git is optional - when absent, Change.authorship, createdAt, and archivedAt are null and the UI degrades gracefully.
  • Per-repo cold-start cache. Each load_repo response includes a signature (git: HEAD-sha + scoped porcelain status hash; non-git: hash of openspec/ file mtimes). The fast Tauri command repo_signature(path) returns the signature alone (no file reads). On cold start, reloadAllSources fetches the signature first; if it matches the cached entry in SQLite (repo_cache table, keyed by path), the saved Repo is used as-is - no walking, no git log. Mismatch → full reload + cache overwrite. See src/lib/repoCache.ts (thin wrapper over src/lib/db.ts). Dates in cached entries get revived (JSON round-trip loses the Date type). useRepoSyncWatcher polls the selected repo's signature (15s + window focus) and only marks it stale - reload is always user-initiated.
  • Local AI (src-tauri/src/ai.rs). On-device summaries via llama.cpp (Metal) or an Ollama backend, exposed as ai_* commands. Nothing downloads or runs until the user fetches a model, so the no-network promise holds. Prompts are built on the JS side (src/lib/aiSummary.ts, aiDocSummary.ts - pure, unit-tested); Rust just receives the final string.
  • Spec checks (deterministic lint, labelled Beta). src/lib/specChecks.ts is the engine (structural SL00x errors, consistency SL01x warnings, language SL02x checks) covering active change deltas + canonical specs/<cap>/spec.md; src/lib/specChecksConfig.ts is the registry - ids, severities, titles, message templates, and word lists all live there, the engine holds only detection logic. Both modules must stay pure (no Tauri imports) so the lint core can be extracted into a CLI later (see docs/design/checks-and-claims.md). Surfaced as: a Checks navigation view (two-level tree, by change or by check), a drag-resizable right panel that scopes to the open change/spec and hides on non-checkable views, in-document wavy underlines with hover diagnostics, list badges, and a ChangeViewer banner for findings with no text anchor. All UI reads results through src/specs/useSpecChecks.ts (useSpecCheckResults) - never call runSpecChecks from a component directly, the hook owns the settings wiring (specChecks, default on; specChecksIncludeArchived, default off).
  • One right panel at a time. Comments, spec checks, and the AI summary are mutually exclusive: an arbiter effect in App.tsx closes the other two on any panel's closed→open transition (last opened wins). Panel open state stays where it always lived (App / useAppStore / useAiStore).
  • @tauri-apps/plugin-dialog powers the "Add repository" folder picker (capability dialog:default).
  • No i18n - deferred. Tests: Vitest covers the pure src/lib helpers (*.test.ts co-located); cargo test covers the git2 authorship/signature layer (temp repos built with git2, no git binary). UI is untested. See docs/ROADMAP.md.

Read the full file on GitHub · 134 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. 6d ago First seen · 134 lines · 3,978 tokens per session scan A fb0cd4cf118c

Subscribe to this mod's changes

speclens CLAUDE.md is an instructions file published in the GitHub repository dansreis/speclens (24 stars, last pushed 13d ago), licensed Apache-2.0. It adds 3,978 tokens to every session, about $0.0199 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,182 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