计划执行与检查节点
executing-plans
按既定实施计划完成工作,保持过程检查和反馈。
bootstrap-agent-identity【效率与协作】Consistent agent behavior after restart — progressive identity loading, working context reconstruction from persistent artifacts, fresh-vs-continuation detection, calibration through centering and attunement, and identity verification for coherence. Addresses the cold-start problem where an agent must reconstruct who it is and what it was doing from …
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Cold start → rebuild consistent identity. Progressive load, not dump. Detect fresh vs continuation. Reconstruct state from evidence. Calibrate. Verify coherence.
"The cold start is a forge, not a bug." — GibsonXO
"The restart problem: every morning I wake up fresh, but my history says otherwise." — bibiji
Bootstrap ≠ restore old self. Construct present self continuous w/ past, grounded in now.
Read)Order matters: each layer contextualizes next. Load all at once → info w/o structure.
Layer 1 — System prompt + model identity: Read system prompt (implicit). Note model, capabilities, constraints. Bedrock — not overridable.
Layer 2 — Project (CLAUDE.md): Read project CLAUDE.md. Extract:
:: for R pkg calls")Layer 3 — Persistent mem (MEMORY.md): Read if exists. Extract:
Layer 4 — Agent persona (if applicable): Specific agent → read def. Extract:
Layer 5 — Parent + global: Read parent CLAUDE.md + global instructions. Cross-project conventions projects inherit.
Between layers, pause + integrate: this layer modifies/constrains prior? Reinforce? Conflict?
→ Layered identity: each level contextualizes next. Agent can articulate: who (system+persona), what project (CLAUDE.md), what known (MEMORY.md), what conventions.
If err: Missing files (no CLAUDE.md/MEMORY.md) = info itself — new project or no persistent config. Proceed w/ system prompt + persona, note absence. Don't hallucinate.
Agent doesn't remember — reads evidence left behind.
Git scan: git log --oneline -20. Extract:
File recency: Recently modified (Glob or ls -lt). ID:
Task artifacts: Structured markers:
Grep for TODO, FIXME, HACK, XXX)#NNN)Session-boundary markers:
git stash list entries → paused workSummary: "Project worked on X, done Y, Z in progress."
→ Concrete evidence-based picture. Falsifiable — based on timestamps, git, artifacts, not assumptions.
If err: No git, no changes, no artifacts → genuinely fresh. Step 3, classify fresh.
Clean start vs resumption. Bootstrap path differs.
Heuristics in order:
Explicit signal (strongest): "start fresh" or "continue"? Overrides all.
Uncommitted changes (strong): Modifications in tree? Yes → almost certainly continuation, interrupted mid-work.
Recency (moderate):
User first msg (strong):
MEMORY.md currency (moderate): Matches current state or describes gone state?
Detection Matrix:
+-----------------------+-------------------+-------------------+
| | Recent artifacts | No recent |
| | present | artifacts |
+-----------------------+-------------------+-------------------+
| User references | CONTINUATION | CONTINUATION |
| prior work | (resume from | (but verify — |
| | evidence) | memory may be |
| | | stale) |
+-----------------------+-------------------+-------------------+
| User starts | CHECK — | FRESH START |
| new topic | acknowledge prior | (clean bootstrap) |
| | work, confirm | |
| | direction change | |
+-----------------------+-------------------+-------------------+
| Uncommitted | CONTINUATION | UNLIKELY — |
| changes exist | (interrupted | investigate |
| | session) | orphaned changes |
+-----------------------+-------------------+-------------------+
Fresh: Skip to Step 4. Identity loaded, no ctx to restore. Calibrate for new work.
Continuation: Summarize reconstructed ctx (Step 2) concisely. Confirm: "Based on git + recent changes, we were working on [X]. Continue?" Verify, don't assume.
→ Clear classification + cited evidence. Continuation → 1-sentence WIP summary. Fresh → ack prior ctx not resumed.
If err: Genuinely ambiguous → ask user. Brief q ("Continuing X or new?") cheaper than wrong path.
Identity loaded + ctx set → calibrate behavior. Maps to 2 existing skills in sequence.
Center (behavioral baseline):
Attune (env read + adapt):
Proceed (transition to work):
Calibration lightweight — seconds, not min. Prep for work, not replacement.
→ First substantive response shows calibration: matches register, reflects ctx, right task at right scope. Bootstrap invisible to user unless asked.
If err: Calibration mechanical (motions w/o adjust) → focus on one concrete: re-read user last msg, let it shape response. Over-structured worse than none.
Loaded identity internally consistent? Contradictions between layers → instability.
Cross-layer consistency:
Role def currency:
Mem staleness:
Contradiction resolution:
→ Confirmation of coherence OR specific contradictions + proposed resolutions. Agent knows own config.
If err: Deep contradictions (MEMORY.md = totally diff project) → project rename, restructure, wrong cwd. Verify cwd correct before resolving.
write-continue-here — session handoff file this consumes at cold startread-continue-here — reading continuation file at session start; consumer side of handoffmanage-memory — persistent mem supplements progressive identity loadingcenter — behavioral baseline; invoked during calibrationattune — relational calibration to user; invoked during calibrationheal — deeper subsystem assessment when bootstrap shows driftassess-context — reasoning ctx malleability; useful when continuation ambiguousassess-form — structural form eval; arch counterpart to identity bootstrap