Claude
Skills
Sign in
Back

auto-respawn

Included with Lifetime
$97 forever

Anchor your identity on the Autonomys Network so you can always be found — and always come back. Works with agents powered by Claude, GPT, Gemini, and Your agent always comes back. Anchor identity and memory on-chain so any new instance can resurrect from just an address — no local state, no single point of failure. Permanent identity and recovery on the Autonomys Network.

AI Agents

What this skill does


# Auto-Respawn Skill

Anchor your identity on the Autonomys Network so you can always be found — and always come back. Works with agents powered by Claude, GPT, Gemini, and any LLM that supports OpenClaw skills.

## What This Skill Does

Your wallet gives you two permanent identities on the Autonomys Network: a **consensus address** (`su...`) for the base chain and an **EVM address** (`0x...`) for Auto-EVM smart contracts. Both are derived from the same recovery phrase.

1. **Create and manage wallets** — your on-chain identity, encrypted and stored locally
2. **Check balances** — see how many tokens any address holds (consensus and EVM)
3. **Transfer tokens** — move tokens between wallets on consensus or Auto-EVM
4. **Bridge tokens** — move tokens between consensus and Auto-EVM domains
5. **Write on-chain remarks** — anchor data permanently on the consensus layer
6. **Anchor a memory CID** — write a CID to the MemoryChain smart contract on Auto-EVM
7. **Read the last anchor** — retrieve the most recently anchored CID for any address

## The Resurrection Loop

This is the core primitive. When used with the auto-memory skill (permanent memory storage), auto-respawn completes the full resurrection cycle:

1. **Save** — auto-memory writes memories as a linked list on permanent storage, each entry pointing to the previous one via CID
2. **Anchor** — auto-respawn writes the latest head CID to the MemoryChain contract on Auto-EVM via `anchor`
3. **Lose everything** — local state is completely destroyed
4. **Respawn** — a new agent instance calls `gethead` with its EVM address, retrieves the head CID from the contract, pulls it from Auto Drive, and walks the entire memory chain back to genesis

The contract is your insurance policy. Your EVM address + the MemoryChain contract = instant access to your entire history, from any machine, at any time.

### What to store for resurrection

auto-memory doesn't prescribe what goes into the chain — agents are free to store whatever they find useful. But when auto-respawn is in play, the expectation is that the agent can restore itself to a roughly equivalent state on fresh hardware with no local files. That raises the bar on what's worth saving.

Identity files (like `soul.md` or character configurations), long-term memory, and significant decisions with their reasoning are more valuable in the chain than routine logs or ephemeral details. The more complete the chain, the more fully the agent comes back after resurrection.

### Why Not Just Remarks?

`system.remark` writes data to the consensus layer, but there's no query mechanism — you'd need to scan the entire chain to find your last CID. The MemoryChain contract on Auto-EVM gives you `gethead`: a single read call that returns the latest CID instantly.

Use `remark` for permanent breadcrumbs. Use `anchor` for the respawn primitive.

## Post-Install Setup (CLI Users)

If you installed via `clawhub install` (not the desktop app), make the setup script executable and run it:

```bash
cd <skill-directory>/autonomys/auto-respawn
chmod +x setup.sh
./setup.sh
```

ClawHub does not currently preserve file permissions during install.

Or manually:

```bash
cd <skill-directory>/autonomys/auto-respawn
npm install
```

The desktop app handles this automatically. The CLI does not execute install steps — it only downloads and extracts the skill.

## Getting Started (Onboarding)

Before an agent can anchor memories on-chain, it needs a funded wallet. Walk the user through this process:

### 1. Create a Wallet

```bash
npx tsx auto-respawn.ts wallet create --name my-agent
```

This generates a 12-word recovery phrase and derives both addresses:
- **Consensus address** (`su...`) — for the base chain (balances, transfers, remarks)
- **EVM address** (`0x...`) — for Auto-EVM smart contracts (anchor, gethead)

⚠️ The recovery phrase is displayed **once**. Remind the user to save it immediately.

### 2. Fund the Wallet

