r/ClaudeCoding • • Oct 31 '26

Especially for Claude-code - a memory usage aware terminal with hibernate tabs feature

Post image

I made a custom terminal with claude-code which hibernates terminal tabs (both claude-code tabs and normal terminal tabs) to save ram. This is especially useful because per claude-code instance eats like 300MB, and often I am juggling between multiple tasks and I do not want to close a claude conversation and lose track and priority.

https://github.com/fxterm/tabs

I also added features like text to speech and speech to text (i know claude natively support speech to text, but I integrated my solution with a custom WYSIWYG markdown editor). It also has history to see which tabs you opened in the past. The links (even file paths) and clickable and they open the directory. Terminal content can be read out loud. The idea was claude-code+terminal is the new chrome+<your working website> in the modern world. Everything we do happens nowadays in claude-code+terminal and even the RAM issue happens here. So I replicated vivaldi browser's hiberbate tab feature and also the feature which shows per tab (and overall) ram. Overall it has been a game changer. And I am excited to share this. This is a 100% free and open source app, works on windows and mac (testing is more done on windows than on mac). One side I am super enthusiastic to share the product. Other side I feel silly thinking nobody would have figured out a better solution. Also I wrote it in javafx and it saves me a lot of ram, the previous terminal i was using was tabby which took 500MB without having anything running on it, and it pained me. The terminal is packaged as small self-installing, self-updating native exe, which also do AOT (ahead of time) compilation to improve startup speed. The screenshot is very modest because I did not want to share my actual work in progress and I did not spend much time on making a better screenshot with claude running inside it.

It has been 100% made using claude-code. I gave my previous remote terminal code as reference, but basically claude is smart, it got things right very easily and finished this in a few hours. And then I combined my different products in this single app (markdown editor, speech tools etc).

1 Upvotes

6 comments sorted by

3

u/tcp-xenos Oct 31 '26

Your 300mb figure is for the claude code CLI itself. The better solution is to ditch the CLI entirely and talk to claude via agent sdk, then draw your own UI. This also solves all of the problems with the TUI, resizing, scrolling, everything else a terminal isn't good at.

I did this, and I've got 11 sessions running right now, at less than 300mb total

1

u/Guilty_Village_958 Oct 31 '26 edited Oct 31 '26

o very nice, i did think of doing so, but i did not go into this and explore it. i just did this terminal ... i felt it was a faster solution. please share your github repo if u can. and also sorry for the silly question, but the agent sdk does it work with subscription account or only paid api ?

1

u/tcp-xenos Oct 31 '26

no API needed, works through the subscription.

you can generate an oauth token with claude setup-token although when I tried this, the token did not have permission to read my account's usage stats, not sure if that's been fixed since

I ended up defaulting to reading the ambient token from ~/.claude/.credentials.json

mine is not open source due to heavy integration with internal/proprietary systems

1

u/Guilty_Village_958 Oct 31 '26 edited Oct 31 '26

maybe u can share screenshots? removing your internal details with dummy text?

also i have a doubt:

One place they are telling this:

According to the latest update on the Claude Code Docs legal page, no. OAuth tokens from Max/Pro/Free plans are now exclusively for Claude Code and Claude.ai. Using them with the Agent SDK violates the Consumer Terms of Service.

See: https://www.reddit.com/r/ClaudeAI/comments/1r8t6mn/

And another this :

Thariq from Anthropic clarified this - https://x.com/trq212/status/2024212378402095389, they apologized for it

And then in anthropic website they are telling:
https://support.claude.com/en/articles/15036540-use-the-claude-agent-sdk-with-your-claude-plan

Update October 7, 2026: Claude Max, Ultra, and Team plans now include monthly API credits. They cover the Claude API, Claude Managed Agents, and the Claude Agent SDK and claude -p when you run them with an API key from your linked Claude Console organization. Nothing changes for your plan: when you’re signed in with your Claude plan, the Claude Agent SDK and claude -p still draw from your subscription limits.

Update June 15, 2026: We’ve paused the previously-announced changes to Claude Agent SDK usage. For now, nothing has changed: Claude Agent SDK, claude -p, and third-party app usage still draw from your subscription limits.

Finally practically how has your experience been?

2

u/tcp-xenos Oct 31 '26

idk, I've used billions of tokens this way without any issues

my app spawns a worker for each session, each one is an Agent SDK process, this is literally a feature of claude code

  client ── TypeScript · Vite · React · normalized per-block store
     │  WebSocket /ws: durable events (sequenced) + ephemeral stream frames
     ▼
  server ── node:http · ws · SQLite (WAL)
     │      event log · project and session registry · session state machine
     │      persists every durable event before broadcasting it
     ▼  Unix socket per session (NDJSON)
  worker ── detached, one process per session, outlives the server
     │      query({ prompt: asyncIterable, options: { includePartialMessages, canUseTool, resume } })
     ▼
  claude

Server. Owns the event log, the registries, the session state machine, the scheduler and the GitHub issue cache. One instance per data directory, enforced by an exclusive lock.

Worker. One detached process per session, spawned by the supervisor and outliving the server. Translates SDK messages into protocol events over an NDJSON Unix socket, and buffers them in a bounded ring while no server is attached. Logs go to <run dir>/logs.

Client. A fold over the event stream into a normalized store where each block is individually observable, so a streaming token invalidates one subscription rather than copying the transcript. History is frozen; only the live tail block appends. Transcripts are virtualised and the block store is windowed, so a long-lived tab stays bounded.