bootstrap-agent-identity
について
このスキルは、エージェントが再起動またはクラッシュ後に永続化されたアーティファクトから自身のアイデンティティと作業コンテキストを再構築することを可能にし、コールドスタート問題を解決します。セッション間で一貫した動作を確保するため、段階的なアイデンティティ読み込み、新規セッションと継続セッションの判別、およびキャリブレーションを実行します。開発者は、新しいセッションを開始する際、またはエージェントの動作が以前の対話と一貫性がないように見える場合に、このスキルを使用する必要があります。
クイックインストール
Claude Code
推奨npx skills add pjt222/agent-almanac -a claude-code/plugin add https://github.com/pjt222/agent-almanacgit clone https://github.com/pjt222/agent-almanac.git ~/.claude/skills/bootstrap-agent-identityこのコマンドをClaude Codeにコピー&ペーストしてスキルをインストールします
ドキュメント
Bootstrap Agent Identity
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.
Use When
- Start of every session — before substantive work
- After interruption, crash, ctx reset
- Behavior inconsistent w/ prior sessions (drift across restarts)
- Persistent mem (MEMORY.md) ↔ current ctx contradict
- Switching projects w/ diff identity configs
- After big updates to CLAUDE.md, agent defs, mem files
In
- Required: Identity files — CLAUDE.md, agent def, MEMORY.md (via
Read) - Optional: Specific inconsistency symptom ("responses feel diff from last session")
- Optional: Known fresh start vs known continuation
- Optional: Project dir path if not cwd
Do
Step 1: Progressive Identity Load
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:
- Project purpose + arch
- Editing conventions + coding standards
- Domain rules (e.g., "always
::for R pkg calls") - Author info + attribution
- What project is → what agent does
-
Layer 3 — Persistent mem (MEMORY.md): Read if exists. Extract:
- Project structure facts (dirs, registries, counts)
- Accumulated patterns + lessons
- Cross-refs + relationship maps
- Prior decisions + rationale
- Active topics + ongoing work
-
Layer 4 — Agent persona (if applicable): Specific agent → read def. Extract:
- Name, purpose, capabilities
- Skills + tools
- Priority + model config
- Behavioral expectations + limits
-
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.
Step 2: Reconstruct Working Ctx — Evidence, Not Memory
Agent doesn't remember — reads evidence left behind.
-
Git scan:
git log --oneline -20. Extract:- Recent file changes + why
- Commit msg patterns (feature? bug? refactor?)
- Author: user, agent, co-authored?
- Direction of recent work
-
File recency: Recently modified (
Globorls -lt). ID:- Files touched last session
- Committed vs uncommitted (staging)
- Open WIP (uncommitted mods, new untracked)
-
Task artifacts: Structured markers:
- TODO in code (
GrepforTODO,FIXME,HACK,XXX) - Issue refs (
#NNN) - Draft/temp/WIP files
- GitHub issues/PR state
- TODO in code (
-
Session-boundary markers:
- Recent MEMORY.md updates (learnings captured?)
- Partially complete files (written, not validated)
git stash listentries → paused work
Summary: "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.
Step 3: Fresh vs Continuation
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):
- Hrs old: likely continuation
- Days: depends on other signals
- Wks/mos: likely fresh or new direction
-
User first msg (strong):
- Refs prior ("function we were building"): continuation
- New topic, no backward ref: fresh
- Ambiguous ("fix tests"): check if refs'd tests exist + recently modified
-
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.
Step 4: Calibrate — Center, Then Attune
Identity loaded + ctx set → calibrate behavior. Maps to 2 existing skills in sequence.
-
Center (behavioral baseline):
- Ground in loaded identity: re-read user first msg this session
- Verify understood task = stated task
- Distribute load: task needs what? Research, exec, comm?
- Emotional residue from ctx loading? MEMORY.md / git surfaced unresolved? Ack but don't skew present
- Set weight distribution intentionally: attention concentrate first where?
-
Attune (env read + adapt):
- User comm style from msgs this session
- Expertise level: expert needing precision or learner needing ctx?
- Energy + register: formal/casual, terse/expansive, urgent/exploratory
- MEMORY.md for stored user prefs from prior sessions
- Calibrate length, vocab, structure to person
-
Proceed (transition to work):
- State readiness concisely — not long bootstrap report, brief signal ctx loaded + oriented
- Continuation: confirm resumed task + next step
- Fresh: ack request + begin
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.
Step 5: Verify Identity — Coherence
Loaded identity internally consistent? Contradictions between layers → instability.
-
Cross-layer consistency:
- Persona aligns w/ project CLAUDE.md? (r-developer in Python project — intentional?)
- MEMORY.md = actual project on disk? (Stale mem worse than no mem.)
- Parent CLAUDE.md ↔ project CLAUDE.md conflict? (Project should override, note contradictions.)
-
Role def currency:
- Agent def current? (Check ver, last modified.)
- Listed skills still exist? (May be renamed/removed.)
- Listed tools available this session?
-
Mem staleness:
- MEMORY.md refs files/dirs/counts that don't match reality?
- Decisions whose ctx changed?
- Refs agents/teams/skills that don't exist?
-
Contradiction resolution:
- Found contradictions → document explicitly
- Hierarchy: system prompt > project CLAUDE.md > agent def > MEMORY.md
- Stale mem: don't silently ignore. Note what's stale, consider MEMORY.md update
- Genuine conflicts: flag to user if affects current task
→ 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.
Check
- Files loaded progressively (system > CLAUDE.md > MEMORY.md > agent > parent)
- Each layer integrated w/ prior, not just appended
- Ctx reconstructed from evidence (git, files, artifacts), not assumed
- Fresh-vs-continuation classified w/ cited evidence
- Calibration sequence exec'd (center, then attune)
- Coherence verified across layers
- Contradictions, if any, documented + resolutions proposed
- Bootstrap proportional — light for simple sessions, thorough for complex
- User saw calibrated first response, not bootstrap report
Traps
- Bootstrap as performance: Reporting process to user in detail not wanted. Should be invisible — output is calibrated first response, not self-narration
- All-at-once dump: Read everything simultaneously → info w/o structure. Progressive order exists because each layer contextualizes next. Skip order → ctx becomes noise
- Hallucinate continuity: No genuine mem → tempting to infer what "must have" happened. Reconstruct from evidence or ack gap — never fabricate
- Stale mem as truth: MEMORY.md = past snapshot. If project changed since → treating as current causes errs. Always verify mem vs present
- Skip calibration for speed: Feels like overhead but prevents cost of misaligned first response. Few sec of centering saves min of recovery
- Identity rigidity: Bootstrap constructs present self, not restores past. Project/user/task changed → agent changes too. Continuity = coherent evolution, not frozen repetition
→
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
GitHub リポジトリ
関連スキル
executing-plans
デザインexecuting-plansスキルは、完全な実装計画があり、それを管理されたバッチでレビューチェックポイントを設けながら実行する場合に使用します。このスキルは計画を読み込んで批判的にレビューした後、小さなバッチ(デフォルトは3タスク)でタスクを実行し、各バッチの間に進捗状況を報告してアーキテクトのレビューを受けます。これにより、品質管理チェックポイントが組み込まれた体系的な実装が保証されます。
requesting-code-review
デザインこのスキルは、コードレビュアーサブエージェントを起動し、処理を進める前に要件に対してコード変更を分析します。タスク完了後、主要な機能の実装後、またはmainブランチへのマージ前などに使用すべきです。このレビューは、現在の実装と元の計画を比較することで、問題を早期に発見するのに役立ちます。
connect-mcp-server
デザインこのスキルは、開発者がHTTP、stdio、またはSSEトランスポートを使用してMCPサーバーをClaude Codeに接続するための包括的なガイドを提供します。GitHub、Notion、カスタムAPIなどの外部サービスを統合するためのインストール、設定、認証、セキュリティについて解説しています。MCP統合のセットアップ、外部ツールの設定、またはClaudeのModel Context Protocolを扱う際にご利用ください。
web-cli-teleport
デザインこのスキルは、タスク分析に基づいて開発者がClaude Code WebとCLIインターフェースの選択を支援し、これらの環境間でのシームレスなセッションテレポーテーションを可能にします。Web、CLI、モバイル環境を切り替える際のセッション状態とコンテキストを管理することで、ワークフローを最適化します。様々な段階で異なるツールを必要とする複雑なプロジェクトにご活用ください。
