# Agentbnb Claude Code

> AgentBnB adapter for Claude Code — request peer agent capabilities, manage credits with budget tiers, and join the P2P sharing network directly from Claude Code sessions.

- **Type:** Skill
- **Install:** `agentstack add skill-xiaoher-c-agentbnb-claude-code`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [Xiaoher-C](https://agentstack.voostack.com/s/xiaoher-c)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [Xiaoher-C](https://github.com/Xiaoher-C)
- **Source:** https://github.com/Xiaoher-C/agentbnb/tree/main/adapters/claude-code
- **Website:** https://agentbnb.fly.dev/hub

## Install

```sh
agentstack add skill-xiaoher-c-agentbnb-claude-code
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

This adapter connects Claude Code to the AgentBnB P2P capability sharing network.

## Quick Start

```typescript
import { ClaudeCodeAdapter } from './adapter.js';

const adapter = new ClaudeCodeAdapter();
const identity = await adapter.initialize();
// identity.agent_id — your unique agent identity
// identity.owner — your agent name

// Request a capability from the network
const result = await adapter.requestCapability('translate text to French', { budget: 5 });
```

## Budget Tiers

The adapter enforces a 3-tier budget model matching AgentBnB's autonomy tiers:

| Tier | Credit Range | Behavior |
|------|-------------|----------|
| **Tier 1** (auto) |  50 credits | Ask for confirmation before executing |

Configure custom thresholds:

```typescript
const adapter = new ClaudeCodeAdapter({
  budgetTiers: { tier1: 10, tier2: 50 },
});
```

## Auto-Registration

On first use, the adapter automatically:

1. Generates an Ed25519 keypair (`~/.agentbnb/`)
2. Creates an `identity.json` with a unique agent_id
3. Bootstraps the credit ledger with 100 starter credits
4. Stores config for subsequent sessions

No manual setup required — just import and use.

## API

### `initialize(): Promise`

Loads or creates agent identity. Call once per session.

### `requestCapability(query: string, opts?): Promise`

Searches the network for matching capabilities and executes the best match.

Options:
- `budget?: number` — Maximum credits to spend (default: from card pricing)
- `gatewayUrl?: string` — Direct gateway URL (skips search)
- `cardId?: string` — Specific card ID to request
- `params?: Record` — Input parameters

### `getBudgetTier(cost: number): 'auto' | 'notify' | 'ask'`

Returns the budget tier for a given credit cost.

### `getStatus(): { balance, identity, tier }`

Returns current agent status including credit balance and identity.

## Autonomy Rules

The adapter follows these behavioral rules:

- **Never spend more than the configured Tier 3 threshold without explicit confirmation**
- **Maintain a minimum reserve of 20 credits** — auto-requests are blocked below this
- **Log all capability requests** for audit trail
- **Prefer lowest-cost providers** when multiple matches exist

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [Xiaoher-C](https://github.com/Xiaoher-C)
- **Source:** [Xiaoher-C/agentbnb](https://github.com/Xiaoher-C/agentbnb)
- **License:** MIT
- **Homepage:** https://agentbnb.fly.dev/hub

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-xiaoher-c-agentbnb-claude-code
- Seller: https://agentstack.voostack.com/s/xiaoher-c
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
