alluvium: Instructions file for Claude Code

CLAUDE.md

alluvium CLAUDE.md is an instructions file for Claude Code from Tespera/alluvium. It costs 2,410 tokens per session, scanned B, original, Apache-2.0.

A set of Claude Code instructions for Alluvium, a tool that automatically turns coding sessions into organised Obsidian notes.

In plain words
What is it for?
Use it when working on Alluvium features involving session archiving, topic pages, hooks, the knowledge model, or its Rust and Claude Code integration.
Why use it?
It gives the agent the project's rules for storing knowledge and prevents implementations from drifting from its intended design.

Instructions file for Claude Code

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

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

Reuse

Borrowing it

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

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

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

Your own site · 80×15
<a href="https://agentmods.dev/instructions/tespera/alluvium/claude-md"><img src="https://agentmods.dev/badge/instructions/tespera/alluvium/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 2,410 This file is loaded in full into every session.
When invoked 2,410 The same file — it is already loaded in full.
Security scan B 1 finding. 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.02410 $0.02410
Opus 5.5 $0.00964 $0.00964
Sonnet 5.5 $0.00482 $0.00482
Haiku 4.5 $0.00241 $0.00241

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

Security

Grade B, and why

alluvium CLAUDE.md scanned grade B 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 2mo 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

- ❌ 让用户手编辑 `~/.claude/settings.json` 注入 hook(**用 `.claude-plugin/plugin.json`**)
CLAUDE.md · 162 lines

How it starts

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

Alluvium · 项目宪法

你(AI)每次进入这个仓库,先读这份文件,再读 docs/LLM_WIKI_DOCTRINE.md。 后者是产品圣经(Karpathy LLM Wiki 模式的忠实落地原则),是判断"实现是否对路"的最终标尺。 任何与本文件或圣经冲突的实现都是错的——遇到分歧请向用户提问,不要自行决定推翻这里的约定。

一句话

Alluvium 是一个 Claude Code session 自动归档器:每次 Claude Code 会话结束后,被动地把对话蒸馏成"精华笔记",按 Karpathy 的 LLM Wiki 模式合并进用户的 Obsidian vault。

卖点(README slogan)

You don't save your sessions. Your sessions save themselves.

跟同赛道 8 个 obsidian 类项目(claudesidian / claudian / claude-obsidian / obsidian-second-brain 等)的核心差异:

  • 别人是主动唤起(slash command / 侧边栏 / MCP 按需调用);Alluvium 是被动归档(hook 触发,用户无感)。
  • 别人多数存原始对话或简单摘要;Alluvium 蒸馏后合并到 topic 页,不留 session 日志。
  • 别人多数是 Obsidian 插件或 Claude 内嵌助手;Alluvium 是外部 Rust 二进制 + Claude Code Plugin。

如果 AI 在写"侧边栏"、"slash command"、"per-session note 文件"这类东西,停下来重读本文——多半跑偏了。

知识组织模型(核心,详见 docs/KNOWLEDGE_MODEL.md)

vault 内三层:

<vault>/Alluvium/
├── raw/sessions/        # 不可变原档:每次 session 一份 transcript 副本
├── wiki/
│   ├── index.md         # 主题分类 hub
│   ├── log.md           # append-only 时间线(一行一 session)
│   ├── overview.md
│   ├── concepts/        # 概念、模式、技术(topic 页)
│   ├── entities/        # 项目、工具、人、库(topic 页)
│   └── sources/         # 单 session 摘要(可选层)
└── CLAUDE.md            # vault 内的 schema 文件(注意:这个 CLAUDE.md ≠ 仓库根的这份)

核心原则:知识沉淀到 topic 页(concepts/ 和 entities/),session 不直接变成笔记。session 的最终去处是 raw/sessions/ 作为不可变原档,知识被抽出后向上汇总进 wiki。

Hook 架构(4 个,详见 docs/HOOKS.md)

SessionStart  →  写 `<cache>`/sessions/<id>/resolved.json
PreCompact    →  快照当前 transcript 防 compact 后丢
Stop          →  spawn detached 子进程,hook 立即返回(不卡 Claude Code)
SessionEnd    →  清理临时文件

PreCompact 不能省——长 session 中途 compaction 会丢原始细节。 detached spawn 不能省——蒸馏要 5-30 秒,hook 必须 100ms 内返回。

硬约束(不可违反)

  1. 用户是纯 VibeCoder,不写也不读代码。任何代码层选项都要翻译成"对用户可见的影响"才呈现。
  2. prompt / config / 中间产物必须是外部文件(toml / yaml / md / json),用户能直接编辑、能用 Obsidian 打开看。
  3. 测试是用户的眼睛——功能正确性靠 cargo test 通过/失败回答。测试名要表达用户可见的断言(参考 tests/e2e_*.rs 命名)。
  4. 单二进制分发——cargo build --release 出来的二进制独立运行,不依赖 Python / Node 等环境。
  5. 保留用户手改——用户可能在 Obsidian 里手动改过任何 wiki 页。merge 时只能覆盖 Alluvium 上次写的部分,必须 diff。
  6. 自我引用屏蔽——cwd 在 Alluvium 自己开发目录的 session 不归档(避免递归)。

Read the full file on GitHub · 162 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. 2mo ago First seen · 162 lines · 2,410 tokens per session scan B 5ce72d3cdd09

Subscribe to this mod's changes

alluvium CLAUDE.md is an instructions file published in the GitHub repository Tespera/alluvium (1 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 2,410 tokens to every session, about $0.0096 per session on Opus 5.5. A static security scan graded it B with 1 finding (reads agent configuration directories). 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,715 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,461 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,750 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