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/lulin70/carrymem/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.svg" alt="Measured on agentmods" 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 | $0.03585 | $0.03585 |
| Opus 5 | $0.01792 | $0.01792 |
| Sonnet 5 | $0.00717 | $0.00717 |
| Haiku 4.5 | $0.00359 | $0.00359 |
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 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.
How it starts
The opening of the file, as written. The whole thing — 230 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.8.0(来源:src/carrymem/__version__.py) - 核心技术栈:
- Python 3.12+(
setup.py中python_requires=">=3.12") - SQLite + FTS5(默认存储与全文检索)
- MCP(Model Context Protocol)服务器集成
- 核心依赖:
PyYAML>=5.0+cryptography>=46.0.6(v0.7.3 起 cryptography 为硬依赖),语言检测 / 向量检索 / 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/test_e2e_*.py,共 12 个场景文件)
pytest tests/test_e2e_*.py
# 带覆盖率(默认即开启,显式写法)
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)执行以下命令,本地应保持一致:
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.
- 5d 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 (5 stars, last pushed 17d ago), licensed MIT. It adds 3,585 tokens to every session, about $0.0179 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
lean-ctx AGENTS.md
AGENTS.md instructions for yvgude/lean-ctx, covering context engineering layer, mandatory multi-agent delivery, integration mode: replace, subagent compatibility (cursor / claude code) and cli commands (optimized shell, lower overhead).
lean-ctx copilot-instructions.md
Copilot instructions for yvgude/lean-ctx, a project described as: Control what your AI can see. LeanCTX (Lean Context) is the context intelligence layer for AI agents — one local Rust binary that decides what they read, remembers what they learn, guards what they touch, and proves what they save. 60–90% fewer tokens…
memex AGENTS.md
AGENTS.md instructions for kioie/memex, covering agent instructions (memex), commands, layout, mcp layer and mcp tools.
memgit CLAUDE.md
Claude Code instructions for code4161/memgit, covering memgit core — operating guide and rules.
project-memory-mcp AGENTS.md
AGENTS.md instructions for kaaustubh/project-memory-mcp, covering project-memory-mcp — agent memory, what this is, architecture (the core ideas), stack & layout and run / build / test.
brainvault CLAUDE.md
Instructions for SumithSB/brainvault, covering brainvault, key constraints, structure, install scope and running.