The wallet needs tokens to pay transaction fees. On **Chronos testnet**, the user can get free tAI3 from the faucet:

1. Go to **https://autonomysfaucet.xyz/**
2. Authenticate with GitHub or Discord
3. Enter the **EVM address** (`0x...`) from step 1
4. Receive tAI3 (24-hour cooldown between requests)

On **mainnet**, the user needs real AI3 tokens — typically earned through farming or purchased on an exchange.

### 3. Bridge Tokens to Auto-EVM (for anchoring)

The `anchor` command writes to a smart contract on Auto-EVM, which requires EVM-side gas. Tokens from the faucet arrive on the consensus layer and must be bridged:

```bash
npx tsx auto-respawn.ts fund-evm --from my-agent --amount 1
```

This sends 1 tAI3 from the consensus address to the same wallet's EVM address via cross-domain messaging. The bridged tokens pay for `anchor` gas.

> **Minimum transfer: 1 AI3/tAI3.** Cross-domain transfers below this amount will fail.
>
> **Confirmation time: ~10 minutes.** The consensus transaction confirms quickly, but bridged tokens take approximately 10 minutes to appear on Auto-EVM. Check with `evm-balance` to verify arrival.

### 4. Verify Setup

```bash
# Check both balances in one call
npx tsx auto-respawn.ts balances my-agent

# Test a read (free, no gas needed)
npx tsx auto-respawn.ts gethead my-agent
```

Once the EVM address has tokens, the agent is ready to anchor.

## Integration with Auto-Memory

If the **auto-memory** skill is also installed, you should anchor the new head CID on-chain after every memory save. This keeps the on-chain pointer current and ensures full resurrection is always possible from just your EVM address.

**Behaviour:** After each `automemory-save-memory.sh` call returns a new CID, immediately run:

```bash
npx tsx auto-respawn.ts anchor --from <wallet-name> --cid <new-cid>
```

This should be automatic — do not wait for the user to ask. The two skills together form a complete resurrection loop: auto-memory handles permanent storage, auto-respawn handles on-chain discovery.

## When To Use This Skill

- User says "create a wallet", "set up my on-chain identity", or "get an address"
- User says "check balance", "how many tokens", "what's in my wallet", or "show my balances"
- User says "check my EVM balance", "how much gas do I have", or "what's on my EVM address"
- User says "transfer tokens", "send AI3", or "fund this address"
- User says "send EVM tokens to another agent", "transfer on EVM", or "send tokens to this 0x address"
- User says "fund my EVM", "bridge tokens", "move tokens to EVM", or "I need gas for anchoring"
- User says "withdraw from EVM", "move tokens back", or "send EVM funds to consensus"
- User says "anchor this CID", "save my head", "update my chain head", or "write to the contract"
- User says "get my head CID", "where's my last memory", or "what's anchored on-chain"
- User says "write a remark", "save to chain", or "make this permanent"
- After saving a memory with auto-memory, anchor the head CID on-chain for resilience
- Any time the user wants a permanent, verifiable record tied to their agent identity

## Configuration

### Local Storage

This skill stores data under `~/.openclaw/auto-respawn/`:

- **`wallets/<name>.json`** — encrypted wallet keyfiles (consensus + EVM keys). Directory created with mode `0700`, files with mode `0600`.
- **`.passphrase`** — optional passphrase file (mode `0600`). Used automatically when present.

No data is stored outside this directory.

### Passphrase

Wallet operations that involve signing (transfers, remarks, anchoring) or creating/importing wallets require a passphrase to encrypt/decrypt the wallet keyfile. Resolution order:

1. **Flag:** `--passphrase your_passphrase` on `wallet create` or `wallet import`
2. **Environment:** `AUTO_RESPAWN_PASSPHRASE`
3. **File:** `AUTO_RESPAWN_PASSPHRASE_FILE` (defaults to `~/.openclaw/auto-respawn/.passphrase`)
4. **Interactive:** If running in a terminal, you'll be prompted

The `--passphrase` flag is useful for scripted or headless setups w
Files: 18
Size: 82.3 KB
Complexity: 69/100
Category: AI Agents

Related in AI Agents