bootstrap-agent-identity
À propos
Cette compétence permet à un agent de reconstruire son identité et son contexte de travail à partir d'artefacts persistants après un redémarrage ou un plantage, résolvant ainsi le problème de démarrage à froid. Elle effectue un chargement progressif de l'identité, une détection de session nouvelle ou de continuation, et un calibrage pour garantir un comportement cohérent entre les sessions. Les développeurs doivent l'utiliser au début de chaque nouvelle session ou lorsque le comportement de l'agent semble incohérent avec les interactions précédentes.
Installation rapide
Claude Code
Recommandé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-identityCopiez et collez cette commande dans Claude Code pour installer cette compétence
Documentation
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
Dépôt GitHub
Compétences associées
executing-plans
DesignUtilisez la compétence executing-plans lorsque vous disposez d'un plan de mise en œuvre complet à exécuter par lots contrôlés avec des points de contrôle de revue. Elle charge et examine le plan de manière critique, puis exécute les tâches par petits lots (3 tâches par défaut) tout en rapportant la progression entre chaque lot pour une revue par l'architecte. Cela garantit une mise en œuvre systématique avec des points de contrôle de qualité intégrés.
requesting-code-review
DesignCette compétence délègue un sous-agent réviseur de code pour analyser les modifications apportées au code par rapport aux exigences avant de poursuivre. Elle doit être utilisée après avoir terminé des tâches, implémenté des fonctionnalités majeures, ou avant une fusion vers la branche principale. La revue aide à détecter précocement les problèmes en comparant l'implémentation actuelle avec le plan initial.
connect-mcp-server
DesignCette compétence fournit un guide complet permettant aux développeurs de connecter des serveurs MCP à Claude Code via les transports HTTP, stdio ou SSE. Elle couvre l'installation, la configuration, l'authentification et la sécurité pour intégrer des services externes tels que GitHub, Notion et des API personnalisées. Utilisez-la lors de la configuration d'intégrations MCP, de la configuration d'outils externes ou du travail avec le Protocole de Contexte de Modèle de Claude.
web-cli-teleport
DesignCette compétence aide les développeurs à choisir entre les interfaces Web et CLI de Claude Code en fonction de l'analyse des tâches, puis permet une téléportation transparente des sessions entre ces environnements. Elle optimise le flux de travail en gérant l'état et le contexte de la session lors du passage entre le web, la CLI ou le mobile. Utilisez-la pour des projets complexes nécessitant différents outils à diverses étapes.
