hibachi-cli / v0.1 preview

Trade Hibachi perpetuals by typing what you want.

A terminal for the Hibachi exchange. Plain-English prompts become SDK calls through Claude. Every plan previews before it fires. Memory grows between sessions. Dry-run is the default.

$go install github.com/doedja/hibachi-cli@latest
natural language claude code & openrouter live dashboard markdown memory sqlite journal dry-run by default cobra + hibachi-go
~/work  —  hibachi
$ 

I.

Type what you want.

NL → plan → approve → fire
01

Natural-language limit order

root fallback → ai planner

Anything that isn't a known subcommand routes to the AI planner. Claude parses units, rounds to tick size, and returns a plan. Nothing fires until you approve.

~/work  —  hibachi
$ hibachi buy btc 1000 usd at 72000

Plan
────
  LIMIT BUY  BTC/USDT-P
    size     0.01388 BTC  (≈ $1,000.00 notional @ 72,000)
    price    72,000.00    (tick 0.01 ok)
    flags    (none)
    max fee  0.05%

Memory change (+1 line)
  lessons.md  "user prefers USD-notional sizing and round price points"

Claude's reasoning
  Straightforward limit buy. Price is 3.6% below current mark
  (74,680), so this rests on the book rather than crossing.
  No TP/SL requested.

Submit? [y]es / [n]o / [e]dit / [d]ry-run only: y

[ok] Order placed. ID 8472910. Resting on book.
     Journal entry #00412 written.
02

Ambiguous size, Claude asks back

ask action + same session --resume

When a size unit is ambiguous, Claude returns ask instead of guessing. The clarification uses the same session so context carries turn to turn.

hibachi
$ hibachi buy 1 btc

Claude needs a clarification
  "1 BTC" at current mark is ~$74,680. Did you mean:
    [a]  1 BTC               (≈ $74,680 notional)
    [b]  $1 notional         (≈ 0.0000134 BTC)
> a

Plan
────
  MARKET BUY  BTC/USDT-P
    size     1.00000 BTC  (≈ $74,680 notional)
    max fee  0.05%

[warn] Above safety.max_notional_usd ($100). Requires --allow-large.

Retry with --allow-large? [y/N]: n
aborted.
03

Read-only query, no confirm step

get_* actions only → skip confirm

When every action in the plan is a read, the CLI runs without the approval prompt. Numbers format to locale, PnL colors signed.

hibachi
$ hibachi what's my pnl today

Fetching: account info, positions, settlements.

Today  (since 00:00 UTC)
───────────────────────
  Realized      +$142.30
  Unrealized     -$18.04   (BTC long, mark below entry)
  Net           +$124.26

Claude's note
  Most of today's realized came from the ETH close at 10:42 UTC
  (+$118). BTC position is small and still in drawdown; no
  action suggested.
04

Multi-step intent, one approval

composite plan, sequential execution

"Go flat" fans out into cancel-all and two market closes. One confirm covers the batch. If step 2 fails, step 3 holds for a retry prompt.

hibachi
$ hibachi go flat

Plan  (3 actions)
─────────────────
  1. CANCEL       all pending orders                (3 orders)
  2. MARKET SELL  BTC/USDT-P  0.0150  (close long)
  3. MARKET BUY   ETH/USDT-P  0.4200  (close short)

Estimated net from closes
  BTC    +$18.20
  ETH    -$34.50
  Total  -$16.30 realized

Submit? [y]/n/e/d: y

[ok] 1/3  Cancelled 3 orders.
[ok] 2/3  Filled BTC/USDT-P market sell @ 74,612.30.
[ok] 3/3  Filled ETH/USDT-P market buy  @ 3,147.80.

All positions flat. Realized PnL today: +$107.96.
II.

A brain that grows between sessions.

markdown, editable by you or Claude
05

Interactive chat (no args)

one persistent session across the REPL

Running hibachi with no args drops into chat. A single Claude session runs for the REPL lifetime, so context carries. Mutations still require confirm.

hibachi chat
$ hibachi

hibachi-cli chat  (session 4f9a-c2e1, model claude-opus-4-7)
Type 'exit' to leave. Ctrl+C cancels current turn.

 hey whats my biggest exposure right now

Looking at your account.

  ETH/USDT-P short  0.42   (≈ $1,321 notional, 3.2x leverage on
                              your free margin).

