carrymem: Instructions file for Claude Code

CLAUDE.md

carrymem CLAUDE.md is an instructions file for Claude Code from lulin70/carrymem. It costs 3,757 tokens per session, scanned A, original, MIT.

Project instructions for CarryMem, a portable AI memory layer that stores user preferences, decisions, and corrections for reuse across models, tools, and devices. They describe the project, setup, testing, and release-related commands.

In plain words
What is it for?
Use them when installing CarryMem, building its Python package, running tests, checking versions, or working with its SQLite, MCP, and optional features.
Why use it?
They give an AI coding assistant the repository context needed to work consistently in the project.

Instructions file for Claude Code

Written for Claude Code: the file is CLAUDE.md. Also seen: mentions CLAUDE.md; mentions Codex.

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

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/lulin70/carrymem/new-main/CLAUDE.md
Clone the repo
git clone --depth 1 https://github.com/lulin70/carrymem

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

README.md
[![agentmods](https://agentmods.dev/badge/instructions/lulin70/carrymem/claude-md/github.svg)](https://agentmods.dev/instructions/lulin70/carrymem/claude-md)
Your own site
<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.

agentmods 80×15 button for carrymem CLAUDE.md

Your own site · 80×15
<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>
Per session 3,757 This file is loaded in full into every session.
When invoked 3,757 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.03757 $0.03757
Opus 5.5 $0.01503 $0.01503
Sonnet 5.5 $0.00751 $0.00751
Haiku 4.5 $0.00376 $0.00376

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

Security

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.

CLAUDE.md · 232 lines

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
  • 仓库: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/

Read the full file on GitHub · 232 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. 1mo ago Changed · +9 tokens per session b052169031f4
  2. 1mo ago Changed · -2 tokens per session f8aa4c8efb38
  3. 2mo ago Changed · +2 lines · +165 tokens per session 014267bfbee4
  4. 2mo ago First seen · 230 lines · 3,585 tokens per session scan A 54865004c7be

Subscribe to this mod's changes

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.

Related

carrymem CLAUDE.md compared with instructions from other repositories

carrymem CLAUDE.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
carrymem CLAUDE.mdlulin70/carrymemInstructions file9yesterdayMITA3,757Claude Code
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA9,719GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149kyesterdayMITA4,680Codex, OpenCode
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA5,516GitHub Copilot
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195kyesterdayMITA3,093GitHub Copilot
deepseek-harness AGENTS.mddeepseek-ai/deepseek-harnessInstructions file274k2d agoMITA4,313Codex, OpenCode