Borrowing it
Nothing to install: this file belongs to lulin70/carrymem. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/lulin70/carrymem/new-main/CLAUDE.mdgit clone --depth 1 https://github.com/lulin70/carrymemWrote 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.
[](https://agentmods.dev/instructions/lulin70/carrymem/claude-md)<a href="https://agentmods.dev/instructions/lulin70/carrymem/claude-md"><img src="https://agentmods.dev/badge/instructions/lulin70/carrymem/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.
<a href="https://agentmods.dev/instructions/lulin70/carrymem/claude-md"><img src="https://agentmods.dev/badge/instructions/lulin70/carrymem/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.03757 | $0.03757 |
| Opus 5.5 | $0.01503 | $0.01503 |
| Sonnet 5.5 | $0.00751 | $0.00751 |
| Haiku 4.5 | $0.00376 | $0.00376 |
Grade A, and why
carrymem 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 1mo 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.
How it starts
The opening of the file, as written. The whole thing — 232 lines — stays where its author put it; the contents beside it link to each section on GitHub.
CLAUDE.md — CarryMem AI 协作指引
本文件为 AI 代理(Claude / Codex 等)在 CarryMem 仓库内工作提供统一上下文。所有命令均假设在仓库根目录执行,且已激活包含 dev extras 的虚拟环境。
项目概述
- CarryMem 是一个可移植的 AI 记忆层:让 AI 自动记住用户的偏好、决策与纠正,跨模型 / 工具 / 设备复用,无需每次重复自我介绍。
- 当前版本:
0.11.2(来源:src/carrymem/__version__.py,2026-10-02 校准) - 核心技术栈:
- Python 3.12+(
setup.py中python_requires=">=3.12") - SQLite + FTS5(默认存储与全文检索)
- MCP(Model Context Protocol)服务器集成
- 核心依赖:
PyYAML>=5.0+cryptography>=50.0.0(v0.11.0 起安全版本下限),语言检测 / 向量检索 / LLM / TUI 均为可选 extras
- Python 3.12+(
- 仓库:https://github.com/lulin70/carrymem
- CI 默认分支:
new-main(非main,提交 PR 时注意基分支)
安装与构建
# 开发模式安装(含 dev extras:pytest 全家桶、black、flake8、mypy、pre-commit 等)
pip install -e ".[dev]"
# 用户安装(已发布到 PyPI)
pip install carrymem
# 完整功能安装
pip install -e ".[full]"
# 构建 sdist + wheel(CI 使用流程)
python -m build
twine check dist/*
# 全新虚拟环境验证安装(CI 的 build gate)
python -m venv /tmp/carrymem_venv
/tmp/carrymem_venv/bin/pip install $(ls dist/carrymem-*.whl | head -1)
/tmp/carrymem_venv/bin/python -c "import carrymem; print(carrymem.__version__)"
CLI 入口:carrymem(entry_points → carrymem.cli:main),也可 python -m carrymem。
测试命令
pytest 配置位于 pyproject.toml 的 [tool.pytest.ini_options]:默认开启 --cov=carrymem、--strict-markers、asyncio_mode = "auto",覆盖率门槛 fail_under = 75。
# 全量测试(默认带覆盖率,输出 term/html/xml 三份报告)
pytest tests/
# 排除慢测试(CI 主 gate 使用,附加 --timeout=120)
pytest tests/ -m "not slow" -q
# 仅 E2E 测试(tests/e2e/,共 18 个场景文件)
pytest tests/e2e/
# 带覆盖率(默认即开启,显式写法)
pytest tests/ --cov=carrymem --cov-report=term-missing
# 仅单元 / 集成测试(按 marker 过滤)
pytest tests/ -m "unit"
pytest tests/ -m "integration"
# 长超时调试单个文件
pytest tests/test_e2e_mcp_tools.py --timeout=300 -v
可用 marker:slow、integration、unit、asyncio、coverage。
E2E 测试覆盖:并发访问、大数据集、MCP 工具、适配器切换、加密全链路、完整生命周期、用户场景、边界用例、经验精炼、安全管线、版本回滚、用户旅程。发布前务必运行 E2E 套件做模拟真实用户使用的验证。
代码质量
CI 的 lint gate(.github/workflows/ci.yml)执行以下命令,本地应保持一致:
# 格式检查(line-length=120,target py312)
black --check --diff --color --line-length=120 src/ tests/
isort --check-only --diff src/ tests/
# Lint(max-line-length=120,配置见 .flake8)
flake8 src/ tests/ --count --max-line-length=120 --statistics
# 类型检查(配置在 pyproject.toml [tool.mypy])
mypy src/
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.
- 1mo ago Changed · +9 tokens per session b052169031f4
- 1mo ago Changed · -2 tokens per session f8aa4c8efb38
- 2mo ago Changed · +2 lines · +165 tokens per session 014267bfbee4
- 2mo ago First seen · 230 lines · 3,585 tokens per session scan A 54865004c7be
carrymem CLAUDE.md is an instructions file published in the GitHub repository lulin70/carrymem (9 stars, last pushed yesterday), licensed MIT. It adds 3,757 tokens to every session, about $0.0150 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.
carrymem CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| carrymem CLAUDE.mdlulin70/carrymem | Instructions file | 9 | yesterday | MIT | A | 3,757 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |