一句话:把你的工作方式、项目背景、偏好规则存成 Markdown,粘贴到任何 AI 模型立刻生效。
切换模型不再从零开始 · 2 分钟恢复完整上下文
你是否遇到过这些问题:
-
❌ 每次换模型要重新“调教”,花 30-50 分钟
-
❌ Claude 记住的上下文,ChatGPT 完全不知道
-
❌ 平台的 Memory 功能被锁死,无法导出迁移
-
❌ 不确定哪些信息可以给 AI,哪些不能
SelfCtx 让你:
-
✅ 2 分钟恢复完整上下文(vs 传统 30-50 分钟)
-
✅ 一份文件,所有模型通用(Claude、ChatGPT、Gemini、DeepSeek……)
-
✅ 本地掌控,随时导出迁移
-
✅ 4 个披露级别,按需分级共享
graph TB
A[📁 my_pca/ 本地文件夹] --> B[D1_identity.md]
A --> C[D2_cognitive_os.md 🔥]
A --> D[D5_capabilities.md]
A --> E[D8_projects.md]
A --> F[⚙️ build.py]
F --> G[📦 exports/]
G --> H[L0_public.md<br>500 tokens]
G --> I[L1_work.md<br>2000 tokens]
G --> J[L2_trusted.md<br>5000 tokens]
G --> K[L3_full.md<br>完整版]
I -.📋 复制粘贴.-> L[🤖 AI 模型]
L --> M[Claude]
L --> N[ChatGPT]
L --> O[Gemini]
L --> P[DeepSeek]
style C fill:#ff6b6b,color:#fff
style I fill:#51cf66,color:#fff
style L fill:#4dabf7,color:#fff
核心思路:
-
把你的工作方式、技能、项目写成 10 个 Markdown 文件
-
用脚本合并成不同级别的文件(L0-L3)
-
复制粘贴到任何 AI 模型,立刻生效
git clone https://github.com/s87343472/selfctx.git
cd selfctx打开 my_pca/ 文件夹,编辑这 4 个核心文件:
my_pca/
├── D1_identity.md # 你是谁(职业、背景)
├── D2_cognitive_os.md # 🔥 核心!AI 必须遵守的规则
├── D5_capabilities.md # 你的技能和专长
└── D8_projects.md # 当前项目
💡 不知道怎么写?点击查看示例
D2_cognitive_os.md 示例(这是最重要的文件):
# D2 认知操作系统
## 输出规则
- 永远用中文回复
- 代码必须带注释
- 给我 3 个方案而不是 1 个
## 工作方式
- 我偏好渐进式实现,不要一次性大重构
- 遇到技术选型先问我,不要自己决定
## 禁止事项
❌ 不要直接给代码让我复制粘贴(我要理解原理)
❌ 不要用"应该"、"可能"等模糊词汇(要明确)完整示例:查看 examples/product_manager/ 文件夹
python build.py --level L1 # 生成工作版(推荐)会在 exports/ 生成 L1_work.md
复制 exports/L1_work.md 的内容,粘贴到:
| AI 模型 | 粘贴位置 |
|---|---|
| Claude | Project Knowledge |
| ChatGPT | Custom Instructions 或对话开头 |
| Gemini | System Instructions |
| DeepSeek / Qwen | 对话开头 |
完成! AI 现在记住你了 🎉
你: 帮我写个 React 组件
AI: 好的,这是一个基础组件...
(生成 class 组件)
你: 我要函数式组件,用 TypeScript,带单测
AI: 好的,重新写...
你: 用我们项目的 design system
AI: 你们用什么 design system?
你: 帮我写个 React 组件
AI: 根据你的技术栈(React 18 + TS + Vitest),
使用你们的 Ant Design 5.0 规范,
这是函数式组件 + 单测...
[直接给出符合项目规范的代码]
节省时间:从每次 30-50 分钟 → 2 分钟
| 级别 | Token | 包含内容 | 适用场景 |
|---|---|---|---|
| L0 公开版 | <500 | 身份标签 + 行为规则 | 公开分享、演示 |
| L1 工作版 ⭐ | <2000 | + 项目/技能/工作关系 | 日常推荐 |
| L2 信任版 | <5000 | 全部维度(脱敏) | 长期主力模型 |
| L3 全量版 | 不限 | 原始数据 | 仅本地,永不外发 |
首次建立:15-30 分钟之后迁移:2 分钟
graph TD
D1[D1 叙事身份<br>年度更新] --> D2[D2 认知 OS 🔥<br>季度更新]
D2 --> D3[D3 具身状态<br>月度更新]
D2 --> D4[D4 情绪心理<br>月度更新]
D2 --> D5[D5 能力专长<br>季度更新]
D5 --> D6[D6 资产图谱<br>季度更新]
D5 --> D7[D7 关系网络<br>季度更新]
D5 --> D8[D8 项目快照<br>月度更新]
D1 --> D9[D9 兴趣审美<br>年度更新]
D1 --> D10[D10 世界观志向<br>年度更新]
style D2 fill:#ff6b6b,color:#fff
style D5 fill:#51cf66,color:#fff
style D8 fill:#ffd93d,color:#000
点击展开完整维度说明
| # | 维度 | 更新频率 | 说明 |
|---|---|---|---|
| D1 | 叙事身份 | 年度 | 我是谁(职业、教育、地域) |
| D2 | 认知操作系统 | 季度 | 🔥 核心!AI 的强制规则 |
| D3 | 具身状态 | 月度 | 健康、能量、作息 |
| D4 | 情绪与心理 | 月度 | 可选,当前心理状态 |
| D5 | 能力与专长 | 季度 | 技能树、工具链 |
| D6 | 资产图谱 | 季度 | 产品/设备/代码库 |
| D7 | 关系网络 | 季度 | 工作关系、协作者 |
| D8 | 项目快照 | 月度 | 3-12 个月窗口的项目 |
| D9 | 兴趣与审美 | 年度 | 偏好、品味 |
| D10 | 世界观与志向 | 年度 | 长期目标、价值观 |
D2 是核心。 它存的不是偏好,是规则——粘贴进任何模型立刻强制执行。
| 模型 | L0 | L1 | L2 | 备注 |
|---|---|---|---|---|
| Claude Opus 4.8 / Sonnet 4.6 | ✓ | ✓ | ✓ | 完美支持 |
| GPT-5.5 / GPT-5.4 | ✓ | ✓ | ✓ | 完美支持 |
| Gemini 3.1 Pro | ✓ | ✓ | ✓ | 完美支持 |
| Gemini 3 Flash | ✓ | ✓ | △ | 基本可用 |
| Grok 4 / 4.3 | ✓ | ✓ | △ | 基本可用 |
| DeepSeek V3.2 | ✓ | ✓ | △ | 基本可用 |
| Qwen 3.5 | ✓ | ✓ | △ | 基本可用 |
| Mistral Large | ✓ | ✓ | △ | 基本可用 |
✓ 完全支持 · △ 基本可用,部分字段识别不够精准
.gitignore:
# SelfCtx 敏感文件
exports/L3_full.md
my_pca/D4_emotional.md
my_pca/D7_relationships.md
隐私原则:
-
✅ L0/L1 可以公开分享
-
⚠️ L2 只给信任的主力模型 -
❌ L3 永远不要上传到任何平台
Q: 和平台的 Memory 功能有什么区别?
A: 平台 Memory 被锁死在单一模型,无法导出或迁移。SelfCtx 是本地 Markdown 文件,你完全掌控,可以跨所有模型使用。
Q: 需要编程基础吗?
A: 不需要。只需要会编辑 Markdown 文件。build.py 是可选的,你也可以手动合并文件。
Q: Token 会不会太多?
A: L1 工作版 <2000 tokens,相当于一页 A4 纸。现代模型支持 128K-200K tokens,完全无压力。
Q: 多久更新一次?
A:
-
D2(认知 OS):每季度审视一次
-
D8(项目快照):每月更新
-
D1/D9/D10:每年更新
-
其他维度:按需更新
Q: 可以团队共享吗?
A: 可以!导出 L0 公开版给团队,包含团队的工作规范和行为准则。每个人再基于此添加自己的个人维度。
Q: 和 Anthropic Projects 有什么区别?
A: Anthropic Projects 只能在 Claude 中使用。SelfCtx 是模型无关的,可以在任何 AI 模型中使用,包括本地模型。
我们提供了 3 个职业的完整示例:
-
产品经理 - B2B SaaS 产品经理的完整配置
-
开发者 - 全栈开发者的技术栈和工作流
-
设计师 - UI/UX 设计师的设计原则和工具链
每个示例都包含:
-
✅ 完整的 10 个维度文件
-
✅ 可直接使用的 L1 工作版
-
✅ 详细的填写说明
如果你用 Claude,可以安装增强技能:
-
下载
selfctx.skill -
Claude 设置 → Skills → Import
-
获得能力:
-
自动搜索历史对话
-
结构化导出上下文
-
对话中直接更新维度
-
需要 Claude 3.5+
-
基础框架和 10 个维度
-
4 级披露系统
-
Claude Skill 集成
-
VS Code 插件(一键同步)
-
Web 可视化编辑器
-
团队版(共享 L0 + 个人 L1-L3)
-
AI 自动提取(从历史对话生成 SelfCtx)
-
📝 我为什么要给自己建一套「个人上下文资产」 - 深入讲解 SelfCtx 的设计理念
-
🏗️ 规模化实践:从个人项目到团队协作 - 如何在团队中使用 SelfCtx
-
🤖 更多 AI 工作流实践 - SagaSu 的博客
MIT License - 详见 LICENSE
SagaSu - 产品人 × AI 实践者
不会写代码,用 AI Agent 从零造了 OmniConvert3900+ 页、8 种语言、73 种文件格式互转的在线工具
如果 SelfCtx 帮到了你,请点 ⭐ Star 支持一下!
One sentence: Store your work style, project context, and behavior rules as Markdown, paste into any AI model, works instantly.
Stop re-introducing yourself · Context restored in 2 minutes
中文 · Quick Start · Blog Post
Have you ever experienced:
-
❌ 30-50 min to re-onboard a new model
-
❌ Context scattered across platforms
-
❌ Platform memory can't cross models
-
❌ Unsure what's safe to share
SelfCtx gives you:
-
✅ 2 min to restore full context (vs 30-50 min)
-
✅ One file, all models (Claude, ChatGPT, Gemini, DeepSeek...)
-
✅ Plain Markdown, locally owned
-
✅ 4 disclosure levels, you decide
graph TB
A[📁 my_pca/ Local folder] --> B[D1_identity.md]
A --> C[D2_cognitive_os.md 🔥]
A --> D[D5_capabilities.md]
A --> E[D8_projects.md]
A --> F[⚙️ build.py]
F --> G[📦 exports/]
G --> H[L0_public.md<br>500 tokens]
G --> I[L1_work.md<br>2000 tokens]
G --> J[L2_trusted.md<br>5000 tokens]
G --> K[L3_full.md<br>Full version]
I -.📋 Copy & Paste.-> L[🤖 AI Models]
L --> M[Claude]
L --> N[ChatGPT]
L --> O[Gemini]
L --> P[DeepSeek]
style C fill:#ff6b6b,color:#fff
style I fill:#51cf66,color:#fff
style L fill:#4dabf7,color:#fff
Core idea:
-
Write your work style, skills, projects as 10 Markdown files
-
Merge into different levels (L0-L3) with script
-
Copy & paste into any AI model, works instantly
git clone https://github.com/s87343472/selfctx.git
cd selfctxEdit these 4 core files in my_pca/:
my_pca/
├── D1_identity.md # Who you are
├── D2_cognitive_os.md # 🔥 Core! AI behavior rules
├── D5_capabilities.md # Your skills
└── D8_projects.md # Current projects
💡 Need examples? Click to view
D2_cognitive_os.md example (Most important file):
# D2 Cognitive OS
## Output Rules
- Always reply in English
- Code must have comments
- Give me 3 options, not 1
## Work Style
- Prefer incremental implementation, no big refactors
- Ask me before making tech choices
## Don'ts
❌ Don't just give code to copy-paste (explain the logic)
❌ Don't use vague words like "should", "might" (be specific)Full examples: See examples/product_manager/
python build.py --level L1 # Generate work version (recommended)This creates exports/L1_work.md
Copy exports/L1_work.md content and paste into:
| AI Model | Where to paste |
|---|---|
| Claude | Project Knowledge |
| ChatGPT | Custom Instructions or start of chat |
| Gemini | System Instructions |
| DeepSeek / Qwen | Start of chat |
Done! AI now remembers you 🎉
You: Write a React component
AI: Here's a basic component...
(generates class component)
You: I need functional, TypeScript, with tests
AI: OK, rewriting...
You: Use our design system
AI: Which design system do you use?
You: Write a React component
AI: Based on your stack (React 18 + TS + Vitest),
using your Ant Design 5.0 specs,
here's a functional component + tests...
[Directly gives code matching your standards]
Time saved: From 30-50 min → 2 min
| Level | Tokens | Contents | Use Case |
|---|---|---|---|
| L0 Public | <500 | Identity tags + behavior rules | Share freely, zero risk |
| L1 Work ⭐ | <2000 | + Projects / expertise / work relationships | Daily AI collaboration (recommended start) |
| L2 Trusted | <5000 | All dimensions, sensitive fields redacted | Long-term primary model |
| L3 Full | Unlimited | Raw data | Local only, never share |
First setup: ~15–30 minEvery migration after: ~2 min
graph TD
D1[D1 Narrative Identity<br>Yearly update] --> D2[D2 Cognitive OS 🔥<br>Quarterly update]
D2 --> D3[D3 Embodied State<br>Monthly update]
D2 --> D4[D4 Emotional State<br>Monthly update]
D2 --> D5[D5 Capabilities<br>Quarterly update]
D5 --> D6[D6 Asset Map<br>Quarterly update]
D5 --> D7[D7 Relationships<br>Quarterly update]
D5 --> D8[D8 Project Snapshot<br>Monthly update]
D1 --> D9[D9 Interests<br>Yearly update]
D1 --> D10[D10 Worldview<br>Yearly update]
style D2 fill:#ff6b6b,color:#fff
style D5 fill:#51cf66,color:#fff
style D8 fill:#ffd93d,color:#000
Click to expand full dimension list
| # | Dimension | Update Freq | Description |
|---|---|---|---|
| D1 | Narrative Identity | Yearly | Who I am (career, education, location) |
| D2 | Cognitive OS | Quarterly | 🔥 Core! Hard rules for AI |
| D3 | Embodied State | Monthly | Health & energy |
| D4 | Emotional & Psychological | Monthly | Optional, current mental state |
| D5 | Capabilities & Expertise | Quarterly | Skills, toolchain |
| D6 | Asset Map | Quarterly | Products / devices / repos |
| D7 | Relationship Network | Quarterly | Work relationships |
| D8 | Project Snapshot | Monthly | 3–12 month window |
| D9 | Interests & Aesthetics | Yearly | Preferences, taste |
| D10 | Worldview & Aspirations | Yearly | Long-term goals, values |
D2 is the core. It stores not preferences but enforced rules — active the moment you paste them.
| Model | L0 | L1 | L2 | Notes |
|---|---|---|---|---|
| Claude Opus 4.8 / Sonnet 4.6 | ✓ | ✓ | ✓ | Full support |
| GPT-5.5 / GPT-5.4 | ✓ | ✓ | ✓ | Full support |
| Gemini 3.1 Pro | ✓ | ✓ | ✓ | Full support |
| Gemini 3 Flash | ✓ | ✓ | △ | Works well |
| Grok 4 / 4.3 | ✓ | ✓ | △ | Works well |
| DeepSeek V3.2 | ✓ | ✓ | △ | Works well |
| Qwen 3.5 | ✓ | ✓ | △ | Works well |
| Mistral Large | ✓ | ✓ | △ | Works well |
✓ Full support · △ Works, some fields less accurately parsed
.gitignore:
# SelfCtx sensitive files
exports/L3_full.md
my_pca/D4_emotional.md
my_pca/D7_relationships.md
Privacy principles:
-
✅ L0/L1 safe to share publicly
-
⚠️ L2 only for trusted primary models -
❌ L3 never upload anywhere
**Q: How is this different from platform Memory?**A: Platform Memory is locked to one model. SelfCtx is local Markdown, portable across all models.
**Q: Do I need programming skills?**A: No. Just edit Markdown files. build.py is optional.
**Q: Won't this use too many tokens?**A: L1 is <2000 tokens (one A4 page). Modern models handle 128K–200K tokens easily.
**Q: How often to update?**A: D2 (Cognitive OS) quarterly, D8 (Projects) monthly, D1/D9/D10 yearly.
**Q: Can teams share this?**A: Yes! Export L0 public version for team standards. Each person adds their personal dimensions.
-
Product Manager - Full B2B SaaS PM config
-
Developer - Full-stack dev tech stack
-
Designer - UI/UX design principles
-
⭐ Star if useful
-
🔀 PRs welcome (especially new profession examples)
MIT License - see LICENSE
If SelfCtx helped you, please ⭐ Star to support!
Made with ❤️ by SagaSu