微信扫码
添加专属顾问
我要投稿
Claude Code 解决了本地数据管理的核心痛点,让RAG和agent开发更安全高效。核心内容: 1. 本地数据管理的五大常见问题与解决方案 2. Claude Code存储架构的四大设计原则 3. 多级配置体系与灵活扩展机制
{"projects": {"/Users/xxx/my-project": {"MCPServers": {"jarvis-tasks": {"type": "stdio","command": "python","args": ["/path/to/run_mcp.py"]}}}},"recentPrompts": ["Fix the bug in auth module","Add unit tests"]}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
~/.claude/├── settings.json # 全局设置(权限、插件、清理周期)├── settings.local.json # 本地设置(机器特定,不提交Git)├── history.jsonl # 命令历史记录│├── projects/ # 📁 Session 数据(按项目组织,核心目录)│ └── -Users-xxx-project/ # 路径编码后的项目目录│ ├── {session-id}.jsonl # 主会话数据(JSONL格式)│ └── agent-{agentId}.jsonl # 子代理会话数据│├── session-env/ # Session 环境变量│ └── {session-id}/ # 按Session ID隔离│├── skills/ # 📁 用户级 Skills(全局可用)│ └── mac-mail/│ └── SKILL.md│├── plugins/ # 📁 插件管理│ ├── config.json # 插件全局配置│ ├── installed_plugins.json # 已安装插件列表│ ├── known_marketplaces.json # 市场源配置│ ├── cache/ # 插件缓存│ └── marketplaces/│ └── anthropic-agent-skills/│ ├── .claude-plugin/│ │ └── marketplace.json│ └── skills/│ ├── pdf/│ ├── docx/│ └── frontend-design/│├── todos/ # 任务列表存储│ └── {session-id}-*.json # 关联Session的任务文件│├── file-history/ # 文件编辑历史(按内容hash存储)│ └── {content-hash}/ # 哈希命名的文件备份目录│├── shell-snapshots/ # Shell 状态快照├── plans/ # Plan Mode 计划存储├── local/ # 本地工具/node_modules│ └── claude # Claude CLI 可执行文件│ └── node_modules/ # 本地依赖│├── statsig/ # 特性开关缓存├── telemetry/ # 遥测数据└── debug/ # 调试日志
┌─────────────────────────────────────────┐│ 项目级配置 │ 优先级最高│ 项目/.claude/settings.json │ 项目专属,覆盖其他配置├─────────────────────────────────────────┤│ 本地配置 │ 机器特定,不提交版本控制│ ~/.claude/settings.local.json │ 覆盖全局配置├─────────────────────────────────────────┤│ 全局配置 │ 优先级最低│ ~/.claude/settings.json │ 基础默认配置└─────────────────────────────────────────┘
-
-
-
-
-
-
-
-
-
-
-
-
{ "$schema": "https://json.schemastore.org/claude-code-settings.json", "permissions": { "allow": ["Read(**)", "Bash(npm:*)"], "deny": ["Bash(rm -rf:*)"], "ask": ["Edit", "Write"] }, "enabledPlugins": { "document-skills@anthropic-agent-skills": true }, "cleanupPeriodDays": 30}
-
-
-
-
-
-
-
-
{ "permissions": { "allow": ["Bash(git:*)", "Bash(docker:*)"] }, "env": { "ANTHROPIC_API_KEY": "sk-ant-xxx" }}
-
-
-
-
-
{ "permissions": { "allow": ["Bash(pytest:*)"] }}
/Users/bill/My Project → -Users-bill-My-Project{"type":"user","message":{"role":"user","content":"Hello"},"timestamp":"2026-01-05T10:00:00Z"}{"type":"assistant","message":{"role":"assistant","content":[{"type":"text","text":"Hi!"}]}}{"type":"user","message":{"role":"user","content":"Help me fix this bug"}}
{"type": "user","uuid": "7d90e1c9-e727-4291-8eb9-0e7b844c4348","parentUuid": null,"sessionId": "e5d52290-e2c1-41d6-8e97-371401502fdf","timestamp": "2026-01-05T10:00:00.000Z","message": {"role": "user","content": "分析一下这个项目的架构"},"cwd": "/Users/xxx/project","gitBranch": "main","version": "2.0.76"}
{"type": "assistant","uuid": "e684816e-f476-424d-92e3-1fe404f13212","parentUuid": "7d90e1c9-e727-4291-8eb9-0e7b844c4348","message": {"role": "assistant","model": "claude-opus-4-5-20251101","content": [{"type": "thinking","thinking": "用户想了解项目架构,我需要先查看目录结构..."},{"type": "text","text": "让我先看一下项目结构。"},{"type": "tool_use","id": "toolu_01ABC","name": "Bash","input": {"command": "ls -la"}}],"usage": {"input_tokens": 1500,"output_tokens": 200,"cache_read_input_tokens": 50000}}}
file-history-snapshot (messageId: A)↓user (uuid: A, parentUuid: null) ← 用户提问(链路起点)↓assistant (uuid: B, parentUuid: A) ← AI思考 + 文本回复↓assistant (uuid: C, parentUuid: B) ← AI工具调用(如Bash命令)↓user (uuid: D, parentUuid: C) ← 工具执行结果(如Bash输出)↓assistant (uuid: E, parentUuid: D) ← AI基于工具结果继续回复↓summary (leafUuid: E) ← 会话摘要(关联链路终点)
用户提问 → 创建snapshot(备份原始内容) → Claude修改文件 → 用户不满意 → Esc+Esc撤销↑ ↓存储原始内容 ←─────────────────────────────── 从snapshot恢复原始内容
{"type": "file-history-snapshot","messageId": "7d90e1c9-e727-4291-8eb9-0e7b844c4348","snapshot": {"messageId": "7d90e1c9-e727-4291-8eb9-0e7b844c4348","trackedFileBackups": {"/path/to/file1.py": "原始文件内容\ndef hello():\n print('old')","/path/to/file2.js": "// 原始内容..."},"timestamp": "2026-01-05T10:00:00.000Z"},"isSnapshotUpdate": false}
┌──────────────────┐│ 修改前 app.py ││ print("old") │───────→ 备份到 snapshot 的 trackedFileBackups└──────────────────┘↓┌──────────────────┐│ Claude 修改后 ││ print("new") │───────→ 写入磁盘(覆盖原文件)└──────────────────┘↓┌──────────────────┐│ 用户执行撤销 ││ 按下 Esc + Esc │───────→ 从 snapshot 恢复 "old" 内容到磁盘└──────────────────┘
~/.claude/plugins/├── config.json插件全局配置(如启用/禁用规则)├── installed_plugins.json已安装插件列表(含版本、状态)├── known_marketplaces.json插件市场源配置(如Anthropic官方市场)├── cache/插件下载缓存(避免重复下载)└── marketplaces/市场源存储目录└── anthropic-agent-skills/官方插件市场├── .claude-plugin/│ └── marketplace.json市场元信息└── skills/市场提供的Skills├── pdf/PDF处理相关Skill├── docx/Word文档处理相关Skill└── frontend-design/前端设计相关Skill
作者介绍
陈彪
Zilliz Senior Staff Software Engineer
阅读推荐 都有混合检索与智能路由了,谁还在给RAG赛博哭坟? prompt比拖拉拽更适合新手做复杂agent!LangSmith+Milvus教程 多agent系统实战之:Agno与LangGraph,谁更适合快速落地生产? 单agent落幕,双agent才能解决复杂问题!附LangGraph+Milvus实操 教程|别只盯着 Langchain!Google ADK 搭建 Agent,上下文管理效率翻倍 

53AI,企业落地大模型首选服务商
产品:场景落地咨询+大模型应用平台+行业解决方案
承诺:免费POC验证,效果达标后再合作。零风险落地应用大模型,已交付160+中大型企业
2026-01-13
Cursor 用文件系统重构上下文工程:5个实践讲透
2026-01-12
CES 2026 | 如何使用 RAG 和安全护栏构建语音智能体
2026-01-12
NotebookLM如何在48小时内分析2万份论文?
2026-01-11
为RAG装上导航:ToPG通过图遍历,破局复杂查询
2026-01-11
高精度知识库≠Milvus+llm!这份PaddleOCR+混合检索+Rerank技巧请收好
2026-01-10
AIOps探索:做AIOps不要低估运维领域的RAG带来的影响
2026-01-10
Qwen3-VL 正式开源:多模态 RAG 的关键一环终于补齐
2026-01-09
白嫖一个英伟达的垂直领域 Deep Research 智能体
2025-12-04
2025-11-04
2025-10-31
2025-12-03
2025-11-13
2025-10-16
2025-10-16
2025-11-13
2025-12-02
2025-11-05
2026-01-12
2026-01-08
2026-01-02
2025-12-23
2025-12-21
2025-12-10
2025-11-23
2025-11-20