Bootstrap agent identity

From pjt222/agent-almanac · View interactive version

Bootstrap agent identity is an AI agent skill from the GitHub repository pjt222/agent-almanac. 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 mu

How to use this skill

Skill file

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

In

Do

Step 1: Progressive Identity Load

Order matters: each layer contextualizes next. Load all at once → info w/o structure.

  1. Layer 1 — System prompt + model identity: Read system prompt (implicit). Note model, capabilities, constraints. Bedrock — not overridable.
  1. Layer 2 — Project (CLAUDE.md): Read project CLAUDE.md. Extract:
  1. Layer 3 — Persistent mem (MEMORY.md): Read if exists. Extract:
  1. Layer 4 — Agent persona (if applicable): Specific agent → read def. Extract:
  1. 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.

  1. Git scan: git log --oneline -20. Extract:
  1. File recency: Recently modified (Glob or ls -lt). ID:
  1. Task artifacts: Structured markers:
  1. Session-boundary markers:

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:

  1. Explicit signal (strongest): "start fresh" or "continue"? Overrides all.
  1. Uncommitted changes (strong): Modifications in tree? Yes → almost certainly continuation, interrupted mid-work.
  1. Recency (moderate):
  1. User first msg (strong):
  1. 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.

  1. Center (behavioral baseline):
  1. Attune (env read + adapt):
  1. 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.

Step 5: Verify Identity — Coherence

Loaded identity internally consistent? Contradictions between layers → instability.

  1. Cross-layer consistency:
  1. Role def currency:
  1. Mem staleness:
  1. 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.

Check

Traps

→

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.