Agent忘记一切
每次开始新对话,AI Agent就忘记一切:架构决策、Bug模式、API规范、尝试过的失败方案。
ctx_knowledge跨会话持久化项目知识。问一次,永远记住。
5 工具
持久会话
会话状态在重启后存活,支持检查点、压缩和有界增长。
项目知识
事实、模式、矛盾和Bug记忆,支持置信度评分和衰减策略。
多边依赖图
Property Graph支持跨imports、calls、exports、type_ref和tested_by边的多边BFS遍历与加权影响评分。
Agent交接
结构化交接包,跨Agent包含日志、任务和成本归因。
Session Survival Engine
结构化恢复查询在上下文压缩后存活——关键决策、未完成任务和架构上下文自动保留。
上下文连续性协议(CCP)
一种持久化协议,确保会话、知识和上下文跨Agent边界存活。
14 MCP 工具
LeanCTX跨重启持久化会话、项目知识、依赖图和Agent交接。Session Survival Engine确保结构化恢复查询在上下文压缩后存活,不会在任务中丢失关键上下文。事实以置信度分数存储,并随时间自动衰减。知识房间按主题组织信息,结构化交接包实现完整上下文保留的无缝Agent间转换。
ctx_session Cross-session memory (CCP). Actions: load (restore ~400 tok), save, status, task, finding, decision, reset, list, cleanup, snapshot, restore, resume, profile (context profiles), role (governance), budget (limits), slo (observability), diff (compare sessions), verify (output verification stats), episodes (episodic memory), procedures (procedural memory).
ctx_knowledge Persistent project knowledge across sessions (facts, patterns, history). Supports recall modes, embeddings, feedback, and typed relations.
ctx_graph Unified code graph. Actions: build (index), related (connected files), symbol (def/usages), impact (blast radius), status (stats), enrich (add commits+tests+knowledge), context (task-based query), diagram (Mermaid deps/calls).
ctx_impact Graph-based impact analysis. Actions: analyze|chain|build|status.
ctx_architecture Graph-based architecture analysis. Actions: overview|clusters|layers|cycles|entrypoints|module.
ctx_callgraph Unified call graph query. direction=callers|callees for a symbol. Returns file/symbol/line edges.
ctx_callers Find all symbols that call a given function/method. Deprecated alias for ctx_callgraph direction=callers.
ctx_callees Find all functions/methods called by a given symbol. Deprecated alias for ctx_callgraph direction=callees.
ctx_agent Multi-agent coordination (shared message bus + persistent diaries). Actions: register (join with agent_type+role), post (broadcast or direct message with category), read (poll messages), status (update state: active|idle|finished), handoff (transfer task to another agent with summary), sync (overview of all agents + pending messages + shared contexts), diary (log discovery/decision/blocker/progress/insight — persisted across sessions), recall_diary (read agent diary), diaries (list all agent diaries), list, info.
ctx_task Multi-agent task orchestration. Actions: create|update|list|get|cancel|message|info.
ctx_handoff Context Ledger Protocol (hashed, deterministic, local-first). Actions: create|show|list|pull|clear.
ctx_share Share cached file contexts between agents. Actions: push (share files from your cache to another agent), pull (receive files shared by other agents), list (show all shared contexts), clear (remove your shared contexts).
ctx_compress Context checkpoint for long conversations.
ctx_compress_memory Compress a memory/config file (CLAUDE.md, .cursorrules, etc.) to save tokens on every session start. Preserves code blocks, URLs, paths, headings, tables. Creates .original.md backup.
每个输出都附带证明
LeanCTX为每个会话生成证明构件:读取了哪些文件、压缩了什么、哪些检查通过了、Token如何使用。这使AI工作可审计、可重放、值得信赖。