carrymem CLAUDE.md

carrymem CLAUDE.md is an instructions file for coding agents from lulin70/carrymem. It costs 3,585 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

Install

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.

agentmods
npx agentmods add instructions/lulin70/carrymem/claude-md
Clone the repo
git clone --depth 1 https://github.com/lulin70/carrymem

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.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.svg" alt="Measured on agentmods" height="20"></a>
Per session 3,585 This file is loaded in full into every session.
When invoked 3,585 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.03585 $0.03585
Opus 5 $0.01792 $0.01792
Sonnet 5 $0.00717 $0.00717
Haiku 4.5 $0.00359 $0.00359

Measured 5d ago against content hash 54865004c7be, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 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.

CLAUDE.md · 230 lines

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.pypython_requires=">=3.12"
    • SQLite + FTS5(默认存储与全文检索)
    • MCP(Model Context Protocol)服务器集成
    • 核心依赖:PyYAML>=5.0 + cryptography>=46.0.6(v0.7.3 起 cryptography 为硬依赖),语言检测 / 向量检索 / 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 入口:carrymementry_pointscarrymem.cli:main),也可 python -m carrymem


测试命令

pytest 配置位于 pyproject.toml[tool.pytest.ini_options]:默认开启 --cov=carrymem--strict-markersasyncio_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:slowintegrationunitasynciocoverage

E2E 测试覆盖:并发访问、大数据集、MCP 工具、适配器切换、加密全链路、完整生命周期、用户场景、边界用例、经验精炼、安全管线、版本回滚、用户旅程。发布前务必运行 E2E 套件做模拟真实用户使用的验证。


代码质量

CI 的 lint gate(.github/workflows/ci.yml)执行以下命令,本地应保持一致:

Read the full file on GitHub · 230 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. 5d 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 (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.