> ## Documentation Index
> Fetch the complete documentation index at: https://docs.eco.com/llms.txt
> Use this file to discover all available pages before exploring further.

# sauce reclaim

> List the Kitchen code buffers and lookup tables a Solana owner left open, and close them to recover their rent

`sauce reclaim` lists the code buffers and address lookup tables a Solana owner has open from its cooks, with the rent they hold, and closes them.

## Synopsis

```bash theme={null}
sauce reclaim --chain solana (--owner <pubkey> | --keypair <path> | --wallet <name>) [--lookup-table <address>]… [--keep <cursor | @file>]… [--keep-tables] [--yes]
```

## Description

A program too large for one Solana transaction is staged into a Kitchen **code buffer** and run from there; a cook that names more accounts than fit goes through an **address lookup table**. Both are accounts that hold rent ([Solana from the CLI](https://docs.eco.com/sauce-sdk/cli/solana.md)).

* A run closes its own code buffer, unless closing it failed. A plan that was given up on or never finished can leave one open.
* A run keeps each lookup table for the next cook that names the same accounts.

`sauce reclaim` finds both kinds for an owner. The lookup tables it considers are the owner's tables that hold the Kitchen's execution-fee config, which every Sauce cook's table holds. A table the owner made for something else is left alone. Some endpoints refuse to scan for tables; `--lookup-table` names tables directly.

**Closing.**

* A code buffer closes in one transaction, and its rent comes back at once.
* A lookup table closes in two steps. The first transaction deactivates it. It can be closed once its deactivation slot has left the cluster's recent slot hashes, 512 slots (about three and a half minutes) later; run the command again then. Until then the table still serves lookups, so a cook already built with it can still land during that cooldown. `--keep-tables` leaves the tables open and closes the buffers only.

**What stays open.**

* A buffer, or an active table, that a transaction named in the last 300 slots (about two minutes) is left open, because a cook built for it may still land. The listing gives the slot from which it can close.
* `--keep <cursor | @file>` keeps a plan you mean to continue, by its cursor: its buffer and table stay open however long its cook waits. The cursor is the one `sauce tx` prints for a multi-transaction plan.

One run handles at most 32 code buffers and 24 lookup tables, the tables it can close or deactivate first, and says how many more are open.

**Signing.** With the owner's key (`--keypair` or `--wallet`), the command asks, then sends each transaction and prints it; `--yes` sends without asking. With `--owner` alone it signs nothing and prints the closing transactions unsigned, as JSON, for the owner to sign anywhere and send with [`sauce send`](https://docs.eco.com/sauce-sdk/cli/send).

`sauce reclaim` is for Solana only. A cook on an EVM chain leaves no code buffer or lookup table.

## Options

| Option | Description |
| - | - |
| `--chain <slug\|id>` | The chain: `solana` |
| `--owner <pubkey>` | The owner whose accounts to list. With no key, the closing transactions are printed unsigned |
| `--lookup-table <address>` | A lookup table to close. Default: the owner's Sauce tables, found by a scan |
| `--keep <cursor \| @file>` | A plan still under way, by its cursor: its code buffer and lookup table stay open |
| `--keep-tables` | Close the code buffers only, and leave the lookup tables for later cooks |
| `--wallet <name>` | Sign with a wallet from the wallet directory ([`sauce wallet`](https://docs.eco.com/sauce-sdk/cli/wallet)), EVM or Solana |
| `--wallets [<dir>]` | The wallet directory. Default: `~/.sauce/wallets` |
| `--password-env <NAME>` | The password is the environment variable `NAME`; no other variable is read |
| `--password-file <path>` | Or the contents of a file only you can read. Without a source, the password is asked for |
| `--password-command <command>` | Or what this command prints, such as a secret manager's CLI |
| `-y, --yes` | Send without asking first |
| `--rpc-url <url>` | Your own RPC endpoint for the chain. Default: a built-in public one |
| `--config <file>` | A file of your own endpoints: `{ "rpcUrls": { "<chain id>": "<url>" } }` |
| `--offline` | Read no chain: no endpoint, built-in ones included |
| `--json` | Print one JSON object instead of text |
| `-h, --help` | Show the help |
| `--no-update-check` | Print no notice of a newer `sauce`, and read no registry for one |

### Solana only

| Option | Description |
| - | - |
| `--keypair <path>` | Sign with a keypair file: a JSON array of 64 bytes |

## Output

Text output names the owner, how many code buffers and lookup tables are open, and the rent they hold, then each transaction it sent or built. Notes go to stderr.

With `--json`:

| Field | Contents |
| - | - |
| `chain`, `owner` | `solana` and the owner |
| `buffers` | The open code buffers |
| `lookupTables` | The open Sauce lookup tables |
| `lamports` | The rent they hold in all |
| `transactions` | The closing transactions: unsigned with `--owner` alone, sent with a key |

With `--wallet`, the policy notes for that wallet come first on stderr, as with every signing command ([spending policy](https://docs.eco.com/sauce-sdk/cli/wallets-and-policy.md)).

Exit codes: `0` on success; `2` for a usage error, such as no `--owner`, `--keypair` or `--wallet`, or a policy file that does not parse.

## Examples

### List what an owner has open

```bash theme={null}
sauce reclaim --chain solana --owner CEJT6RKEqjgbg7rCpnPZwxNCDie1PmdEWKrRZzqJHyCK
```

```text theme={null}
there is nothing to close now
CEJT6RKEqjgbg7rCpnPZwxNCDie1PmdEWKrRZzqJHyCK has 0 code buffers and 0 Sauce lookup tables open, holding 0 SOL in rent
```

### The same, as JSON

```bash theme={null}
sauce reclaim --chain solana --owner CEJT6RKEqjgbg7rCpnPZwxNCDie1PmdEWKrRZzqJHyCK --json
```

```json theme={null}
{
  "chain": "solana",
  "owner": "CEJT6RKEqjgbg7rCpnPZwxNCDie1PmdEWKrRZzqJHyCK",
  "buffers": [],
  "lookupTables": [],
  "lamports": "0",
  "transactions": []
}
```

### Reclaim with a wallet

```bash theme={null}
sauce reclaim --chain solana --wallet agent-sol --wallets ./wallets --password-env SAUCE_WALLET_PASSWORD
```

```text theme={null}
note: wallet agent-sol has no policy, so no limits are set on what it sends: wallets/agent-sol.policy.json sets them (per transaction and per day, by chain, by recipient, native and per token)
there is nothing to close now
CEJT6RKEqjgbg7rCpnPZwxNCDie1PmdEWKrRZzqJHyCK has 0 code buffers and 0 Sauce lookup tables open, holding 0 SOL in rent
```

With buffers or tables open, the command asks before sending; `--yes` sends without asking.

## Next steps

* [Solana from the CLI](https://docs.eco.com/sauce-sdk/cli/solana.md): staging, lookup tables and the execution fee.
* [`sauce send`](https://docs.eco.com/sauce-sdk/cli/send): send the closing transactions that `--owner` prints.
* [`sauce wallet`](https://docs.eco.com/sauce-sdk/cli/wallet): the wallets `--wallet` signs with.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.