That's your largest position by notional. Funding is currently
-0.012% per 8h, so you're paying to hold it. Position is up
+$34 since entry.

 should i close it

I'd lean toward trimming rather than fully closing. Funding
turned negative only 6h ago, and mean reversion on ETH funding
has been ~18h on average this month. Half-close would lock in
+$17, leaves you exposed if the move continues.

Want me to place a market buy of 0.21? [y/N]

 y

Plan
────
  MARKET BUY  ETH/USDT-P  0.21  (close half of short)

Submit? [y]/n: y

[ok] Filled @ 3,147.40. Position now 0.21 short, +$17 realized.
     Remembered: "user prefers partial closes when funding just
                 flipped against them"lessons.md
06

Memory inspection

~/.hibachi/memory/*.md

The brain is plain markdown. Claude reads all of it every turn and edits it when something's worth saving. You can too.

hibachi memory
$ hibachi memory show

~/.hibachi/memory/  (3 files, ~1.2k tokens)

─── user.md ───────────────────────────────────────────────
Account 12345. Mid-size trader, $5-15k working capital per
session. Prefers USD-notional sizing over base-unit. Trades
BTC and ETH primarily, occasional SOL. Risk-aware: rarely
above 3x leverage, always uses SL on size > $2000.

─── lessons.md ────────────────────────────────────────────
- DCA at 1h intervals worked well for BTC accumulation in
  March; same spacing on ETH underperformed (higher vol).
- User prefers partial closes when funding just flipped
  against them, rather than full exit.
- Round-number limit prices (72000, 75000) tend to get
  front-run; user has accepted this tradeoff for simplicity.

─── watchlist.md ──────────────────────────────────────────
BTC/USDT-P   primary. Alert if > 75000 (resistance) or
             < 70000 (last swing low).
ETH/USDT-P   primary. Watching 3200 support.
SOL/USDT-P   speculative only. Keep size < $500.
III.

Autonomous strategies. AI advisor.

dca · grid · tpsl · advisor
07

Advisor agent, suggest-only

persistent session, --resume every tick

A long-running agent that watches the account and suggests moves. Never auto-executes in v0.1. Every tick resumes the same Claude session, so it can reference what it saw earlier.

hibachi agent run advisor
$ hibachi agent run advisor --every 5m

Starting advisor agent.
  session       9c1f-a7b2  (persistent, will --resume)
  interval      5m
  symbols       BTC/USDT-P, ETH/USDT-P
  mode          suggest-only  (will NOT auto-execute)

[10:00:03] tick 1  trigger=startup
  Suggestion: Reduce ETH exposure from 0.42 to 0.21.
  Reason: Funding flipped -0.012% 6h ago, historical mean
  reversion at ~18h. Partial close locks in gains with
  asymmetric upside if regime holds.

[10:05:08] tick 2  trigger=periodic
  No change suggested. Conditions unchanged.

[10:08:14] tick 3  trigger=fill:BTC/USDT-P
  BTC limit filled @ 72,000. Entry noted.
  Suggestion: Place TP at 74,500 (+3.5%), SL at 71,200 (-1.1%).
  Reason: Entry matches support. Target is prior resistance,
  stop is under the swing low. Risk-reward ~3:1.

Ctrl+C to stop.
IV.

No AI needed if you know what you want.

typed verbs bypass the planner
08

Literal subcommand, no AI latency

market, account, trade, capital, stream …

Typed subcommands go straight to the SDK. Same tables, same colors, no Claude round-trip. The full command tree wraps every REST and WebSocket path in hibachi-go.

hibachi market
$ hibachi market orderbook BTC/USDT-P --depth 5

BTC/USDT-P  orderbook, depth 5, 10:12:44 UTC
──────────────────────────────────────────────
      price         size       cum notional
  74,684.50     0.482       $36,001
  74,683.20     1.104       $118,438
  74,682.80     0.311       $141,658
  74,682.10     0.058       $146,988
  74,681.50     0.092       $153,859
  ─ mid 74,680.80  spread 0.60 (0.8 bps) ─
  74,680.10     0.207       $15,458
  74,679.40     0.688       $66,838
  74,678.00     1.420       $172,853
  74,677.20     0.094       $179,873
  74,676.50     0.312       $203,181
V.

One view, always on.

bubbletea + lipgloss + ws feeds
09

Live dashboard

hibachi dash

Account strip, positions, open orders, orderbook for the focused symbol, trade feed, watchlist with sparklines, advisor panel. Updates stream from ws/market and ws/account. Reconnects show as a small amber pill.

hibachi dash
┌─ hibachi  acct 12345  10:47:23 UTC  claude-code · opus-4-7  live ───────────────────────────────────────┐
│  balance $8,472.30   free $6,118.40   used $2,353.90 (27.8%)   lev 2.1x   realized +$107.96   unrealized +$22.43     │
├── Positions ────────────────────────────────────────────┬── BTC/USDT-P  orderbook ──────────────────────────────┤
│  symbol       side    size     entry      mark       PnLprice         size       cum notional           │
│  BTC/USDT-P   LONG   0.015   72000.00   74680.80  +40.2174,684.50     0.482        36,001                  │
│  ETH/USDT-P   SHORT  0.210    3165.40    3147.40   +3.7874,683.20     1.104       118,438                  │
│  SOL/USDT-P   LONG   3.200     142.80     139.20  -11.5274,682.80     0.311       141,658                  │
│                                                          │    74,682.10     0.058       146,988                  │
│                                                          │    74,681.50     0.092       153,859                  │
│  totals     notional $2,353.90    net PnL +$32.47─ mid 74,680.80  ·  spread 0.60  (0.8 bps) ─          │
├── Open orders ──────────────────────────────────────────┤    74,680.10     0.207        15,458                  │
│  id       sym         side  price       size     age74,679.40     0.688        66,838                  │
│  8472910  BTC/USDT-P  BID   72000.00    0.014    1m12s   │    74,678.00     1.420       172,853                  │
│  8472905  ETH/USDT-P  ASK    3200.00    0.200    4m01s   │    74,677.20     0.094       179,873                  │
│  8471801  SOL/USDT-P  BID     140.00    1.500   22m48s   │    74,676.50     0.312       203,181                  │
├── Recent trades ────────────────────────────────────────┼── Watchlist ─────────────────────────────────────────┤
│  10:47:21   BTC   buy    0.004   @ 74,680.40              │   [1] BTC/USDT-P   74,680.80    +2.13%  ▁▂▃▅▆▇▇▆   │
│  10:47:18   ETH   sell   0.120   @  3,147.20              │   [2] ETH/USDT-P    3,147.40    -0.58%  ▇▆▅▅▄▄▄▃   │
│  10:47:14   BTC   buy    0.011   @ 74,680.10              │   [3] SOL/USDT-P      139.20    -2.52%  ▇▇▆▅▄▃▂▂   │
│  10:47:09   ETH   sell   0.080   @  3,147.40              │                                                     │
│  10:47:02   BTC   buy    0.002   @ 74,680.20              │                                                     │
├── Advisor  session 9c1f-a7b2 · tick 3 · 10:08:14  ai ────────────────────────────────────────────────────┤
│  suggestion  Place TP at 74,500 (+3.5%) and SL at 71,200 (-1.1%) on new BTC long.                                │
│  reason      Entry matches support. Target prior resistance; stop under swing low. Risk:reward ~3:1.                  │
│  [a] apply    [i] ignore    [m] modify                                                                       │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
  [q] quit   [tab] focus   [/] prompt   [b] buy   [s] sell   [c] close   [x] cancel   [a] advisor   [?] help
10

Inline NL prompt from the dash

[/] overlay · same planner, same memory

Inside the dash, hit / to drop an NL prompt overlay. The planner runs, preview renders on top of the live view, y fires, the dash below updates from the WS fill.

hibachi dash · prompt overlay
┌─ hibachi  acct 12345  10:47:58 UTC  claude-code · opus-4-7  live ───────────────────────────────────────┐
│  balance $8,472.30   free $6,118.40   used $2,353.90   lev 2.1x   realized +$107.96   unrealized +$22.43       │
├── Positions ────────────────────────────────────────────┬── BTC/USDT-P  orderbook ──────────────────────────────┤
│  symbol       side    size     entry      mark       PnL │                                                     │
│  BTC/USDT-P   LONG   0.015   72000.00   74680.80  +40.21 │          ┌── / prompt ai ────────────────────────┐  │
│  ETH/USDT-P   SHORT  0.210    3165.40    3147.40   +3.78 │          │   tp 3% sl 1.5% on my btc         │  │
│  SOL/USDT-P   LONG   3.200     142.80     139.20  -11.52 │          └────────────────────────────────────┘  │
│                                                          │                                                     │
│                                                          │          ┌── plan ────────────────────────────────────────┐
│  totals     notional $2,353.90    net PnL +$32.47        │          │  TPSL  BTC/USDT-P  pos 0.015 LONG          │
├── Open orders ──────────────────────────────────────────┤          │    TP   74,160.00   +3.0%   qty 0.015   │
│  8472910  BTC/USDT-P  BID   72000.00    0.014    1m12s   │          │    SL   70,920.00   -1.5%   qty 0.015   │
│  8472905  ETH/USDT-P  ASK    3200.00    0.200    4m01s   │          │                                          │
│  8471801  SOL/USDT-P  BID     140.00    1.500   22m48s   │          │  "Standard bracket on the BTC long. TP at   │
├── Recent trades ────────────────────────────────────────┤          │  mark + 3%, SL at entry - 1.5%. R:R ~2:1."  │
│  10:47:21   BTC   buy    0.004   @ 74,680.40              │          │                                          │
│  10:47:18   ETH   sell   0.120   @  3,147.20              │          │  submit? [y] / n / e / d                    │
│  10:47:14   BTC   buy    0.011   @ 74,680.10              │          └──────────────────────────────────────────┘
│  10:47:09   ETH   sell   0.080   @  3,147.40              │                                                     │
└──────────────────────────────────────────────────────────┴─────────────────────────────────────────────────────┘
  [/] prompt open   [esc] cancel   [y] submit   [e] edit
VI.

Pick your brain.

claude code · openrouter · any model
11

Switchable AI backends

claude code · openrouter

Two interchangeable planners. Claude Code uses the local claude binary with session resume. OpenRouter runs over HTTP with model choice across Anthropic, OpenAI, Google, Meta, and more. Memory carries across either.

hibachi ai backend
$ hibachi ai backend

Current backend
  backend   claude-code
  model     claude-opus-4-7
  sessions  4 active    (3 oneshot, 1 advisor)

$ hibachi ai models list

Presets  (safe for structured output)
    claude-code          claude-opus-4-7
    openrouter           anthropic/claude-opus-4.7
    openrouter           anthropic/claude-sonnet-4.6
    openrouter           openai/gpt-5
    openrouter           google/gemini-2.5-pro

Use `hibachi ai models list --all` to query OpenRouter for the full catalog.
Non-preset models require --allow-any-model.

$ hibachi ai backend use openrouter --model openai/gpt-5

[ok] Backend switched.
     backend   openrouter
     model     openai/gpt-5
     key       OPENROUTER_API_KEY (env)
     note:  new conversations will start fresh. Memory carries over.

$ hibachi close my btc

Planning via openrouter · openai/gpt-5 ...

Plan
────
  MARKET SELL  BTC/USDT-P  0.0150  (close long, mark 74,680)
  max fee  0.05%

Memory read
  user.md, lessons.md  (same files, different model)

Submit? [y]/n/e/d: y

[ok] Filled @ 74,678.90. +$18.35 realized.
     usage: 1,284 in / 312 out · $0.038 · session or-7e4b
12

Usage across backends

unified ledger

Token and cost accounting rolls up across both planners. OpenRouter reports usage directly. Claude Code reports via --output-format json.

hibachi ai usage
$ hibachi ai usage --today

Today  2026-04-21, since 00:00 local
─────────────────────────────────────────────────────────────────
  time    backend       model                           turns   cost
  10:04   claude-code   claude-opus-4-7                     2    $0.082
  10:18   openrouter    openai/gpt-5                        1    $0.041
  10:24   claude-code   claude-opus-4-7                     3    $0.134
  10:31   openrouter    anthropic/claude-opus-4.7           3    $0.118
  10:47   openrouter    openai/gpt-5                        1    $0.038
                                                             ─────────────
                                                           10   $0.413

By backend
  claude-code                                               5    $0.216
  openrouter                                                5    $0.197

By model
  claude-opus-4-7                                           5    $0.216
  openai/gpt-5                                              2    $0.079
  anthropic/claude-opus-4.7                                 3    $0.118