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.
npx agentmods add instructions/cicbyte/siyuan-cli/claude-mdgit clone --depth 1 https://github.com/cicbyte/siyuan-cliWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00714 | $0.00714 |
| Opus 5 | $0.00357 | $0.00357 |
| Sonnet 5 | $0.00143 | $0.00143 |
| Haiku 4.5 | $0.00071 | $0.00071 |
Grade A, and why
siyuan-cli 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 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.
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.
What it actually says
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
项目概述
思源笔记(SiYuan Note)命令行管理工具,Go 语言编写。通过思源内核 API 实现笔记本管理、文档操作、块编辑等功能,并提供交互式 TUI 界面。
构建与运行
# 开发构建
go build -o siyuan-cli .
# 直接运行
go run cmd/*.go
# 生产构建(含 Web 前端构建 + UPX 压缩)
python build.py
build.py 流程:npm build(web/dist) → 清理 resources/static → 复制前端产物 → go build → UPX 压缩。构建信息(版本号、commit hash、分支)通过 -ldflags 注入 main 包变量。
当前无单元测试框架。
架构
分层结构,职责清晰:
cmd/— Cobra 命令定义,每个子命令一个文件(root.go、notebook.go、document.go、fav.go)internal/logic/— 业务逻辑层,按领域分包(notebook/、document/、fav/)internal/siyuan/— 思源内核 API 的 Go SDK 封装。client.go定义Client结构体和post/postMultipart基础请求方法;factory.go从全局配置创建客户端实例internal/ui/— Bubble Tea TUI 组件(笔记本列表、文档树、路径选择器等)internal/models/— 数据结构定义,核心是AppConfig(YAML 配置模型)internal/utils/config.go— 配置管理单例,处理目录创建、配置加载/保存、默认值internal/common/— 全局变量(AppConfigModel)internal/log/— Zap 日志初始化
关键设计
配置系统:YAML 配置文件位于 ~/.cicbyte/siyuan-cli/config/config.yaml,首次运行自动创建。common.AppConfigModel 是全局配置入口,在 cmd/root.go 的 init() 中加载。
SiYuan SDK:Client 线程安全、可复用。所有 API 均为 POST 请求,返回 {code, msg, data} 结构,code != 0 时返回 *SiYuanError。通过 factory.go 的 GetDefaultSiYuanClient() 获取客户端。
启动流程(cmd/root.go init):初始化应用目录 → 加载配置 → 初始化日志 → 连接 SQLite 数据库。
依赖
- Cobra — CLI 框架
- Bubble Tea + Lipgloss + Bubbles — TUI
- Zap + Lumberjack — 日志(按天轮转)
- GORM + SQLite — 数据持久化
- go.yaml.in/yaml/v3 — 配置解析
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.
- 2d ago First seen · 54 lines · 714 tokens per session scan A 2b60bc9aab59
siyuan-cli CLAUDE.md is an instructions file published in the GitHub repository cicbyte/siyuan-cli (5 stars, last pushed 4mo ago), licensed MIT. It adds 714 tokens to every session, about $0.0036 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-31.
Other instructions, from other repositories
mache CLAUDE.md
Instructions for agentic-research/mache, covering claude.md, build & test commands, architecture, three presentation paths and core abstractions.
mache AGENTS.md
Instructions for agentic-research/mache, covering agent instructions, quick reference, non-interactive shell commands, force overwrite without prompting and for recursive operations.
ollama CLAUDE.md
Claude Code instructions for ollama/ollama: See AGENTS.md for the shared agent instructions for this repository.
sq AGENTS.md
Instructions for neilotoole/sq, covering agents.md, about sq, key documents, common commands and conventions.
cli AGENTS.md
Instructions for planetscale/cli, covering planetscale cli — agent guide, public repository safety, concepts, flag placement and correct.
azure-sdk-for-go go-code.instructions.md
Instructions for Azure/azure-sdk-for-go: All code should follow the guidelines from the Azure Go SDK Guidelines. This document is a summary of the most important guidelines to follow when contributing to the Azure Go SDK.