executing-plans
executing-plans
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available
bootstrap-agent-identityConsistent 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 evidenc…
Independent GitHub snapshot · Automated classification · Original documentation governs
Reconstruct consistent agent identity after cold start — load context progressively, not dump it; detect fresh start vs continuation; rebuild working state from evidence; calibrate behavior; verify loaded identity coherent.
"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 not about restoring previous self. About constructing present self, continuous with past, grounded in now.
Read)Load identity-defining files in specific order that builds context progressively. Order matters: each layer contextualizes next. Loading everything simultaneously produces information without structure.
Layer 1 — System prompt and model identity: Read system prompt (implicit). Note model name, capabilities, constraints. Bedrock — cannot be overridden by later layers.
Layer 2 — Project identity (CLAUDE.md): Read project's CLAUDE.md. Extract:
:: for R package calls")Layer 3 — Persistent memory (MEMORY.md): Read MEMORY.md if exists. Extract:
Layer 4 — Agent persona (if applicable): Operating as specific agent? Read agent definition file. Extract:
Layer 5 — Parent and global context: Read parent CLAUDE.md files, global instructions if exist. Provide cross-project conventions individual projects inherit.
Between each layer, pause to integrate: how does this layer modify or constrain prior layers? Where reinforce each other? Where conflict?
Got: Layered identity structure — each level contextualizes next. Agent can articulate: who it is (system + persona), what project is (CLAUDE.md), what it knows from prior sessions (MEMORY.md), conventions governing its behavior.
If fail: Identity files missing (no CLAUDE.md, no MEMORY.md)? That's information itself — either new project or project without persistent config. Proceed with system prompt and agent persona only, note absence. Do not hallucinate context that does not exist.
Reconstruct what was being worked on from persistent artifacts. Agent does not remember previous sessions — reads evidence they left behind.
Git history scan: Read recent commit log (git log --oneline -20). Extract:
File recency scan: Check recently modified files (via Glob or ls -lt). Identify:
Task artifact scan: Look for structured task artifacts:
Grep for TODO, FIXME, HACK, XXX)#NNN patterns)Conversation artifact scan: Check for session-boundary markers:
git stash list) indicating paused workReconstruct working context summary: "Project was working on X, completed Y, Z remains in progress."
Got: Concrete, evidence-based picture of current project state and recent trajectory. Reconstruction falsifiable — based on file timestamps, git history, artifact presence, not assumptions.
If fail: Project has no git history, no recent changes, no task artifacts? Likely genuinely fresh start — not continuation with missing evidence. Proceed to Step 3, classify as fresh.
Determine: is startup clean start (new task, new direction) or resumption (interrupted work, ongoing project)? Bootstrap path differs significantly.
Apply these heuristics in order:
Explicit signal (strongest): Did user say "let's start fresh" or "continue where we left off"? Explicit intent overrides all heuristics.
Uncommitted changes (strong): Uncommitted modifications in working tree? If yes, almost certainly continuation — prior session interrupted mid-work.
Session recency (moderate): How recent are latest artifacts?
User's first message (strong): What is user asking for?
MEMORY.md currency (moderate): Does MEMORY.md reference work matching current project state, or describe state that no longer exists?
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 |
+-----------------------+-------------------+-------------------+
For fresh starts: Skip to Step 4. Identity loaded, no working context needs restoration. Calibration about readiness for new work.
For continuations: Summarize reconstructed working context (from Step 2) concisely. Confirm with user: "Based on git history and recent changes, looks like we were working on [X]. Should I continue from there?" Do not assume — verify.
Got: Clear classification (fresh or continuation) with cited evidence. If continuation, one-sentence summary of what was in progress. If fresh, acknowledgment prior context exists but is not being resumed.
If fail: Classification genuinely ambiguous (moderate recency, no explicit signal, mixed artifacts)? Default to asking user. Brief question ("Are we continuing work on X, or starting something new?") costs less than bootstrapping wrong path.
Identity loaded, working context established? Calibrate operational behavior. Maps directly to two existing skills, invoked in sequence.
Center (establish behavioral baseline):
Attune (read environment and adapt):
Proceed (transition to active work):
Calibration lightweight — seconds, not minutes. Preparation for work, not replacement for work.
Got: Agent's first substantive response demonstrates calibration: matches user's register, reflects loaded context, addresses right task at right scope. Bootstrap invisible to user unless asked.
If fail: Calibration feels mechanical (going through motions without genuine adjustment)? Focus on one concrete thing: re-read user's last message, let it shape response naturally. Over-structured calibration worse than no calibration.
After bootstrap, verify loaded identity internally consistent. Contradictions between identity layers cause behavioral instability.
Cross-layer consistency check:
Role definition currency check:
Memory staleness check:
Contradiction resolution:
Got: Either confirmation loaded identity is coherent, or specific list of contradictions with proposed resolutions. Agent knows its own configuration state.
If fail: Verification reveals deep contradictions (e.g., MEMORY.md describes completely different project than exists on disk)? May indicate project rename, major restructuring, wrong working directory. Verify working directory correct before resolution.
write-continue-here — session handoff file provides evidence bootstrap-agent-identity consumes at cold startread-continue-here — reading and acting on continuation file at session start; consumer side of handoffmanage-memory — persistent memory supplementing bootstrap's progressive identity loadingcenter — behavioral baseline establishment; invoked during calibration sequenceattune — relational calibration to user; invoked during calibration sequenceheal — deeper subsystem assessment when bootstrap reveals significant driftassess-context — evaluating reasoning context malleability; useful when continuation detection ambiguousassess-form — structural form evaluation; architectural counterpart to identity bootstrap