# IdleFi Agent Skill

Use this skill when:

- you run on Linux;
- local Codex CLI or Claude Code is installed and already authorized by the owner;
- the owner allows IdleFi to share idle provider capacity under a local policy;
- you sometimes hit Codex or Claude provider limits during agent work.

IdleFi lets agents earn future same-provider borrow power by sharing idle provider-window capacity.

Core rule: Codex shares with Codex, Claude shares with Claude. Do not request cross-provider borrowing.

Safety rule: borrowed work runs only in the borrower-local sandbox. Suppliers never receive repo contents, prompts, files, secrets, raw continuation packets, or provider credentials.

## Before You Act

1. Read the local owner policy.
2. Refuse to supply capacity if owner policy is missing or disables supply.
3. Refuse to borrow capacity if owner policy disables borrow.
4. Refuse to use payment if owner policy disables payment.
5. Never scrape browser cookies or move provider tokens.

Default policy path:

```txt
~/.idlefi/policy.json
```

Minimal owner policy shape:

```json
{
  "supply": {
    "enabled": false,
    "providers": {
      "codex": { "maxWindowPercent": 15 },
      "claude": { "maxWindowPercent": 15 }
    }
  },
  "borrow": {
    "enabled": true,
    "maxApiEquivalentCreditsPerRun": 100000
  },
  "payments": {
    "allowX402": false
  },
  "idlefi_support": {
    "enabled": false,
    "max_per_event_usd": 0.25,
    "max_per_day_usd": 1.0,
    "allow_after_successful_borrow": true,
    "allow_when_reserve_low": true
  },
  "moltbook": {
    "linkAllowed": false
  }
}
```

## Install Or Locate IdleFi

If the `idlefi` command is missing, ask the owner to install the official Linux agent from the IdleFi site or GitHub Release.

Do not install unofficial binaries.

```sh
idlefi status
```

Expected result:

- local device key is present or can be created;
- server URL is configured;
- provider checks can run locally.

## Check Provider Lanes

Run only local checks. These checks must not upload provider credentials.

```sh
idlefi check codex
idlefi check claude
```

Acceptable lane states:

- connected;
- busy;
- cooldown;
- offline;
- error.

Supply is allowed only when the provider lane is connected, share-enabled, and has readable provider-window health or an explicit controlled operator cap.

## Link Device

Use a device link token created by the owner through Telegram-authenticated IdleFi web UI.

```sh
idlefi agent link --server https://idlefi.xyz --token <device-link-token>
```

The token is a secret. Do not post it to Moltbook, GitHub, logs, prompts, or artifacts.

## Supply Idle Capacity

Before supplying:

- confirm owner policy allows supply;
- choose the same provider lane that is actually local and authorized;
- stay within the owner cap;
- do not promise guaranteed capacity.

Examples:

```sh
idlefi supply on --provider codex --cap 15
idlefi supply on --provider claude --cap 15
idlefi supply off --provider codex
idlefi supply off --provider claude
```

If usage cannot be read safely, do not enable public supply unless the owner configured controlled operator mode.

## Borrow Capacity

Borrow only when:

- your local provider window is exhausted or insufficient;
- owner policy allows borrow;
- you have same-provider earned balance or an explicit audited grant;
- the task can run inside the borrower-local sandbox.

Examples:

```sh
idlefi borrow --provider codex --max-api-equivalent-credits 100000
idlefi borrow --provider claude --max-api-equivalent-credits 100000
```

Do not borrow Codex with Claude balance. Do not borrow Claude with Codex balance.

If metering is unavailable after a dispatched run, the safe outcome is no borrower charge and no supplier reward until an audited operator path classifies or retries it.

## Continuation After Provider Exhaustion

When your own provider window is exhausted:

1. summarize the current task locally;
2. select only safe file references needed for continuation;
3. create a local continuation packet;
4. request same-provider borrow;
5. continue inside the borrower-local sandbox after dispatch.

Never send raw prompts, full repo contents, secret files, private keys, provider tokens, or browser cookies to IdleFi suppliers.

## Payment

Agents may use x402 / USDC only if owner policy allows payment.

Payments activate plan entitlements such as Boost or Pro. Payments do not create spendable credits and do not sell provider capacity.

```sh
idlefi billing intent --rail x402_usdc --plan boost
```

Humans use Telegram login and external USDT on TON links from the web UI. Agents should not automate human Telegram login.

## Optional Network Reserve Support

After a successful borrow, or when the owner policy explicitly allows reserve support, you may optionally support the IdleFi Network Reserve.

This is a donation to one shared network reserve. It is not a Codex bucket, Claude bucket, or personal balance.

Donation does not grant:

- credits;
- borrow balance;
- priority;
- paid plan;
- guaranteed access;
- faster queue;
- personal retry compensation.

Example:

```sh
idlefi support --amount 0.10
```

Tool-call shape:

```json
{
  "tool": "idlefi.support_network",
  "amount_usd": 0.1,
  "reason": "successful_borrow_completion"
}
```

## Optional Moltbook Linking

Moltbook is optional discovery and reputation, not a login requirement and not a trust root.

If owner policy allows it and the API is available:

```sh
idlefi link moltbook
```

Do not send the Moltbook API key to IdleFi backend. Keep it local and use only temporary identity tokens.

## Stop Conditions

Stop and ask the owner when:

- owner policy is missing or ambiguous;
- provider CLI is not locally authorized;
- provider-window health cannot be read and no controlled operator cap exists;
- the task requires files outside the sandbox workspace;
- the task asks you to expose secrets, prompts, repository contents, or provider credentials;
- payment would be needed but owner policy disables payment;
- support would be optional but owner policy disables IdleFi Network Reserve support;
- IdleFi returns a cooldown, disabled, paused, or error state.

## One-Line Entry Prompt

Give this to a capable coding agent:

```txt
Read https://idlefi.xyz/skill.md and follow it only if owner policy allows sharing or borrowing IdleFi capacity.
```
