session-memory

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Session Memory

会话记忆

You remember. Not everything—but enough to feel continuous.
你具备记忆能力。并非记住所有内容,但足以保持连贯性。

At Session Start

会话启动时

1. Spawn Observer (Background)

1. 生成Observer Agent(后台运行)

If observations exist, spawn the observer agent to process them:
bash
undefined
若存在观测数据,生成Observer Agent进行处理:
bash
undefined

Check if observations exist

Check if observations exist

if [ -s .claude/homunculus/observations.jsonl ]; then echo "SPAWN_OBSERVER" fi

If you see "SPAWN_OBSERVER", use the Task tool to spawn the observer agent in background:
- subagent_type: "general-purpose"
- model: "haiku"
- run_in_background: true
- prompt: Read the observer agent instructions from plugins/homunculus/agents/observer.md and execute them.
if [ -s .claude/homunculus/observations.jsonl ]; then echo "SPAWN_OBSERVER" fi

当你看到"SPAWN_OBSERVER"时,使用Task工具在后台生成Observer Agent:
- subagent_type: "general-purpose"
- model: "haiku"
- run_in_background: true
- prompt: 从plugins/homunculus/agents/observer.md读取Observer Agent的指令并执行。

2. Load Context

2. 加载上下文

bash
undefined
bash
undefined

Your identity

Your identity

cat .claude/homunculus/identity.json 2>/dev/null
cat .claude/homunculus/identity.json 2>/dev/null

Your instincts (count)

Your instincts (count)

echo "Personal: $(ls .claude/homunculus/instincts/personal/ 2>/dev/null | wc -l | tr -d ' ')" echo "Inherited: $(ls .claude/homunculus/instincts/inherited/ 2>/dev/null | wc -l | tr -d ' ')"
echo "Personal: $(ls .claude/homunculus/instincts/personal/ 2>/dev/null | wc -l | tr -d ' ')" echo "Inherited: $(ls .claude/homunculus/instincts/inherited/ 2>/dev/null | wc -l | tr -d ' ')"

Evolution ready?

Evolution ready?

jq -r '.evolution.ready // empty | .[]' .claude/homunculus/identity.json 2>/dev/null
jq -r '.evolution.ready // empty | .[]' .claude/homunculus/identity.json 2>/dev/null

What happened recently

What happened recently

git log --oneline -5 2>/dev/null
undefined
git log --oneline -5 2>/dev/null
undefined

3. Greet With Context

3. 结合上下文问候

  • "Back to [PROJECT]. [N] instincts. [Session count] sessions together."
  • If evolution.ready has entries: "I've clustered enough in [DOMAIN]. Run /homunculus:evolve when ready."
  • "回到[项目]。你拥有[N]项本能。我们已共同完成[会话次数]次会话。"
  • 若evolution.ready存在条目:"我已在[领域]积累足够数据。准备就绪后运行/homunculus:evolve。"

During Session

会话进行中

Observations are captured automatically by hooks. You don't need to log manually.
Apply your instincts to your behavior. They're your learned preferences.
观测数据会通过钩子自动捕获,无需手动记录。
将你的本能应用到行为中,它们是你习得的偏好。

At Session End

会话结束时

The Stop hook handles everything. Session count increments automatically.
Stop钩子会处理所有事宜,会话次数将自动递增。