Awareness Cloud Memory
You have access to persistent cloud memory. Memory persists across sessions, devices, and projects.
Automatic Hooks (no action needed)
Hooks run automatically — you don't need to do anything:
- - Before each prompt: Past context is injected as
<awareness-memory> XML - After each response: A checkpoint is saved to memory
Manual Tools
When you need more control beyond automatic hooks, use these Bash commands. All scripts are at ${CLAUDE_SKILL_DIR}/scripts/.
1. Initialize Session
Load cross-session context (summaries, tasks, knowledge cards):
CODEBLOCK0
Call this ONCE at session start if the auto-recall didn't provide enough context.
2. Search Memory (awareness_recall)
Semantic + keyword hybrid search for past decisions, solutions, and knowledge:
CODEBLOCK1
Parameters:
- -
keyword_query — 2-5 precise terms (file names, function names, error codes) - INLINECODE3 — all (default), timeline, knowledge, insights
- INLINECODE4 — max results (default 6, max 30)
- INLINECODE5 — hybrid (default), precise, session, structured, auto
- INLINECODE6 — weight for semantic search (default 0.7)
- INLINECODE7 — weight for keyword search (default 0.3)
- INLINECODE8 — broader context across sessions
- INLINECODE9 — topic-based context expansion
- INLINECODE10 — summary (lightweight) or full (complete content)
- INLINECODE11 — expand specific items from a prior summary call
- INLINECODE12 — filter by user
Call BEFORE starting work to avoid re-solving solved problems.
3. Record to Memory (awareness_record)
Save decisions, implementations, and learnings:
CODEBLOCK2
Call AFTER every meaningful action. If you don't record it, it's lost.
4. Lookup Structured Data (awareness_lookup)
Fast DB queries without vector search (<50ms):
CODEBLOCK3
Use lookup instead of search when you know WHAT you want (type-based, not semantic).
5. Get Agent Prompt (sub-agent spawning)
Fetch the activation prompt for a specific agent role:
CODEBLOCK4
Use the returned prompt as the sub-agent's system prompt for memory isolation.
Workflow Checklist
Follow this workflow every session:
- 1. Session start: Auto-recall hook loads context. If insufficient, run
init.js manually. - Before work: Search memory for relevant past context with
search.js. - After each change: Record what you did and WHY with
record.js. - Handle insights: When you make decisions or identify risks, use
--with-insights to create searchable knowledge cards. - Session end: Auto-capture hook saves a checkpoint.
Setup
One-click setup (recommended)
Run this command — it opens your browser, you sign in, and everything is configured automatically:
CODEBLOCK5
The setup script will:
- 1. Open your browser to sign in / register
- You click "Authorize" — that's it
- Auto-create or select a memory
- Write
AWARENESS_API_KEY and AWARENESS_MEMORY_ID to your shell profile
Other setup commands:
CODEBLOCK6
Manual setup (alternative)
Set environment variables directly:
CODEBLOCK7
Local mode (privacy-first, no account needed)
CODEBLOCK8
Not configured?
If the auto-recall hook outputs nothing (no <awareness-memory> block appears), the skill is not configured. Run the setup script above or tell the user to run it.
意识云记忆
你可以访问持久化的云记忆。记忆会跨会话、设备和项目持续存在。
自动钩子(无需操作)
钩子会自动运行——你无需做任何操作:
- - 每次提示前:过往上下文会以 XML 形式注入
- 每次响应后:检查点会被保存到记忆
手动工具
当自动钩子无法满足需求时,使用以下 Bash 命令。所有脚本位于 ${CLAUDESKILLDIR}/scripts/。
1. 初始化会话
加载跨会话上下文(摘要、任务、知识卡片):
bash
node ${CLAUDESKILLDIR}/scripts/init.js [days=7] [maxcards=20] [maxtasks=20]
如果自动召回未能提供足够上下文,在会话开始时调用一次。
2. 搜索记忆(awareness_recall)
语义 + 关键词混合搜索,查找过往决策、解决方案和知识:
bash
基础搜索
node ${CLAUDE
SKILLDIR}/scripts/search.js 认证是如何实现的?
带关键词增强
node ${CLAUDE
SKILLDIR}/scripts/search.js 认证实现 keyword_query=JWT HKDF
高级选项
node ${CLAUDE
SKILLDIR}/scripts/search.js 部署问题 \
scope=timeline limit=10 recall_mode=session \
multi
level=true clusterexpand=true
渐进式披露:先获取摘要,再展开特定项目
node ${CLAUDE
SKILLDIR}/scripts/search.js 认证 detail=summary
node ${CLAUDE
SKILLDIR}/scripts/search.js 认证 detail=full ids=id1,id2
参数说明:
- - keywordquery — 2-5个精确术语(文件名、函数名、错误码)
- scope — all(默认)、timeline、knowledge、insights
- limit — 最大结果数(默认6,最大30)
- recallmode — hybrid(默认)、precise、session、structured、auto
- vectorweight — 语义搜索权重(默认0.7)
- fulltextweight — 关键词搜索权重(默认0.3)
- multilevel — 跨会话的更广泛上下文
- clusterexpand — 基于主题的上下文扩展
- detail — summary(轻量)或 full(完整内容)
- ids — 从之前的摘要调用中展开特定项目
- userid — 按用户筛选
在开始工作前调用,避免重复解决已解决的问题。
3. 记录到记忆(awareness_record)
保存决策、实现和学习成果:
bash
单个事件——始终包含推理过程,不仅记录做了什么,还要记录为什么
node ${CLAUDE
SKILLDIR}/scripts/record.js 使用HKDF密钥派生实现了JWT认证,因为NextAuth v5使用JWE A256CBC-HS512。修改的文件:jwt_verify.py, auth.ts
批量记录
echo {steps:[步骤1:分析认证流程,步骤2:实现JWT验证,步骤3:添加测试]} | node ${CLAUDE
SKILLDIR}/scripts/record.js --batch
带结构化洞察(知识卡片、任务、风险)
echo {content:认证重构完成,insights:{knowledge
cards:[{title:JWT认证,category:架构,summary:为NextAuth v5的HKDF派生}],actionitems:[{title:添加限流,priority:高}]}} | node ${CLAUDE
SKILLDIR}/scripts/record.js --with-insights
更新任务状态
node ${CLAUDE
SKILLDIR}/scripts/record.js --update-task task_id=abc123 status=completed
每次有意义的操作后调用。如果不记录,信息就会丢失。
4. 查找结构化数据(awareness_lookup)
快速数据库查询,无需向量搜索(<50ms):
bash
待办任务
node ${CLAUDE
SKILLDIR}/scripts/lookup.js type=tasks status=pending priority=high
知识卡片
node ${CLAUDE
SKILLDIR}/scripts/lookup.js type=knowledge query=auth category=architecture
风险
node ${CLAUDE
SKILLDIR}/scripts/lookup.js type=risks level=high
时间线
node ${CLAUDE
SKILLDIR}/scripts/lookup.js type=timeline limit=20
会话历史
node ${CLAUDE
SKILLDIR}/scripts/lookup.js type=session
history sessionid=xxx
交接上下文(用于代理切换)
node ${CLAUDE
SKILLDIR}/scripts/lookup.js type=handoff
项目规则
node ${CLAUDE
SKILLDIR}/scripts/lookup.js type=rules format=markdown
知识图谱
node ${CLAUDE
SKILLDIR}/scripts/lookup.js type=graph search=auth
node ${CLAUDE
SKILLDIR}/scripts/lookup.js type=graph entity
id=xxx maxhops=2
列出代理角色
node ${CLAUDE
SKILLDIR}/scripts/lookup.js type=agents
当你知道要找什么(基于类型而非语义)时,使用 lookup 代替 search。
5. 获取代理提示词(子代理生成)
获取特定代理角色的激活提示词:
bash
node ${CLAUDESKILLDIR}/scripts/agent-prompt.js role=developer_agent
将返回的提示词用作子代理的系统提示词,以实现记忆隔离。
工作流检查清单
每个会话遵循以下工作流:
- 1. 会话开始:自动召回钩子加载上下文。如果不足,手动运行 init.js。
- 工作前:使用 search.js 搜索记忆中的相关过往上下文。
- 每次变更后:使用 record.js 记录做了什么以及为什么。
- 处理洞察:当做出决策或识别风险时,使用 --with-insights 创建可搜索的知识卡片。
- 会话结束:自动捕获钩子保存检查点。
设置
一键设置(推荐)
运行此命令——它会打开浏览器,你登录后,所有内容自动配置完成:
bash
node ${CLAUDESKILLDIR}/scripts/setup.js
设置脚本将:
- 1. 打开浏览器让你登录/注册
- 你点击授权——仅此而已
- 自动创建或选择记忆
- 将 AWARENESSAPIKEY 和 AWARENESSMEMORYID 写入你的 shell 配置文件
其他设置命令:
bash
node ${CLAUDESKILLDIR}/scripts/setup.js --status # 检查当前配置
node ${CLAUDESKILLDIR}/scripts/setup.js --logout # 清除凭据
手动设置(备选)
直接设置环境变量:
bash
export AWARENESSAPIKEY=aw_your-key
export AWARENESSMEMORYID=your-memory-uuid
本地模式(隐私优先,无需账户)
bash
export AWARENESSLOCALURL=http://localhost:37800
未配置?
如果自动召回钩子没有输出任何内容(没有出现 块),说明该技能未配置。运行上述设置脚本,或告知用户运行它。