ccRecall: Instructions file for Claude Code

CLAUDE.md

ccRecall CLAUDE.md is an instructions file for Claude Code from tznthou/ccRecall. It costs 1,118 tokens per session, scanned A, original, Apache-2.0.

A Claude Code instruction file describing ccRecall, a local service that remembers relevant parts of earlier coding sessions. It stores searchable session information in a local SQLite database and exposes a localhost HTTP service.

In plain words
What is it for?
Use it to guide development of ccRecall, including its Node.js and TypeScript commands, tests, linting, build, and start procedures.
Why use it?
It tells agents how to continue work safely, including where to find previous-session context and how to keep tests isolated from real user data.

Instructions file for Claude Code

Written for Claude Code: SessionStart hook event. Also seen: reads .claude/ paths; mentions Claude Code.

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

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /Users/tznthou/Documents/ccRwind/.

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/tznthou/ccrecall/claude-md"><img src="https://agentmods.dev/badge/instructions/tznthou/ccrecall/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 1,118 This file is loaded in full into every session.
When invoked 1,118 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.01118 $0.01118
Opus 5.5 $0.00447 $0.00447
Sonnet 5.5 $0.00224 $0.00224
Haiku 4.5 $0.00112 $0.00112

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

Security

Grade A, and why

ccRecall 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 5d 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 · 82 lines

How it starts

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

ccRecall — AI Memory Service for Claude Code

ccRewind 的姐妹作。ccRewind 做「考古」(事後看 session 發生了什麼),ccRecall 做「記憶」(讓 AI 在未來 session 中自動記住過去的經驗)。

定位

本地背景服務,讀取 Claude Code 對話歷史,讓 AI 在未來 session 中按需記憶——不全部載入,只注入最相關的片段(<300 tokens)。

核心模組從 ccRewind 抽取(parser, scanner, summarizer, database, indexer),新增記憶層、HTTP API、元認知索引。

指令

  • dev: pnpm dev
  • build: pnpm build
  • test: pnpm vitest run
  • lint: pnpm eslint . --fix
  • start: pnpm start

技術約束

  • Runtime: Node.js + TypeScript
  • DB: better-sqlite3 + FTS5(同步 API,零外部依賴)
  • HTTP: 輕量 HTTP server(localhost only)
  • 摘要引擎: 規則式(零 API 成本),不依賴 LLM
  • 純唯讀應用——絕對不修改 ~/.claude/ 下的任何檔案
  • JSONL parser 採寬容模式:未知結構保留 raw JSON,不中斷解析
  • 不用 Docker、不用 Electron、不用向量資料庫

架構

三條讀取路徑 + 一條寫入路徑,共用同一個 SQLite 檔(MCP 走 WAL 直接開檔,不經 HTTP)。

讀(注入)
  SessionStart hook      ──HTTP──→ /memory/startup  ┐
  UserPromptSubmit hook  ──HTTP──→ /memory/prompt   ├─→ ccRecall daemon :7749 ─┐
  MCP recall_query/context ─────── WAL 直接開檔 ─────────────────────────────┐ │
                                                                            ↓ ↓
寫(產生記憶)                                            SQLite + FTS5 ├── memories
  ccrecall-extract wrapper → claude -p → MCP recall_save ──→            ├── memory_topics
  手動 recall_save ────────────────────────────────→                    ├── knowledge_map
                                                                        ├── injection_log
索引(唯讀來源)                                                        └── sessions/messages
  ~/.claude/**/*.jsonl → watcher → scanner → parser → summarizer → indexer ↑

⚠️ 摘要引擎(summarizer)是規則式零成本,但記憶抽取(extraction)走 LLM(claude -p, 模型與 effort 以 scripts/post-session-extract.sh 為準)——兩件事,別混為一談。SessionEnd hook 只標記結束,不抽取;抽取只在 ccrecall-extract(zsh alias ccdm)收尾時跑。

測試誠信

  • 測試紅了先修程式,禁止為通過測試而改斷言
  • 先寫測試、後寫實作
  • 測試不碰生產資料:使用 mkdtemp 隔離,不操作真實 ~/.claude/

相關專案

  • ccRewind: /Users/tznthou/Documents/ccRwind/(考古 GUI,核心模組來源)

參考文件(需要時再讀)

  • 架構設計: .claude/pi-research/ccrewind-memory-service-architecture.md
  • AI 記憶全景: .claude/pi-research/ai-memory-systems-landscape.md
  • 元認知設計: .claude/pi-research/ai-long-term-memory-design.md
  • Obsidian 記憶研究: .claude/pi-research/obsidian-ai-deep-memory.md
  • Hooks 注入可行性: .claude/pi-research/hooks-context-injection-feasibility.md
  • LLM Wiki 範式分析: .claude/pi-research/llm-wiki-karpathy-analysis.md

Read the full file on GitHub · 82 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. 5d ago Changed · -9 lines · -105 tokens per session d520f72ed035
  2. 1mo ago Changed · +16 lines · +275 tokens per session ae43b6f6a95e
  3. 1mo ago First seen · 75 lines · 948 tokens per session scan A 93b5c6aaad70

Subscribe to this mod's changes

ccRecall CLAUDE.md is an instructions file published in the GitHub repository tznthou/ccRecall (1 stars, last pushed 3d ago), licensed Apache-2.0. It adds 1,118 tokens to every session, about $0.0045 per session on Opus 5.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-31.

Related

Other instructions, from other repositories

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 · 9,649 tokens

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,384 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, cache eligibility and rollout and applying the notice (cutover).

microsoft/vscode · 5,262 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,680 tokens

vscode copilot-instructions.md

Copilot instructions for microsoft/vscode, covering vs code copilot instructions, project overview, root folders, core architecture (src/ folder) and built-in extensions (extensions/ folder).

microsoft/vscode · 2,731 tokens

deno copilot-instructions.md

Copilot instructions for denoland/deno, covering deno development guide for github copilot, network access, high level overview, key directories and key files to understand first.

denoland/deno · 3,077 tokens