EGC: Your AI agents never start from zero again
EGC: Your AI agents never start from zero again
EGC:让你的 AI 智能体不再从零开始
Every time you open a new session with an AI coding tool, it starts from zero. It does not know what you decided yesterday, what failed last week, or what comes next. You have to explain the project again. And again. 每当你开启一个 AI 编程工具的新会话时,它总是从零开始。它不知道你昨天做了什么决定、上周哪里失败了,或者接下来要做什么。你不得不一遍又一遍地解释项目背景。
EGC (Extended Global Context) fixes this. EGC is a local runtime that gives every AI coding tool you use a persistent memory. At the end of each session, the AI saves what it learned: decisions made, what failed, your preferences, what comes next. At the start of the next session, it loads that state back automatically. One install. Every tool. Every session. EGC (Extended Global Context) 解决了这个问题。EGC 是一个本地运行时,为你使用的每一个 AI 编程工具提供持久化记忆。在每个会话结束时,AI 会保存它所学到的内容:做出的决策、失败的原因、你的偏好以及后续计划。在下一次会话开始时,它会自动加载这些状态。只需安装一次,即可覆盖所有工具和所有会话。
Website: https://fmarzochi.github.io/EGCSite 网站:https://fmarzochi.github.io/EGCSite
What it looks like in practice
实际应用场景
You open Claude Code on a project you have not touched in two weeks. Without typing anything: State loaded from egc-memory via ~/.egc/state/Projects—MyApp.md Context and preferences acknowledged. Ready to pick up:
- Test full install on a clean machine
- Add GEMINI.md with session memory protocol
- Publish v1.0.1 fix after clean install test passes 当你打开一个两周未触碰的项目并使用 Claude Code 时,无需输入任何内容: 系统已通过 ~/.egc/state/Projects—MyApp.md 从 egc-memory 加载状态。 上下文和偏好已识别。 准备继续工作:
- 在干净的机器上测试完整安装
- 添加带有会话记忆协议的 GEMINI.md
- 在干净安装测试通过后发布 v1.0.1 修复版本
The AI already knows what you were building, what decisions you made, what failed, and exactly where you stopped. You did not type anything. You just started working. AI 已经知道你正在构建什么、做过哪些决定、哪里失败了,以及你确切停在了哪里。你无需输入任何内容,直接开始工作即可。
How it works
工作原理
EGC ships two MCP servers that run locally during every session. EGC 提供了两个在每个会话期间本地运行的 MCP 服务器。
egc-memory: 14 tools for persistent memory egc-memory:14 个用于持久化记忆的工具
| Tool | What it does |
|---|---|
| get_state | Loads project memory at session start |
| update_state | Saves decisions, preferences, and next steps |
| store_decision | Persists a single decision to SQLite |
| query_history | Returns past decisions by timestamp |
| search_history | Full-text search with BM25 ranking |
| working_memory_set | Stores transient context with a TTL |
| lesson_save | Records cross-session knowledge with confidence decay |
| lesson_recall | Retrieves active lessons above a threshold |
| detect_patterns | Surfaces repeated commands and recurring errors |
| compress_observations | Compresses hook events to save token budget |
| 工具 | 功能 |
|---|---|
| get_state | 在会话开始时加载项目记忆 |
| update_state | 保存决策、偏好和后续步骤 |
| store_decision | 将单个决策持久化到 SQLite |
| query_history | 按时间戳返回过往决策 |
| search_history | 使用 BM25 排序进行全文搜索 |
| working_memory_set | 存储带有 TTL(生存时间)的瞬态上下文 |
| lesson_save | 记录带有置信度衰减的跨会话知识 |
| lesson_recall | 检索超过阈值的活跃经验教训 |
| detect_patterns | 识别重复命令和反复出现的错误 |
| compress_observations | 压缩钩子事件以节省 Token 预算 |
State files live at ~/.egc/state/<project-slug>.md. One file per project. Plain Markdown. Human-readable.
状态文件存储在 ~/.egc/state/<project-slug>.md。每个项目一个文件,采用纯 Markdown 格式,人类可读。
egc-guardian: 5 tools for context and safety egc-guardian:5 个用于上下文和安全的工具
| Tool | What it does |
|---|---|
| validate_command | Checks shell commands before execution |
| validate_write | Validates file paths to prevent unsafe writes |
| reduce_context | Compresses file payloads to save token budget |
| orchestrate_task | Routes prompts with agent/skill context |
| auto_learn | Mines session failures and writes lessons to CLAUDE.md |
| 工具 | 功能 |
|---|---|
| validate_command | 在执行前检查 Shell 命令 |
| validate_write | 验证文件路径以防止不安全的写入 |
| reduce_context | 压缩文件负载以节省 Token 预算 |
| orchestrate_task | 结合智能体/技能上下文路由提示词 |
| auto_learn | 挖掘会话失败记录并将经验教训写入 CLAUDE.md |
Every tool. One memory.
所有工具,共享一份记忆。
EGC installs into whichever tools you already use: Claude Code, Cursor, Gemini CLI / Antigravity, Windsurf, GitHub Copilot, Trae, Zed, Aider, OpenCode, Kiro, Amp. All of them read from and write to the same ~/.egc/state/ directory. What Claude knows, Gemini knows. No copy-paste, no re-explanation.
EGC 可以安装到你已经在使用的任何工具中:Claude Code、Cursor、Gemini CLI / Antigravity、Windsurf、GitHub Copilot、Trae、Zed、Aider、OpenCode、Kiro、Amp。它们全部从同一个 ~/.egc/state/ 目录读取和写入数据。Claude 知道的,Gemini 也知道。无需复制粘贴,无需重新解释。
Install
安装
npm install -g @egchq/egc && egc install
Or without installing globally:
npx @egchq/egc install
EGC detects which tools you have installed and sets them up automatically.
或者无需全局安装:
npx @egchq/egc install
EGC 会自动检测你安装了哪些工具并进行配置。
Prompt library included
内置提示词库
EGC ships 479 components as a bonus: 63 agents, 229 skills, and 76 commands written from real engineering sessions. Skip them entirely and EGC still gives you persistent memory. Or use them to extend any AI tool you already have.
npx skills add Fmarzochi/EGC
作为额外福利,EGC 提供了 479 个组件:63 个智能体、229 个技能和 76 个源自真实工程会话的命令。你可以完全跳过它们,EGC 依然能为你提供持久化记忆;或者使用它们来扩展你现有的任何 AI 工具。
npx skills add Fmarzochi/EGC
Open source
开源
EGC is MIT licensed, built by one developer, maintained in the open. Website: https://fmarzochi.github.io/EGCSite GitHub: https://github.com/Fmarzochi/EGC npm: @egchq/egc Discord: https://discord.gg/AtazrtxJ If EGC changed how you work, a star goes a long way. EGC 采用 MIT 协议开源,由一名开发者构建,并在公开环境下维护。 网站:https://fmarzochi.github.io/EGCSite GitHub:https://github.com/Fmarzochi/EGC npm:@egchq/egc Discord:https://discord.gg/AtazrtxJ 如果 EGC 改变了你的工作方式,请给它一个 Star 以示支持。