<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Ai-Usagebar | AkitaOnRails.com</title><link>https://akitaonrails.github.io/en/tags/ai-usagebar/</link><description>Fabio Akita's blog — tech, career, and assorted geek topics. English edition.</description><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Mon, 19 Oct 2026 23:20:51 +0000</lastBuildDate><atom:link href="https://akitaonrails.github.io/en/tags/ai-usagebar/index.xml" rel="self" type="application/rss+xml"/><item><title>What's New in My AI-MEMORY: Switch AI Agents Without Losing the Session</title><link>https://akitaonrails.github.io/en/2026/07/20/whats-new-ai-memory-switch-agents-without-losing-session/</link><guid isPermaLink="true">https://akitaonrails.github.io/en/2026/07/20/whats-new-ai-memory-switch-agents-without-losing-session/</guid><pubDate>Mon, 20 Jul 2026 21:00:00 -0300</pubDate><description>&lt;p&gt;It&amp;rsquo;s been a little over a month since I published &lt;a href="https://akitaonrails.github.io/en/2026/06/16/ai-memory-long-term-memory-karpathy-wiki-self-improvement-hermes-projects/"&gt;ai-memory: long-term memory (Karpathy Wiki) and self-improvement (Hermes) for your projects&lt;/a&gt;. That was June 16. In that post I explained how sessions became Markdown pages, how auto-improve promoted lessons, and why bad memory can be worse than amnesia.&lt;/p&gt;
&lt;p&gt;Version 1.1.0 shipped that same day. Today, July 20, we&amp;rsquo;re at &lt;strong&gt;1.17.1&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Version numbers alone don&amp;rsquo;t mean much, so I counted what actually happened after that post went live: &lt;strong&gt;31 releases, 55 merged pull requests, and 46 closed issues&lt;/strong&gt;. I counted &lt;strong&gt;24 groups of new user-facing features&lt;/strong&gt; in the &lt;a href="https://github.com/akitaonrails/ai-memory/blob/main/CHANGELOG.md"target="_blank" rel="noopener"&gt;CHANGELOG&lt;/a&gt;, ignoring fixes, documentation, and internal details from the same delivery. If I split the new &lt;code&gt;ai-memory run&lt;/code&gt; family into auto-selection, session adoption, Crush support, &lt;code&gt;--yolo&lt;/code&gt;, search, and recovery, we&amp;rsquo;d blow past that number.&lt;/p&gt;</description><content:encoded><![CDATA[<p>It&rsquo;s been a little over a month since I published <a href="/en/2026/06/16/ai-memory-long-term-memory-karpathy-wiki-self-improvement-hermes-projects/">ai-memory: long-term memory (Karpathy Wiki) and self-improvement (Hermes) for your projects</a>. That was June 16. In that post I explained how sessions became Markdown pages, how auto-improve promoted lessons, and why bad memory can be worse than amnesia.</p>
<p>Version 1.1.0 shipped that same day. Today, July 20, we&rsquo;re at <strong>1.17.1</strong>.</p>
<p>Version numbers alone don&rsquo;t mean much, so I counted what actually happened after that post went live: <strong>31 releases, 55 merged pull requests, and 46 closed issues</strong>. I counted <strong>24 groups of new user-facing features</strong> in the <a href="https://github.com/akitaonrails/ai-memory/blob/main/CHANGELOG.md"target="_blank" rel="noopener">CHANGELOG</a>, ignoring fixes, documentation, and internal details from the same delivery. If I split the new <code>ai-memory run</code> family into auto-selection, session adoption, Crush support, <code>--yolo</code>, search, and recovery, we&rsquo;d blow past that number.</p>
<p>Fifteen people had PRs merged during that period, fourteen besides me. Special thanks go to <a href="https://github.com/djalmajr"target="_blank" rel="noopener">Djalma Júnior</a>, who alone had 24 PRs merged, <a href="https://github.com/matheus-rodrigues00"target="_blank" rel="noopener">Matheus Rodrigues</a>, with five, <a href="https://github.com/lhzapata"target="_blank" rel="noopener">lhzapata</a>, with four, <a href="https://github.com/rthiago"target="_blank" rel="noopener">Thiago Silva</a> and <a href="https://github.com/cristianodewes"target="_blank" rel="noopener">Cristiano Dewes</a>, with two each. Nine more contributors had a PR merged. This stopped being &ldquo;a little program I made over a weekend&rdquo; a while ago.</p>
<p>I&rsquo;m not going to dump 55 PRs here. I want to talk about the change that affects my daily use the most: the new <strong><code>ai-memory run</code></strong>.</p>
<h2>The session is part of the project too<span class="hx:absolute hx:-mt-20" id="the-session-is-part-of-the-project-too"></span>
    <a href="#the-session-is-part-of-the-project-too" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>Code is the result that survived. It doesn&rsquo;t preserve the entire investigation.</p>
<p>Git shows that you replaced Redis with SQLite. Maybe the commit explains part of it. But where is the Redis experiment? Where is the intermittent bug that only showed up with two workers? Who remembered that the first solution broke on Windows? Why did the team change its mind after three hours? Which workaround was temporary, and which one became the decision?</p>
<p>Much of that exists only in the agent session.</p>
<p>When I program with Claude Code or Codex, the session accumulates the project&rsquo;s operational reasoning: questions, corrections, discarded attempts, test results, surprises, decisions, and changes in direction. The final code shows what stayed. The session explains how we got there.</p>
<p>And an LLM session, at the end of the day, is text. Claude Code writes JSONL. Codex does too. OpenCode uses SQLite. Pi, OMP, and Crush have their own formats and directories. Each harness packages the conversation differently, but the visible content is still messages and tool results.</p>
<p>Why should I leave the most expensive part of the work trapped inside the harness?</p>
<p>Anthropic can change limits, pricing, models, or formats tomorrow. OpenAI can too. An agent can be excellent this week and unbearable the next. I want to swap the engine without throwing away the whole trip.</p>
<p>That has been ai-memory&rsquo;s thesis from the start: <strong>the programmer must remain independent of provider whims</strong>. Models and harnesses are replaceable. The project memory is mine.</p>
<h2>Handoffs solved only half the problem<span class="hx:absolute hx:-mt-20" id="handoffs-solved-only-half-the-problem"></span>
    <a href="#handoffs-solved-only-half-the-problem" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>ai-memory already handled handoffs. I would close Claude Code, the hooks would consolidate the session, and the next Codex would receive a short summary with what had been done, open questions, and next steps.</p>
<p>That still exists and is still useful. Anyone who opens <code>claude</code>, <code>codex</code>, or <code>opencode</code> directly keeps the previous behavior. The new launcher is opt-in.</p>
<p>But a handoff is deliberately lossy compression. It preserves what seems most important at that moment. It isn&rsquo;t meant to carry the entire session or resume each harness&rsquo;s native session. If the summary left out an old attempt that became relevant again two hours later, you have to search the wiki or the records.</p>
<p><code>ai-memory run</code> adds another layer: a <strong>managed workstream</strong>, one line of work that crosses harnesses.</p>
<h2>Claude now, Codex in a little while<span class="hx:absolute hx:-mt-20" id="claude-now-codex-in-a-little-while"></span>
    <a href="#claude-now-codex-in-a-little-while" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>Basic usage looks like this:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">

<div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl"><span class="nb">cd</span> ~/Projects/meu-projeto
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">ai-memory run claude
</span></span><span class="line"><span class="cl"><span class="c1"># work, then exit Claude Code normally</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">ai-memory run codex --yolo
</span></span><span class="line"><span class="cl"><span class="c1"># Codex continues the same line of work</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">ai-memory run claude --model opus
</span></span><span class="line"><span class="cl"><span class="c1"># return to Claude&#39;s previous native session</span>
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl">ai-memory run
</span></span><span class="line"><span class="cl"><span class="c1"># or let ai-memory choose the right harness to continue</span></span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
  <button
    class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
    title="Copy code"
  >
    <div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
  </button>
</div>
</div>
<p>You don&rsquo;t need <code>--</code> to separate arguments. Everything after the harness name goes to it, with one deliberate exception: <code>--yolo</code> belongs to the wrapper and is translated into the native dangerous option for Claude Code, Codex, OpenCode, Pi, or Crush.</p>
<p>Under the hood, ai-memory doesn&rsquo;t try to convert a Codex file into a Claude file. That would be fragile and would probably break on the next update. Each harness keeps its own native session. The workstream connects those sessions to a portable ledger containing the visible part of the conversation.</p>
<p>Think of it this way:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">

<div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-text" data-lang="text"><span class="line"><span class="cl">Claude native session ─┐
</span></span><span class="line"><span class="cl">Codex native session  ─┼─ workstream ─ portable context
</span></span><span class="line"><span class="cl">OpenCode session      ─┤                 + full search
</span></span><span class="line"><span class="cl">Pi native session     ─┘</span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
  <button
    class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
    title="Copy code"
  >
    <div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
  </button>
</div>
</div>
<p>The first time Claude enters that workstream, it gets a native session. When you switch to Codex, Codex gets its own native session and receives the portable delta it hasn&rsquo;t seen yet. When you return to Claude, the launcher uses Claude Code&rsquo;s own <code>--resume</code> and delivers only what happened in the other harnesses since the last visit.</p>
<p>This is very different from starting a new chat with a summary pasted into the prompt. Claude returns to its real session. Codex returns to its real session. ai-memory handles continuity between the two.</p>
<p>Managed mode currently supports <strong>Claude Code, Codex, OpenCode, Pi, Crush, and OMP</strong>. General ai-memory support is broader, with MCP and hooks for other clients, but that doesn&rsquo;t mean every client already has a native-session adapter for <code>run</code>. Those are different contracts, and I prefer to make that explicit.</p>
<h2>What goes into the workstream<span class="hx:absolute hx:-mt-20" id="what-goes-into-the-workstream"></span>
    <a href="#what-goes-into-the-workstream" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>When the harness exits, ai-memory reads the tail of the native session without modifying the original store. It imports visible user and assistant messages, completed tool calls with their results, compaction summaries, and a non-mutating Git checkpoint. Every event keeps its origin: Claude, Codex, OpenCode, Pi, Crush, or OMP.</p>
<p>Provider credentials, encrypted records, system and developer prompts, and hidden reasoning stay out. Private formats the adapter doesn&rsquo;t understand stay out too and produce a loss annotation instead of letting the system pretend it imported everything.</p>
<p>Records pass through the sanitizer before entering ai-memory&rsquo;s searchable ledger and immutable JSONL segments. The adapter opens native stores read-only; the harness itself remains the writer.</p>
<p>I don&rsquo;t cram the entire session into the next prompt either. That would recreate the problem the project is trying to solve: too much raw context, too much cost, and too much noise. The next agent gets a size-limited recent delta. If an old decision matters again, the full ledger remains searchable:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">

<div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ai-memory workstream-search <span class="s2">&#34;por que desistimos do Redis&#34;</span>
</span></span><span class="line"><span class="cl">ai-memory workstream-search --limit <span class="m">50</span> --json <span class="s2">&#34;migration que falhou&#34;</span></span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
  <button
    class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
    title="Copy code"
  >
    <div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
  </button>
</div>
</div>
<p>Inside an <code>ai-memory run</code>, the workstream ID is already in the environment. The agent doesn&rsquo;t have to discover some UUID.</p>
<p>And the ledger doesn&rsquo;t replace the wiki. It handles operational continuity. Decisions, rules, procedures, and gotchas that need to survive for months still deserve consolidated Markdown pages. A raw session is evidence. A wiki is organized knowledge.</p>
<h2>Can I keep more than one line of work?<span class="hx:absolute hx:-mt-20" id="can-i-keep-more-than-one-line-of-work"></span>
    <a href="#can-i-keep-more-than-one-line-of-work" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>Yes. The default workstream is called <code>default</code>, selected by repository and worktree. If I want an independent line for an investigation without contaminating the main work:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">

<div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ai-memory run --new investigar-race claude
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># later, continue that line with another harness</span>
</span></span><span class="line"><span class="cl">ai-memory run --workstream investigar-race codex</span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
  <button
    class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
    title="Copy code"
  >
    <div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
  </button>
</div>
</div>
<p>A lease prevents two windows from writing to the same workstream at once. On a normal exit, the launcher imports the tail of the session and releases it immediately. If someone kills the process without cleanup, the lease expires within 90 seconds and the next run resumes from the last confirmed cursor without duplicating imported events.</p>
<p>One stupid annoyance kept coming back: I would reopen a project after a few days and have no idea whether the newest session was in Claude or Codex. I&rsquo;d guess, open one, realize the context was in the other, close it, and try again.</p>
<p>Now I just run:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">

<div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ai-memory run
</span></span><span class="line"><span class="cl">
</span></span><span class="line"><span class="cl"><span class="c1"># or keep the same auto-selection in YOLO mode</span>
</span></span><span class="line"><span class="cl">ai-memory run --yolo</span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
  <button
    class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
    title="Copy code"
  >
    <div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
  </button>
</div>
</div>
<p>In an empty workstream, ai-memory looks for local sessions from that checkout in Claude Code, Codex, OpenCode, Pi, and Crush, finds the newest one, and opens the right harness for me. In an established workstream, server memory beats the file timestamp: it returns to the last harness attached to that work instead of accidentally adopting an old session that happened to receive a newer write. OMP remains available when selected explicitly, but it doesn&rsquo;t participate in auto-selection yet.</p>
<p>On the first explicit run, the launcher can also offer existing sessions from the same checkout for adoption. You can start using it without abandoning the chat that was already open before you updated ai-memory.</p>
<h2>Other new features I actually use<span class="hx:absolute hx:-mt-20" id="other-new-features-i-actually-use"></span>
    <a href="#other-new-features-i-actually-use" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>I promised I wouldn&rsquo;t read the entire changelog out loud, but a few changes from this month deserve a mention because they reduce work for the programmer.</p>
<h3>A briefing before the first question<span class="hx:absolute hx:-mt-20" id="a-briefing-before-the-first-question"></span>
    <a href="#a-briefing-before-the-first-question" class="subheading-anchor" aria-label="Permalink for this section"></a></h3><p>A project can request an automatic briefing at the start of every session:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">

<div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">briefing</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="nx">inject_on_session_start</span> <span class="p">=</span> <span class="s2">&#34;true&#34;</span>
</span></span><span class="line"><span class="cl"><span class="nx">max_chars</span> <span class="p">=</span> <span class="mi">4000</span></span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
  <button
    class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
    title="Copy code"
  >
    <div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
  </button>
</div>
</div>
<p>ai-memory assembles a package with pinned pages, <code>_rules/</code>, <code>_slots/</code>, and recent titles. The agent starts with the project&rsquo;s rules and basic state instead of spending the first conversation rediscovering the architecture. It&rsquo;s opt-in because it consumes context on every SessionStart, including after a Claude <code>/clear</code>.</p>
<h3>Global preferences and cross-project search<span class="hx:absolute hx:-mt-20" id="global-preferences-and-cross-project-search"></span>
    <a href="#global-preferences-and-cross-project-search" class="subheading-anchor" aria-label="Permalink for this section"></a></h3><p>Preferences that apply to all my work can now live in the reserved <code>_global</code> scope: coding style, preferred tools, personal rules, and conventions that don&rsquo;t belong to one specific repository. Normal queries already combine that scope with the current project.</p>
<p>For meta-repos that need to query several sibling projects all the time, there is another opt-in:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">

<div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">recall</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="nx">default_global</span> <span class="p">=</span> <span class="s2">&#34;true&#34;</span></span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
  <button
    class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
    title="Copy code"
  >
    <div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
  </button>
</div>
</div>
<p>With that, <code>memory_query</code> and <code>memory_recent</code> without an explicit scope search every project. I don&rsquo;t turn it on in every repo because gratuitous global search only adds noise.</p>
<h3>Less static instruction, more Agent Skills<span class="hx:absolute hx:-mt-20" id="less-static-instruction-more-agent-skills"></span>
    <a href="#less-static-instruction-more-agent-skills" class="subheading-anchor" aria-label="Permalink for this section"></a></h3><p>The routing block in <code>CLAUDE.md</code> or <code>AGENTS.md</code> got smaller. Detailed instructions for when to search memory, consolidate, save a decision, or create a handoff moved into managed Agent Skills. One command installs or updates both without trampling the rest of the file:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">

<div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ai-memory install-instructions</span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
  <button
    class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
    title="Copy code"
  >
    <div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
  </button>
</div>
</div>
<p>That reduces drift too. When the protocol changes, I update the managed package instead of hunting down an old prompt copied across forty repositories.</p>
<h3>Privacy before the network<span class="hx:absolute hx:-mt-20" id="privacy-before-the-network"></span>
    <a href="#privacy-before-the-network" class="subheading-anchor" aria-label="Permalink for this section"></a></h3><p>Each repo can now exclude paths from capture:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">

<div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-toml" data-lang="toml"><span class="line"><span class="cl"><span class="p">[</span><span class="nx">capture</span><span class="p">]</span>
</span></span><span class="line"><span class="cl"><span class="nx">ignore_paths</span> <span class="p">=</span> <span class="p">[</span><span class="s2">&#34;private/**&#34;</span><span class="p">,</span> <span class="s2">&#34;~/personal-notes/**&#34;</span><span class="p">]</span></span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
  <button
    class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
    title="Copy code"
  >
    <div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
  </button>
</div>
</div>
<p>When an integration recognizes a file tool and the path matches, the event is discarded locally before spool, queue, network, or server. The limits are clear: this isn&rsquo;t magic DLP, it doesn&rsquo;t understand every shell command, and it doesn&rsquo;t track content quoted in free-form text. But it handles the verifiable case without selling a fake guarantee.</p>
<p>There are also new integrations with Kimi Code, Grok Build CLI, Devin, and Zero, an OpenCode Zen/Go provider, <code>finalize-session</code> for Codex, and workspace-administration improvements. Again: having MCP and a hook doesn&rsquo;t automatically mean having <code>ai-memory run</code>. The <a href="https://github.com/akitaonrails/ai-memory#support-matrix"target="_blank" rel="noopener">README</a> separates those levels.</p>
<h2>Bonus: ai-jail on the outside, YOLO on the inside<span class="hx:absolute hx:-mt-20" id="bonus-ai-jail-on-the-outside-yolo-on-the-inside"></span>
    <a href="#bonus-ai-jail-on-the-outside-yolo-on-the-inside" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>Just over a week ago I wrote about <a href="/en/2026/07/11/how-to-protect-yourself-from-agents-deleting-your-stuff/">how I protect myself from agents deleting my stuff</a>. My recommendation remains the same: YOLO mode gives the best experience, provided the system limits the possible damage.</p>
<p><a href="https://github.com/akitaonrails/ai-jail"target="_blank" rel="noopener">ai-jail</a> reached version 1.15.0 and now understands the ai-memory launcher. My favorite way to work has become:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">

<div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ai-jail ai-memory run codex --yolo</span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
  <button
    class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
    title="Copy code"
  >
    <div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
  </button>
</div>
</div>
<p>Or, when I want ai-memory to choose which harness should continue:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">

<div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ai-jail ai-memory run --yolo</span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
  <button
    class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
    title="Copy code"
  >
    <div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
  </button>
</div>
</div>
<p>Order matters. <code>ai-jail</code> stays on the outside so the launcher and child process remain inside the same sandbox. <code>ai-memory run</code> by itself manages the session, but it doesn&rsquo;t create a sandbox.</p>
<p><code>--yolo</code> gets rid of the harness&rsquo;s approval ceremony. ai-jail handles containment: the current project is read-write, home is replaced with tmpfs, necessary parts of agent state are mounted selectively, and sensitive directories such as <code>.ssh</code>, <code>.gnupg</code>, and <code>.aws</code> stay outside the jail. The new support also keeps ai-memory&rsquo;s local state writable so hooks can maintain spools and cursors between runs.</p>
<p>ai-jail recognizes both the <code>ai-memory</code> layer and the selected harness. If you have Codex-specific global configuration, for example, it still applies when the actual command is <code>ai-memory run codex</code>. Even the status-bar redraw adjustment understands that the child is Codex.</p>
<p>This combination takes care of both annoyances at once: the agent stops asking for confirmation on every command, and the session stops belonging to the agent. You get the speed without handing over your entire home directory.</p>
<h2>One more thing: ai-usagebar grew too<span class="hx:absolute hx:-mt-20" id="one-more-thing-ai-usagebar-grew-too"></span>
    <a href="#one-more-thing-ai-usagebar-grew-too" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>When I published the <a href="/en/2026/05/24/i-built-a-waybar-widget-for-omarchy-to-monitor-llm-usage-ai-usagebar/">original ai-usagebar</a>, it monitored Claude, Codex, Z.AI, and OpenRouter in a Waybar widget or TUI. Version 0.14.0 already covers <strong>eleven usage, spending, or balance integrations</strong>.</p>
<p>Kimi got the two pieces of information that really matter for coding: weekly subscription quota and the rolling five-hour window. Kilo, Novita, Moonshot, and Grok show remaining balance. A separate Anthropic Console integration shows API spending for the month without conflating it with the Claude Code subscription. It makes clear that the Cost API doesn&rsquo;t include Priority Tier.</p>
<p>You can also register multiple Anthropic accounts, see weekly limits for specific models such as Fable, and get a pace marker. The bar doesn&rsquo;t turn red just because it reached 40%; it compares the percentage spent with how much of the window has passed. If I used 40% in 20% of the week, I&rsquo;m moving too fast. That&rsquo;s the useful information.</p>
<p>The project outgrew Waybar. It has a native macOS menu bar app, a GNOME extension, and a standalone TUI. The newest addition is a local Claude Code context monitor: I press <code>c</code>, choose one of the recent sessions, and see how much of the window it has consumed. It reads limited tails from local JSONL files and doesn&rsquo;t invent a percentage when it can&rsquo;t determine the window size.</p>
<p>In my workflow, the three end up working together. <code>ai-usagebar</code> shows which subscription still has room. <code>ai-memory run</code> switches harnesses without throwing away the work. <code>ai-jail</code> lets the chosen one run in YOLO without unrestricted access to the machine.</p>
<h2>Updating<span class="hx:absolute hx:-mt-20" id="updating"></span>
    <a href="#updating" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>The installation pages for all three projects cover every method, including AUR, Homebrew, and release binaries:</p>
<ul>
<li><a href="https://github.com/akitaonrails/ai-memory"target="_blank" rel="noopener">ai-memory</a></li>
<li><a href="https://github.com/akitaonrails/ai-jail"target="_blank" rel="noopener">ai-jail</a></li>
<li><a href="https://github.com/akitaonrails/ai-usagebar"target="_blank" rel="noopener">ai-usagebar</a></li>
</ul>
<p>After updating ai-memory, reinstall the hooks for the harnesses you plan to use in managed mode. The three main ones in my case:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">

<div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ai-memory install-hooks --agent claude-code --apply
</span></span><span class="line"><span class="cl">ai-memory install-hooks --agent codex --apply
</span></span><span class="line"><span class="cl">ai-memory install-hooks --agent opencode --apply</span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
  <button
    class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
    title="Copy code"
  >
    <div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
  </button>
</div>
</div>
<p>Crush doesn&rsquo;t need a hook in managed mode; it receives context through a temporary file configured only for the launched process. The <a href="https://github.com/akitaonrails/ai-memory/blob/main/docs/managed-workstreams.md"target="_blank" rel="noopener">managed workstreams documentation</a> covers installation, privacy, recovery, and native arguments for each adapter.</p>
<h2>Conclusion<span class="hx:absolute hx:-mt-20" id="conclusion"></span>
    <a href="#conclusion" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>A month ago, ai-memory could already turn a session into a wiki and hand off to the next agent. Now it can manage the line of work itself: adopt an existing session, keep one native session per harness, carry visible history, resume each client in its own format, and keep the entire ledger searchable.</p>
<p>For me, that&rsquo;s the value. The code contains the implementation that won. The session contains the decisions, failed experiments, gotchas, unexpected bugs, and changes of mind that produced that implementation. Throwing all of it away every time you change providers is wasteful.</p>
<p>A raw transcript doesn&rsquo;t solve the problem by itself either. It&rsquo;s large, repetitive, and expensive to stuff into every context. ai-memory keeps the evidence, delivers only the recent delta, and uses consolidation to turn what deserves to survive into short Markdown pages.</p>
<p>There are still new formats to support, platform rough edges, and plenty of testing ahead. The difference is that there is now a real foundation, with an acceptance test that calls actual harnesses, 14 outside contributors with merged PRs in a little over a month, and daily use pushing the design forward.</p>
<p>I rent LLMs and subscriptions from whoever is delivering the best service today. My project&rsquo;s session stays with me.</p>
]]></content:encoded><category>ai-memory</category><category>coding-agents</category><category>ai-jail</category><category>ai-usagebar</category></item><item><title>Playing with TUIs and LLMs - Ratatui+Bubbletea</title><link>https://akitaonrails.github.io/en/2026/06/08/playing-with-tuis-llms-ratatui-bubbletea/</link><guid isPermaLink="true">https://akitaonrails.github.io/en/2026/06/08/playing-with-tuis-llms-ratatui-bubbletea/</guid><pubDate>Mon, 08 Jun 2026 16:00:00 -0300</pubDate><description>&lt;p&gt;Before getting to the new toy, a quick reminder: &lt;a href="https://github.com/akitaonrails/ai-jail"target="_blank" rel="noopener"&gt;ai-jail&lt;/a&gt; and &lt;a href="https://github.com/akitaonrails/ai-memory"target="_blank" rel="noopener"&gt;ai-memory&lt;/a&gt; are still getting plenty of attention. Issues, pull requests, small fixes, packaging improvements, environment bugs, documentation tweaks. The stuff nobody sees in a launch post, but that turns an experiment into something you can use every day.&lt;/p&gt;
&lt;p&gt;I like this phase. The project stops being &amp;ldquo;what I imagined in my setup&amp;rdquo; and becomes &amp;ldquo;what breaks on somebody else&amp;rsquo;s machine.&amp;rdquo; Then Windows shows up. macOS. Arch. AUR. Weird paths. Tokens saved somewhere else. Different shell. Different terminal. Annoying? Yes. Necessary? Also yes.&lt;/p&gt;</description><content:encoded><![CDATA[<p>Before getting to the new toy, a quick reminder: <a href="https://github.com/akitaonrails/ai-jail"target="_blank" rel="noopener">ai-jail</a> and <a href="https://github.com/akitaonrails/ai-memory"target="_blank" rel="noopener">ai-memory</a> are still getting plenty of attention. Issues, pull requests, small fixes, packaging improvements, environment bugs, documentation tweaks. The stuff nobody sees in a launch post, but that turns an experiment into something you can use every day.</p>
<p>I like this phase. The project stops being &ldquo;what I imagined in my setup&rdquo; and becomes &ldquo;what breaks on somebody else&rsquo;s machine.&rdquo; Then Windows shows up. macOS. Arch. AUR. Weird paths. Tokens saved somewhere else. Different shell. Different terminal. Annoying? Yes. Necessary? Also yes.</p>
<p>But today&rsquo;s main dish is not ai-jail or ai-memory. It&rsquo;s TUI. More specifically, my recent habit of writing small terminal tools in Rust with <a href="https://ratatui.rs/"target="_blank" rel="noopener">Ratatui</a>, while wanting them to look like <a href="https://github.com/charmbracelet/bubbletea"target="_blank" rel="noopener">Bubble Tea</a>.</p>
<h2>The app I won&rsquo;t open<span class="hx:absolute hx:-mt-20" id="the-app-i-wont-open"></span>
    <a href="#the-app-i-wont-open" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>Over the last few weeks I also worked on a private project I do not plan to open source. It&rsquo;s a TUI to track my US bank account, investments, assets, positions, covered calls, open calls, all that boring grown-up stuff. I won&rsquo;t publish the code because this tool was born glued to my financial workflow, my spreadsheets, my statements, and my internal hacks. Opening it would turn a tool for myself into free support for other people&rsquo;s bank bugs. No thanks.</p>
<p>But I can show the general look. I censored what needed censoring:</p>
<p><strong>Obvious note, but I&rsquo;ll make it explicit: every value, ticker, position, and date shown in the screenshot is bogus demonstration data. It is not real account data, not my real portfolio, and not investment advice.</strong></p>
<p><img src="https://new-uploads-akitaonrails.s3.us-east-2.amazonaws.com/2026/06/08/ratatui-bubbletea/private-portfolio-censored.png" alt="Private portfolio TUI in a terminal, with dashboard tabs and a holdings table. The bank name was censored."  loading="lazy" /></p>
<p><img src="https://new-uploads-akitaonrails.s3.us-east-2.amazonaws.com/2026/06/08/ratatui-bubbletea/private-allocation-censored.png" alt="Private TUI showing an asset allocation view, with sensitive names censored."  loading="lazy" /></p>
<p><img src="https://new-uploads-akitaonrails.s3.us-east-2.amazonaws.com/2026/06/08/ratatui-bubbletea/private-open-calls-censored.png" alt="Private TUI showing an open calls tab with bogus demonstration data and sensitive names censored."  loading="lazy" /></p>
<p>Every time I build a small TUI, the same question comes back: what stack should I use?</p>
<p>If I were writing everything by hand, I would probably pick Python or Go. They are more comfortable for this kind of small utility. Python because it is direct, full of libraries, great for scripts that talk to APIs and parse JSON. Go because it produces simple binaries, cross-platform support is sane, and the CLI ergonomics are good.</p>
<p>But today I rarely write all that code by hand. I orchestrate Claude, Codex, OpenCode, ask for reviews, ask for refactors, ask for tests. In that setup, Rust&rsquo;s lack of ergonomics hurts less, because the LLM is the one fighting the borrow checker, trait bounds, and annoying lifetimes. I stay closer to reviewer and end user. And then Rust starts looking very attractive.</p>
<p>Good tooling. <code>cargo</code> is great. Tests are easy to run. Cross compile is manageable. The final binary is clean. Dumb memory bugs mostly disappear. I am not saying Rust is magically better than Go or Python for every TUI. It isn&rsquo;t. But with an LLM writing most of it, the cost that would usually make me avoid Rust drops a lot. And current models are surprisingly competent with Rust, as long as you make them run tests, fix warnings, and you don&rsquo;t accept the first version as if Moses brought it down from the mountain.</p>
<h2>Ratatui is good, but I wanted the Charm look<span class="hx:absolute hx:-mt-20" id="ratatui-is-good-but-i-wanted-the-charm-look"></span>
    <a href="#ratatui-is-good-but-i-wanted-the-charm-look" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p><a href="https://ratatui.rs/"target="_blank" rel="noopener">Ratatui</a> is a Rust library for building full terminal interfaces: dashboards, interactive apps, tables, lists, gauges, layouts, the whole thing we used to call &ldquo;modern ncurses.&rdquo; It grew out of <code>tui-rs</code>, and today it is probably the obvious path if you want to build a serious TUI in Rust.</p>
<p>Ratatui works well. My problem is taste: by default, I don&rsquo;t find it pretty. Not ugly in the &ldquo;this looks like a DOS program from 1993&rdquo; sense. You can build good-looking stuff with it. But many Ratatui TUIs fall into that square, gray, functional look, like a datacenter admin panel.</p>
<p>I like the <a href="https://charm.sh/"target="_blank" rel="noopener">Charmbracelet</a> vibe more. <code>gum</code>, for example, is a collection of commands that make shell scripts interactive without turning them into a festival of <code>read -p</code> and <code>case</code>. Prompt, select, filter, spinner, table, pager, styling. You can make a bash script feel like a decent app in minutes.</p>
<p>And then there is <a href="https://github.com/charmbracelet/bubbletea"target="_blank" rel="noopener">Bubble Tea</a>, in Go, inspired by Elm architecture. You have a model, receive messages, update state, render a view. Simple idea, very good fit for terminal apps: state comes in, event comes in, view goes out. Charm also has visual taste I like: good colors, decent spacing, light components, nothing that looks like a WinForms form thrown into a terminal.</p>
<p>So I wanted this: stay in Rust with Ratatui, but steal the feeling of Bubble Tea. Not the whole runtime. Not a perfect clone. Just the visual direction and a few components.</p>
<p>That is how <a href="https://github.com/akitaonrails/ratatui-bubbletea"target="_blank" rel="noopener">ratatui-bubbletea</a> was born.</p>
<p><img src="https://new-uploads-akitaonrails.s3.us-east-2.amazonaws.com/2026/06/08/ratatui-bubbletea/ratatui-bubbletea-example.png" alt="ratatui-bubbletea demo running in a terminal, with SelectList, Spinner, Theme, ThemedTable, TextInput, Progress, and Viewport in a Charm-like style."  loading="lazy" /></p>
<p>The project does not replace Ratatui. It sits on top. The idea is to offer a theme and component layer inspired by Bubble Tea/Bubbles, while still rendering through Ratatui.</p>
<p>Right now it is split into crates:</p>
<ul>
<li><code>ratatui-bubbletea-theme</code>, with palette, helpers, and shared styles.</li>
<li><code>ratatui-bubbletea-components</code>, with ready-made components like select list, spinner, progress, table, text input, viewport, and help.</li>
<li><code>ratatui-tea</code>, optional, for people who want ergonomics closer to <code>Model</code>, <code>Msg</code>, and <code>Cmd</code>, without pretending Rust became Go.</li>
</ul>
<p>The README has the full examples and documentation for what exists today. For now, I treat it as a small toolkit. It serves my apps, and if it serves somebody else, fine. If it doesn&rsquo;t, no drama either. The goal was to stop reimplementing the same theme and the same widgets every time I started a new TUI.</p>
<h2>ai-usagebar as the public example<span class="hx:absolute hx:-mt-20" id="ai-usagebar-as-the-public-example"></span>
    <a href="#ai-usagebar-as-the-public-example" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>Since I won&rsquo;t open the financial app, I needed a public example using this aesthetic. So I updated my <a href="https://github.com/akitaonrails/ai-usagebar"target="_blank" rel="noopener">ai-usagebar</a>.</p>
<p>If you don&rsquo;t remember it, I explained the project in <a href="/en/2026/05/24/i-built-a-waybar-widget-for-omarchy-to-monitor-llm-usage-ai-usagebar/">&ldquo;I Built a Waybar Widget for Omarchy to Monitor LLM Plan Usage: ai-usagebar&rdquo;</a>. It started as a Waybar widget to show LLM plan usage: Claude, OpenAI Codex/ChatGPT, Z.AI, OpenRouter. One glance at the bar and I know whether I am close to the limit and which vendor to use next.</p>
<p>Later it also became a standalone TUI. And thanks to contributions, it now supports Windows too. That is funny because its origin is completely Linux/Omarchy/Waybar. But that is open source: somebody uses it in another environment, finds friction, sends a PR, and now the project is a little less provincial.</p>
<p><img src="https://new-uploads-akitaonrails.s3.us-east-2.amazonaws.com/2026/06/08/ratatui-bubbletea/ai-usagebar.png" alt="ai-usagebar in TUI mode showing an OpenAI usage dashboard, vendor tabs, limit gauges, and footer shortcuts."  loading="lazy" /></p>
<p>In ai-usagebar, the visual change will not alter anybody&rsquo;s life. It is a simple screen. Tabs, gauges, text, shortcuts. But it is a good example because it is small, real, tested, packaged, and does not depend on my private app. You can look at the code and see how I applied the theme layer.</p>
<h2>The scratch-my-own-itch apps<span class="hx:absolute hx:-mt-20" id="the-scratch-my-own-itch-apps"></span>
    <a href="#the-scratch-my-own-itch-apps" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>All these projects follow the same logic: I have an itch, I make a small tool, I use it, adjust it, package it. No startup roadmap. No manifesto. Just a tool that fixes something annoying in my own setup.</p>
<p>One recent example is <a href="https://github.com/akitaonrails/clock-tui"target="_blank" rel="noopener">clock-tui</a>. It did not start with me. It was an old Rust project, <code>tclock</code>, that looked abandoned. I wanted a big clock on my second vertical monitor. That monitor sits on the side, and I like having a huge desk clock taking up part of the screen. I used the original clock-tui for a while.</p>
<p>But an entire vertical screen just to show the time is wasteful. I already had <a href="https://github.com/akitaonrails/ghpending"target="_blank" rel="noopener">ghpending</a>, which lists open issues and PRs across all my projects. It is my &ldquo;is anybody waiting for an answer?&rdquo; in CLI form. I also wanted to see my agenda.</p>
<p>So I made another small app: <a href="https://github.com/akitaonrails/google-calendar-tui"target="_blank" rel="noopener">google-calendar-tui</a>. It uses the Gmail accounts already registered in GNOME Online Accounts and summarizes my upcoming appointments in the terminal. Read-only. No new OAuth ritual. No extra secret config scattered somewhere weird.</p>
<p>With those two pieces, I modernized clock-tui and added auto-refreshing widget layout support. Now the clock takes the screen the way I wanted, but around it I also get GitHub pending work and Google Calendar appointments.</p>
<p><img src="https://new-uploads-akitaonrails.s3.us-east-2.amazonaws.com/2026/06/08/ratatui-bubbletea/tclock.png" alt="tclock on a vertical monitor, with a large clock, GitHub pending widget on the left, and Google Calendar agenda on the right."  loading="lazy" /></p>
<p>This is exactly the kind of thing I would never build if it cost me an entire weekend. But with an LLM, it becomes a sequence of small tasks: read the old project, modernize dependencies, run tests, add a widget module, call ghpending, call google-calendar-tui, organize layout, fix bugs, package. It still takes work. But it is supervision and refinement work, not fighting boilerplate.</p>
<h2>Tweaking Geary without a fork<span class="hx:absolute hx:-mt-20" id="tweaking-geary-without-a-fork"></span>
    <a href="#tweaking-geary-without-a-fork" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>Another itch came from GNOME.</p>
<p>Since I wanted to centralize my accounts in GNOME Online Accounts, I started using <a href="https://wiki.gnome.org/Apps/Geary"target="_blank" rel="noopener">Geary</a> and GNOME Calendar on the second monitor too. I like the idea: accounts configured once, desktop apps reusing the same infrastructure, no tiny program inventing its own login flow.</p>
<p>The problem is that Geary has a fixed three-column layout. On a normal screen, fine. On a vertical monitor, it gets cramped. The folder column, message list, and email body fight for space. I did not want to maintain a Geary fork just to hide a sidebar. Forking a large GTK app is debt. You blink and spend the rest of your life resolving merge conflicts.</p>
<p>So I made a GTK module: <a href="https://github.com/akitaonrails/geary-hide-sidebar-module"target="_blank" rel="noopener">geary-hide-sidebar-module</a>. It injects behavior into Geary at runtime and lets me collapse/expand the sidebar, with a shortcut and auto-collapse for narrow windows. No rebuilding Geary. No fork to maintain. Just a small module with one very specific job.</p>
<p><img src="https://new-uploads-akitaonrails.s3.us-east-2.amazonaws.com/2026/06/08/ratatui-bubbletea/geary-sidebar-hidden.png" alt="Geary with the sidebar collapsed, showing the email list and message body in a more comfortable layout for a vertical screen."  loading="lazy" /></p>
<p>This is a good lesson: sometimes you do not need to fork the whole application. You can adjust it from the outside. GTK_MODULES exists. Wrappers exist. Config exists. CSS exists. Scripts exist. Not every customization has to become eternal maintenance of somebody else&rsquo;s code.</p>
<h2>Small code got cheap<span class="hx:absolute hx:-mt-20" id="small-code-got-cheap"></span>
    <a href="#small-code-got-cheap" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>That is why I keep insisting on this idea of small apps. With current LLMs, it became very easy to implement a specific idea to make your environment fit your needs. No waiting for someone else to have the exact same pain. No searching GitHub for three hours for a tool that does 80% of what you want and 40% of what you don&rsquo;t want.</p>
<p>You describe the itch, create a repo, ask for a prototype, test it, ask for refactoring, ask for tests, ask for packaging. If it sucks, throw it away. If it works, install it and use it.</p>
<p>I do not let this turn into random junk dumped in <code>~/bin</code> with no owner. My apps have tests. They have automated builds. Many have GitHub releases, AUR packages, normal installation with <code>yay</code> on Arch. They use XDG paths, so config goes to <code>~/.config</code>, cache goes to <code>~/.cache</code>, data goes to <code>~/.local/share</code>. Organized. Upgradable. Removable. Something another person can clone and contribute to.</p>
<p>Here are all the links in one place:</p>
<ul>
<li><a href="https://github.com/akitaonrails/ratatui-bubbletea"target="_blank" rel="noopener">ratatui-bubbletea</a></li>
<li><a href="https://github.com/akitaonrails/ai-usagebar"target="_blank" rel="noopener">ai-usagebar</a></li>
<li><a href="https://github.com/akitaonrails/clock-tui"target="_blank" rel="noopener">clock-tui</a></li>
<li><a href="https://github.com/akitaonrails/ghpending"target="_blank" rel="noopener">ghpending</a></li>
<li><a href="https://github.com/akitaonrails/google-calendar-tui"target="_blank" rel="noopener">google-calendar-tui</a></li>
<li><a href="https://github.com/akitaonrails/geary-hide-sidebar-module"target="_blank" rel="noopener">geary-hide-sidebar-module</a></li>
<li><a href="https://github.com/akitaonrails/ai-jail"target="_blank" rel="noopener">ai-jail</a></li>
<li><a href="https://github.com/akitaonrails/ai-memory"target="_blank" rel="noopener">ai-memory</a></li>
</ul>
<p>If you use any of them and it breaks in your setup, open an issue. If you know how to fix it, send a PR. I actually use these tools, so useful bug reports tend to turn into fixes fast.</p>
<p>My practical rule is this: customize your environment without turning everything into duct tape. Build small tools. Test them. Package them. Document them. Let the LLM carry the boring weight and use your brain to decide what is worth keeping.</p>
<p>That is the fun part of programming that had gone missing for a bit. Now it is back.</p>
]]></content:encoded><category>ai-usagebar</category><category>developer-tools</category><category>rust</category><category>open-source</category></item><item><title>Akita's AI Tips and Toolkit: ai-jail, ai-memory, ai-usagebar</title><link>https://akitaonrails.github.io/en/2026/05/24/akita-ai-tips-toolkit-ai-jail-ai-memory-ai-usagebar/</link><guid isPermaLink="true">https://akitaonrails.github.io/en/2026/05/24/akita-ai-tips-toolkit-ai-jail-ai-memory-ai-usagebar/</guid><pubDate>Sun, 24 May 2026 10:30:00 -0300</pubDate><description>&lt;p&gt;In last week&amp;rsquo;s post, &lt;a href="https://akitaonrails.github.io/en/2026/05/14/wrapping-up-my-ai-marathon-success-or-failure/"&gt;&amp;ldquo;Wrapping Up My AI Marathon: Success or Failure?&amp;rdquo;&lt;/a&gt;, I closed the first phase of my marathon. More than 600 hours of heavy coding-agent use, dozens of projects, hundreds of thousands of lines of code and documentation, and a pile of practical conclusions. Not marketing. Practical.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll repeat something important before someone starts cloning all my repositories thinking they are 1.0 products: most of the &lt;code&gt;frank-*&lt;/code&gt; projects on my GitHub are proofs of concept. Experiments. Some work well for me, in my environment, in my workflow. That does not mean they are ready to become a critical dependency in your company tomorrow morning. Want to play, contribute, study? Great. Just don&amp;rsquo;t confuse &amp;ldquo;I published it on GitHub&amp;rdquo; with &amp;ldquo;this is production ready.&amp;rdquo;&lt;/p&gt;</description><content:encoded><![CDATA[<p>In last week&rsquo;s post, <a href="/en/2026/05/14/wrapping-up-my-ai-marathon-success-or-failure/">&ldquo;Wrapping Up My AI Marathon: Success or Failure?&rdquo;</a>, I closed the first phase of my marathon. More than 600 hours of heavy coding-agent use, dozens of projects, hundreds of thousands of lines of code and documentation, and a pile of practical conclusions. Not marketing. Practical.</p>
<p>I&rsquo;ll repeat something important before someone starts cloning all my repositories thinking they are 1.0 products: most of the <code>frank-*</code> projects on my GitHub are proofs of concept. Experiments. Some work well for me, in my environment, in my workflow. That does not mean they are ready to become a critical dependency in your company tomorrow morning. Want to play, contribute, study? Great. Just don&rsquo;t confuse &ldquo;I published it on GitHub&rdquo; with &ldquo;this is production ready.&rdquo;</p>
<p>There are exceptions. <a href="https://github.com/akitaonrails/frankmd"target="_blank" rel="noopener">FrankMD</a>, for example, received a decent amount of contributions, tests, polish, real bug fixes, real use. Today it is much more stable than it was in the first post. Still, the point stands: these projects were born as a vibe-coding lab, not as a 3-year product plan with roadmap, enterprise support, and SLA.</p>
<p>This post is a roundup of what I learned in that lab. A few of my tools, a few habits, a few recommendations. Nothing mystical. No &ldquo;revolutionary new way to program.&rdquo; Old engineering with new tooling.</p>
<h2>First: stop collecting agents<span class="hx:absolute hx:-mt-20" id="first-stop-collecting-agents"></span>
    <a href="#first-stop-collecting-agents" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>If you are a normal developer, you do not need 12 agents, 40 wrappers, 7 orchestrators, and a Kubernetes diagram to choose who gets to write an <code>if</code>.</p>
<p>In practice, focus on <strong>Claude Code</strong>, <strong>Codex</strong>, or <strong>opencode</strong>. That&rsquo;s it.</p>
<p>Yes, Gemini CLI exists. Yes, Cursor exists. Yes, Windsurf, Crush, OpenClaw, Pi, Aider exist, and tomorrow another half-dozen will show up. I tested a bunch. Read my LLM benchmark posts, especially <a href="/en/2026/04/24/llm-benchmarks-parte-3-deepseek-kimi-mimo/">&ldquo;LLM Benchmarks Part 3: DeepSeek, Kimi, MiMo&rdquo;</a>. The conclusion is boring and obvious: today, the best cost-benefit options for heavy programming are <strong>Opus 4.7</strong> and <strong>GPT 5.5</strong> on subsidized Pro/Plus/Max plans. Nothing comes close when the job is spending several hours a day with a real coding agent.</p>
<p>Paying directly for tokens is expensive. Paying for a subsidized monthly plan is much cheaper. That&rsquo;s why I keep alternating between Claude Code and Codex: not because I want &ldquo;multi-agent architecture,&rdquo; but because the plans have limits and I work many hours in a row.</p>
<p>Are DeepSeek v4 and Kimi 2.6 cheaper? Yes. Are they usable? Yes. I like them for several cases. But for <strong>Agile Vibe Coding</strong> the way I&rsquo;ve been advocating since <a href="/en/2026/02/20/zero-to-post-production-in-1-week-using-ai-on-real-projects-behind-the-m-akita-chronicles/">&ldquo;From Zero to Post-Production in 1 Week&rdquo;</a>, they are still lacking. They stumble more on continuity, long refactors, tests, understanding the whole project. Can you use them? Sure. But if the goal is consistent productivity, Opus and GPT are still the bar.</p>
<p>Running an open-source model locally is neat. I played with that a lot in the <a href="/en/2026/03/31/minisforum-ms-s1-max-amd-ai-max-395-review/">Minisforum MS-S1 Max with AMD AI Max+ 395 review</a>. For one-shots, studying, playing with local inference, it&rsquo;s fun. For Agile Vibe Coding all day, every day, it is still not practical. Latency, context, quality, setup maintenance, VRAM, all of it collects tax.</p>
<p>Running multiple LLMs in parallel is not practical either, the whole &ldquo;planner + executor + reviewer + judge&rdquo; routine. I tested that in <a href="/en/2026/04/25/llm-benchmarks-vale-a-pena-misturar-2-modelos/">&ldquo;LLM Benchmarks: Is It Worth Mixing 2 Models?&rdquo;</a>. The idea looks nice on paper. In practice, it increases cost, latency, error surface, and the gain does not pay for the complexity.</p>
<p>The secret is not having a bunch of agents. Forget OpenClaw or Pi for day-to-day programming. The secret is engineering process. XP. Tests. <a href="/en/2026/04/20/clean-code-for-ai-agents/">Clean Code for AI Agents</a>. CI. Pair programming. Constant refactoring. Small code. Automated deploy. Fast feedback.</p>
<p>Tools help. Engineering wins.</p>
<h2>ai-jail: autonomy with a fence<span class="hx:absolute hx:-mt-20" id="ai-jail-autonomy-with-a-fence"></span>
    <a href="#ai-jail-autonomy-with-a-fence" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>The first project I want to highlight is <a href="https://github.com/akitaonrails/ai-jail"target="_blank" rel="noopener">ai-jail</a>. It is a sandbox wrapper to run AI agents with restricted system access. On Linux it uses <code>bubblewrap</code> (<code>bwrap</code>) and Landlock. On macOS it uses <code>sandbox-exec</code>. The idea is simple: the agent sees the environment it needs to work, but does not go rummaging through your whole system.</p>
<p>Do I use it every day? Yes. Do I use it always? No.</p>
<p>When I know I am not doing anything risky, I open <code>claude</code> or <code>codex</code> directly. If I am touching a simple project, just running tests, editing markdown, refactoring local stuff, often I do not bother. In more than 600 hours of intense Agile Vibe Coding, more than half a million lines of code and documentation, I never had one of those folklore cases of an LLM destroying my host system in some unrecoverable way.</p>
<p>And look, I explicitly used agents to configure my Omarchy. ZSH, Hyprland, Waybar, terminal configs, login scripts, all of it. They never did anything I did not ask for.</p>
<p>Those stories of &ldquo;the agent deleted my whole home by itself&rdquo; make me raise an eyebrow. In my experience, when you ask it to delete something dangerous, Claude and Codex ask for confirmation. You have to say yes. If you said yes without reading, that is not LLM black magic. That is user in zombie mode.</p>
<p>Nothing is guaranteed, of course. Hence ai-jail.</p>
<p>My favorite use is combining <code>ai-jail</code> with the harness&rsquo; no-brakes mode:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">

<div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ai-jail claude --dangerously-allow-permissions
</span></span><span class="line"><span class="cl">ai-jail codex --dangerously-bypass-approvals-and-sandbox</span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
  <button
    class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
    title="Copy code"
  >
    <div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
  </button>
</div>
</div>
<p>It sounds contradictory, but it makes sense. I remove the confirmation friction inside the agent, but put a fence at the operating-system level. The agent can work fast inside the project, but the host filesystem is essentially read-only. The current directory is read-write. Whatever I explicitly map with <code>--rw-map</code> is also read-write. The rest is not to be touched.</p>
<p>The ai-jail README sums it up well: it is a sandbox wrapper for agents like Claude Code, GPT Codex, OpenCode, and Crush. On the first run it creates a <code>.ai-jail</code> in the project, which can be committed. It supports <code>--dry-run</code> to see mounts before executing, <code>--lockdown</code> for a stricter mode, <code>--private-home</code> to hide real dotfiles, <code>--mask .env</code> to hide sensitive files inside the project itself, and isolated browser profiles for Chromium/Firefox.</p>
<p>Do not sell this as absolute security. Process sandboxing is not a VM. Kernel bugs exist. Side channels exist. macOS has limitations. The README itself is clear: if you need to isolate a truly hostile workload, use a disposable VM. I do not use ai-jail as &ldquo;military-grade armor.&rdquo; I use it as another layer, good enough for a development workflow.</p>
<p>And even inside the project, everything is Git. I push frequently to GitHub or to my private Gitea. So the realistic worst case is the agent destroying the project directory. Annoying? Yes. Catastrophic? No. I clone again. I come back from the remote. I redo what was local. If <code>.git</code> gets corrupted, I delete everything and clone again.</p>
<p>Secrets also have a copy outside. <code>.env</code>, tokens, keys, everything that matters sits in Bitwarden. <a href="/en/2025/09/10/omarchy-2-0-bitwarden-self-hosted-vaultwarden/">Self-hosted in Vaultwarden</a>, of course. So if I lose the local directory, I did not lose the keys to the kingdom.</p>
<p>The most common risk is not the agent deleting everything. It is you leaking a secret to Git. That happened to me more than once. You run <code>git add .</code>, forget a <code>.env</code>, push to the remote, congratulations. It happens. That&rsquo;s why you must look at <code>git status</code>, <code>git diff --cached</code>, and think before pushing.</p>
<p>Even when it happens, LLMs are very competent at helping rewrite history. I ask them to clean the secret from Git, force-push, review that it disappeared, and then I rotate the key. It is not pretty, but it is manageable.</p>
<p>So yes, I recommend using Claude/Codex with dangerous permissions <strong>inside</strong> ai-jail. Is there a 0.001% chance of an unrecoverable accident? There is. But if you are a good engineer, that should not kill you. I have layers: automatic Btrfs snapshots, restic to my NAS, NAS archiving offsite to AWS Glacier, remote Git, Bitwarden. No tool replaces backups.</p>
<h2>ai-memory: context that survives the harness<span class="hx:absolute hx:-mt-20" id="ai-memory-context-that-survives-the-harness"></span>
    <a href="#ai-memory-context-that-survives-the-harness" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>The second is <a href="https://github.com/akitaonrails/ai-memory"target="_blank" rel="noopener">ai-memory</a>, which I explained in detail in <a href="/en/2026/05/23/i-built-memory-system-for-coding-agents-ai-memory/">&ldquo;I Built a Memory System for Coding Agents: ai-memory&rdquo;</a>.</p>
<p><img src="https://new-uploads-akitaonrails.s3.us-east-2.amazonaws.com/2026/05/23/ai-memory/ai-memory-logo.png" alt="ai-memory project logo: circular pictogram with a stylized chip opening “wings” like libraries/pages on each side, next to the italic ai-memory text."  loading="lazy" /></p>
<p>The motivation is simple: harnesses lose context. Claude Code compacts. Codex compacts. opencode compacts. The session ends. You open another agent and it does not know what happened in the last 4 hours. If you only use one harness, maybe it does not bother you much. If you alternate between Claude and Codex like I do, it gets annoying fast.</p>
<p>I wanted a long-term memory consolidator that worked across different harnesses. Something that allowed handoff between Claude, Codex, and opencode without me manually writing <code>HANDOFF.md</code> every time. Something that captured prompts, tool calls, and session events through hooks, consolidated them into markdown pages, indexed with SQLite/FTS5, and exposed everything through MCP when the agent needed to query it.</p>
<p>Another motivator was what I explained in <a href="/en/2026/04/06/rag-is-dead-long-context/">&ldquo;Is RAG Dead? Long Context, Grep, and the End of the Mandatory Vector DB&rdquo;</a>. For code projects, simple text almost always solves more than fancy vector DB architecture. Markdown, <code>grep</code>, SQLite FTS5, long context, and good files in <code>docs/</code> already take you far. ai-memory follows that line: compile memory into text, leave it on disk, index it simply, and only call an LLM when consolidation is worth it.</p>
<p>ai-memory was not made to be a user-browsable knowledge base. It has a read-only web UI, yes, but that is for auditing and inspection. The memory is optimized for LLM consumption. It is an internal wiki the harness can query when it thinks it needs to. It is a place where I can explicitly ask &ldquo;save this for the next session&rdquo; and expect it to survive longer than Claude or Codex&rsquo;s default compaction.</p>
<p><img src="https://raw.githubusercontent.com/akitaonrails/ai-memory/main/docs/web-projects-home.png" alt="ai-memory web UI homepage showing detected projects, page counts, last activity, and the warning that memory is optimized for LLM consumption, not human-curated documentation."  loading="lazy" /></p>
<p>The README sums it up well: coding agents lose all context when the session ends; ai-memory gives them a shared persistent wiki. Every prompt, tool call, and decision can be captured automatically. At the end of the session, relevant pages are rewritten as coherent narrative. In the next session, another agent can receive a handoff already prepended into the context.</p>
<p>This is useful when you close Claude at 6pm, open Codex the next day in the same directory, and want it to know you were testing session cookies because JWT rotation had run into trouble. Or when you return to a project six weeks later and do not remember why you discarded Redis.</p>
<p>But do not confuse it with canonical documentation. If you did important research you do not want to lose, ask the agent to write markdown in <code>docs/</code> inside the project. Architecture decision, benchmark, library analysis, deploy runbook, anything that must survive with guarantees should become an explicit file in the repo. That is simpler, auditable, and versioned.</p>
<p>ai-memory covers the middle band: transient information that might matter later. A weird bug that appeared. The reasoning that led to a decision. An environment gotcha. A session summary. Things you do not want to turn into official docs yet, but also do not want to throw away.</p>
<p>It is still beta. I use it in personal production, but it needs many more users beating on it. The most polished integrations today are Claude Code, Codex, and opencode. Gemini CLI, OpenClaw, and exotic MCP clients still need more testing. PRs are welcome. Bug reports too. &ldquo;I installed it and it broke on my setup&rdquo; is exactly the kind of feedback that reveals a wrong assumption.</p>
<h2>ai-usagebar: knowing when to switch horses<span class="hx:absolute hx:-mt-20" id="ai-usagebar-knowing-when-to-switch-horses"></span>
    <a href="#ai-usagebar-knowing-when-to-switch-horses" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>As I said above, I prefer using Anthropic and OpenAI&rsquo;s subsidized plans. The problem is that if you do real Agile Vibe Coding, you hit limits. Daily limit. Weekly limit. Session limit. Limit that changes. Limit that does not show up clearly anywhere.</p>
<p>I was using <a href="https://github.com/mryll/claudebar"target="_blank" rel="noopener">claudebar</a>, which is good, but only covers Claude. I wanted to see the main vendors in one place. That became <a href="https://github.com/akitaonrails/ai-usagebar"target="_blank" rel="noopener">ai-usagebar</a>, which I introduced in <a href="/en/2026/05/24/i-built-a-waybar-widget-for-omarchy-to-monitor-llm-usage-ai-usagebar/">&ldquo;I Built a Waybar Widget for Omarchy to Monitor LLM Plan Usage: ai-usagebar&rdquo;</a>.</p>
<p><img src="https://new-uploads-akitaonrails.s3.us-east-2.amazonaws.com/2026/05/24/ai-usagebar/ai-usagebar-waybar.png" alt="Waybar widget showing “cld 29% · 1h 12m” in the top-right corner, with the tooltip open showing the Claude Max 20x plan: Session 29%, Weekly 47%, Sonnet only 0%, Extra usage $0.00 against a $1100 limit, and the last-updated time."  loading="lazy" /></p>
<p>It is a Waybar widget and Rust TUI to monitor Anthropic Claude, OpenAI Codex/ChatGPT, Z.AI GLM, and OpenRouter usage. For Claude and OpenAI, it reads the OAuth credentials the official CLIs already wrote. For Z.AI and OpenRouter, it uses API keys. It shows session percentage, reset, limits, balance, and lets you switch the primary vendor.</p>
<p>The value is banal and therefore useful: I glance at the bar and know whether I should continue in Claude, hand off to Codex, or top up OpenRouter credit. I do not want to discover I hit the weekly limit in the middle of a large refactor.</p>
<p>There is also a standalone TUI:</p>
<p><img src="https://new-uploads-akitaonrails.s3.us-east-2.amazonaws.com/2026/05/24/ai-usagebar/ai-usagebar-tui-openai.png" alt="ai-usagebar-tui on the OpenAI tab running in a terminal: Codex 5h and weekly gauges, Credits block with message-count ranges, Claude / OpenAI / GLM (Z.AI) / OpenRouter tabs at the top, key hints in the footer."  loading="lazy" /></p>
<p>If you do not use Omarchy, Hyprland, or Waybar, you can still run <code>ai-usagebar-tui</code> in any terminal. SSH, tmux, normal terminal, whatever. The bar is convenience. The TUI is the universal form.</p>
<h2>ghpending: GitHub pending stuff without the ritual<span class="hx:absolute hx:-mt-20" id="ghpending-github-pending-stuff-without-the-ritual"></span>
    <a href="#ghpending-github-pending-stuff-without-the-ritual" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>After the marathon, I ended up with dozens of <code>ai-*</code> and <code>frank-*</code> repos on GitHub. That creates an annoying problem: issues and pull requests start appearing. A contributor opens a PR. Someone reports a bug. Someone else sends a suggestion. If I have to open the browser, enter repo by repo, filter tab by tab, I will postpone it. And if I postpone it, I go weeks without answering contributors.</p>
<p>Yes, I could use <code>gh</code>, the official GitHub CLI. I do use it. But I wanted something dumber and faster: a short command to print a digest of everything pending in the repos I chose to monitor. That became <a href="https://github.com/akitaonrails/ghpending"target="_blank" rel="noopener">ghpending</a>, which I described in <a href="/en/2026/05/23/i-built-a-cli-to-check-my-github-pending-stuff-ghpending/">&ldquo;I Built a CLI to Check My GitHub Pending Stuff: ghpending&rdquo;</a>.</p>
<p><img src="https://new-uploads-akitaonrails.s3.us-east-2.amazonaws.com/2026/05/23/ghpending/ghpending-screenshot.png" alt="ghpending terminal output: compact table listing each monitored repo with open issue and pull request counts, latest activity author, and how long ago it happened."  loading="lazy" /></p>
<p>That is it: <code>ghpending add</code> to choose repos, <code>ghpending</code> to see the digest, <code>ghpending list</code>, <code>ghpending rm</code>. Without auth it works with GitHub&rsquo;s 60 req/h anonymous limit. With <code>GITHUB_TOKEN=$(gh auth token) ghpending</code>, it goes up to 5,000 req/h.</p>
<p>The point is not replacing GitHub. It is reducing friction. If I can run one command in the terminal and see &ldquo;there are 3 PRs and 2 issues to look at,&rdquo; I look. If it depends on browser ritual, notifications, and tabs, it waits.</p>
<p>And Claude/Codex are very good at this kind of work. You can ask:</p>
<blockquote>
  <p>&ldquo;Check the open pull requests, review the code, see if it compiles, run the tests, add tests if missing, rebase from master if needed, merge and close.&rdquo;</p>

</blockquote>
<p>Or:</p>
<blockquote>
  <p>&ldquo;Check the open issues, evaluate whether there is a real bug, reproduce it if possible, propose a fix, answer the user.&rdquo;</p>

</blockquote>
<p>They read the PR, understand the diff, run tests, rebase, solve simple conflicts, write the contributor response. You still keep your brain on. You are delegating mechanical work you already know how to do.</p>
<h2>Refactoring: ask explicitly, several times<span class="hx:absolute hx:-mt-20" id="refactoring-ask-explicitly-several-times"></span>
    <a href="#refactoring-ask-explicitly-several-times" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>Claude and Codex are very good at refactoring, but do not assume they will do it automatically the way you would. I usually start projects or features with explicit instructions:</p>
<blockquote>
  <p>&ldquo;Use Rust best practices. Avoid unnecessary duplication. Modularize only where it makes sense. Add unit tests for every new feature. Follow <a href="/en/2026/04/20/clean-code-for-ai-agents/">Clean Code</a> principles. Do not create an abstraction before it is needed.&rdquo;</p>

</blockquote>
<p>After a large feature, a large fix, or a few hours of development, I stop and ask:</p>
<blockquote>
  <p>&ldquo;Now that we touched a lot of code, re-evaluate it carefully. Delete dead code. Refactor obvious duplication. Add missing tests. Remove magic numbers. Check if any modules are too large. Do not change behavior without tests.&rdquo;</p>

</blockquote>
<p>Before release:</p>
<blockquote>
  <p>&ldquo;Before publishing this version, do a sanity audit. Look for secret leaks, dangerous permissions, destructive commands, path traversal, unnecessary unwraps, missing validation, and anything that looks like an obvious vulnerability.&rdquo;</p>

</blockquote>
<p>Does that guarantee security? Of course not. Not even close. But it removes a lot of dumb mistakes. It is another layer. I like running this audit with Claude and then with Codex, because each one finds different things. Bugs still pass. Security is process, not a magic ritual.</p>
<h2>Disposable experiments: code got cheap<span class="hx:absolute hx:-mt-20" id="disposable-experiments-code-got-cheap"></span>
    <a href="#disposable-experiments-code-got-cheap" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>Before choosing a library, framework, architecture, model, or service, I like creating <code>experiments/</code>.</p>
<p>Example:</p>
<blockquote>
  <p>&ldquo;Before choosing between Qwen and DeepSeek, create a disposable prototype in <code>experiments/</code> for an A/B test. Document the analysis in <code>docs/</code> with result, cost, latency, quality, and recommendation.&rdquo;</p>

</blockquote>
<p>This changed how I decide. Before, many engineering decisions became opinion, feeling, faith in somebody else&rsquo;s benchmark. Now code is cheap. I ask the agent to make two or three versions, run tests, measure, document, throw away what does not work.</p>
<p>Prototyping got genuinely fast. <a href="/en/2026/04/05/turning-youtube-into-a-karaoke-app-frank-karaoke/">Frank Karaoke</a> is a good example: turning YouTube into a karaoke app was the kind of idea I would maybe leave in a mental list for months, waiting for &ldquo;a free weekend&rdquo; that never arrives. Now I can open <code>experiments/</code>, ask for a rough prototype, test the technical path, and decide whether it deserves to become a project. Look at my other 2026 posts about <code>frank-*</code> and <code>ai-*</code> projects: almost all of them started like this, as disposable code that proved something before earning a name.</p>
<p>But cheap prototypes do not mean one-shot. I already wrote in <a href="/en/2026/04/15/how-to-talk-to-claude-code-effectively/">&ldquo;Why LLMs Aren&rsquo;t Giving You the Result You Expect&rdquo;</a>: a good prompt is an iterative conversation. You provide context, show references, point out constraints, read the result, correct direction, ask for a rewrite. If you throw in a vague sentence and expect a finished product, that&rsquo;s on you.</p>
<p>I learned this by taking a beating too. In the <a href="/en/2026/03/05/my-first-vibe-code-failure-frank-yomik/">Frank Yomik</a> post I described my first real vibe-coding failure: when the direction is wrong, insisting on the same prompt just digs the hole deeper. Sometimes you need to reduce scope, isolate the problem, create a test, change strategy. LLM does not turn a bad plan into good engineering.</p>
<p>And there are domains where you need to study along with it. In the <a href="/en/2026/04/23/driveclub-shadps4-e-ia-como-aprender/">DriveClub and shadPS4</a> post, AI almost sent me in every wrong direction because the problem required understanding rendering, gamma, shaders, buffers. The tool helps you explore, but you still decide whether the explanation makes sense. If you do not understand enough to verify, you are just accepting a pretty guess.</p>
<p>That is also why I keep repeating the idea from <a href="/en/2026/03/01/software-is-never-done-4-projects-life-after-deploy-one-shot-prompt-myth/">&ldquo;Software Is Never Done&rdquo;</a>: deploy is not the finish line. The prototype becomes a product when it handles bug reports, maintenance, refactoring, docs, releases, rollbacks, users complaining. LLM helps a lot with that boring cycle. But the cycle still exists.</p>
<p>If it is testable, test it. If it can be measured, measure it. If it cannot be measured, at least write down the assumptions. The important thing is not choosing just because it &ldquo;seems better.&rdquo;</p>
<p>Cheap code also means detachment. Make code to throw away. Make an ugly prototype. Make a disposable benchmark. Ask the agent to document what it learned in <code>docs/decision-qwen-vs-deepseek.md</code>, then delete <code>experiments/</code> if you want. The document stays. The lesson stays.</p>
<p>LLMs are also very good at documentation. Use that. Ask it to document everything. Why we chose PostgreSQL instead of SQLite in this case. Why the deploy uses a multi-stage Docker image. Why the service runs behind Cloudflare Tunnel. Why that sysctl exists. Even if you delete half of it later, the cost of writing fell near zero.</p>
<h2>Automated deploy or you will stop maintaining it<span class="hx:absolute hx:-mt-20" id="automated-deploy-or-you-will-stop-maintaining-it"></span>
    <a href="#automated-deploy-or-you-will-stop-maintaining-it" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>Every project of mine that matters has automated build. Many run in my homelab, as I described in <a href="/en/2026/03/31/migrating-my-home-server-with-claude-code/">&ldquo;Migrating my Home Server with Claude Code&rdquo;</a>. Almost every project has a <code>bin/deploy</code> that builds a Docker image, pushes it, rotates it on the server, applies migration if needed, and validates healthcheck.</p>
<p>Claude and Codex are excellent at deploy. They read <code>bin/deploy</code>, understand Dockerfile, edit GitHub Actions, adjust release workflows, fix binary signing, update Homebrew taps, generate checksums. And yes, I ask Claude/Codex to SSH into my homelab and redeploy Docker containers. They are very good at that. ai-jail, for example, has GitHub Actions to build signed binaries for Linux and macOS.</p>
<p>If you have dozens of projects, the more automated the better. I rarely type admin commands in the terminal by myself. I ask the LLM to do it, observe, approve what is dangerous, and then ask:</p>
<blockquote>
  <p>&ldquo;Document what was done and why it was done.&rdquo;</p>

</blockquote>
<p>This applies to the homelab and my workstation. My Omarchy is customized through Claude: ZSH, Hyprland, Waybar, scripts, shortcuts, themes, integrations. Even my gaming/emulation setups fall into this, as I showed in the <a href="/en/2026/04/19/my-favorite-retro-racing-games-on-distrobox/">retro racing games running on Distrobox</a> post. This is a case where I normally do not use ai-jail, because I actually want to touch the host. So I look at commands, read diffs, approve slowly. Even then, I never had the agent break my system in an unrecoverable way. Quite the opposite. My PC has never been more stable and documented.</p>
<p>Days later, when I forget why I configured something that way, the context is in markdown, Git, ai-memory, or the project history itself. I can ask and the agent has something to pull from.</p>
<h2>Even this post was written this way<span class="hx:absolute hx:-mt-20" id="even-this-post-was-written-this-way"></span>
    <a href="#even-this-post-was-written-this-way" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>This is how I write these posts now. I dump a huge messy block from my brain into Claude. I ask it to read recent posts to calibrate style. I ask it to check the projects directly and elaborate the technical parts. I ask it to use the latest screenshots, upload to S3 when needed, link previous posts, review the tone.</p>
<p><img src="https://new-uploads-akitaonrails.s3.us-east-2.amazonaws.com/2026/05/24/ai-toolkit/writing-this-post.png" alt="Terminal screenshot with the raw prompt used to write this post: a huge block of instructions, links, opinions, and technical details dumped into the agent before final editing."  loading="lazy" /></p>
<p>Then I read and edit. I cut what sounds generic. I replace sentences that sound like release notes. I put my rants back in. The result is still my text; I just spend energy on what matters: deciding what to say, correcting nuance, cutting nonsense.</p>
<h2>&ldquo;But did you test Pi?&rdquo;<span class="hx:absolute hx:-mt-20" id="but-did-you-test-pi"></span>
    <a href="#but-did-you-test-pi" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>Every time I mention an LLM or LLM tool, someone shows up in the comments with the same question: &ldquo;but did you test Pi?&rdquo;, &ldquo;but did you test DeepSeek?&rdquo;, &ldquo;but what about Qwen?&rdquo;, &ldquo;but what about the new model that came out yesterday?&rdquo; Every. Single. Time.</p>
<p>It is annoying as fuck. And almost always it comes from three kinds of people: someone who tested nothing and wants to outsource the work, someone who already chose a tool and wants me to validate their choice, or a fanboy treating an LLM vendor like a soccer team. They all sound the same. NPC repeating tutorial dialogue.</p>
<p>Software engineers should not decide based on other people&rsquo;s opinions. Not even mine. If you choose a tool because &ldquo;Akita said so,&rdquo; you understood it wrong. I advocate Claude Code and Codex because I used them for hundreds of hours, in real projects, publishing code and post-mortems of what worked and what failed. And even then I did not stop at opinion.</p>
<p>I built my own automated benchmark: <a href="https://github.com/akitaonrails/llm-coding-benchmark"target="_blank" rel="noopener">llm-coding-benchmark</a>. I update it when a popular vendor releases a new version. I run comparable scenarios. I publish results. Then I adjust my opinion based on the data. That gives me enough ground to say that, in my workflow, Opus and GPT keep winning. Not because I woke up wanting to defend some billionaire company&rsquo;s logo.</p>
<p>If your first reaction was &ldquo;but did you test Qwen?&rdquo;, great. Test it yourself. Run the benchmark. Create a better scenario. Send a PR. Show numbers. Show cost. Show latency. Show where it failed. Show where it won. Bring new data.</p>
<p>Loose opinion is irrelevant. &ldquo;It works for me&rdquo; does not scale. &ldquo;I like it better&rdquo; does not matter. &ldquo;In my one-shot prompt it was better&rdquo; is an anecdote. Engineering starts when something can be reproduced, compared, and acted on.</p>
<p>So it is simple: bring actionable data or shut the hell up. I do not need vendor fan clubs in the comments. I need people testing, measuring, and contributing new results.</p>
<h2>Final checklist<span class="hx:absolute hx:-mt-20" id="final-checklist"></span>
    <a href="#final-checklist" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>Short summary, because this post is already long:</p>
<ul>
<li>Focus on Claude Code, Codex, or opencode. Stop collecting agents.</li>
<li>Use Opus 4.7 and GPT 5.5 through Pro/Plus/Max plans when daily productivity matters.</li>
<li>DeepSeek, Kimi, and local models are useful, but still do not replace the main workflow.</li>
<li>Agile Vibe Coding is XP with LLM: tests, <a href="/en/2026/04/20/clean-code-for-ai-agents/">Clean Code</a>, CI, pair programming, and deploy.</li>
<li>Use <code>ai-jail</code> when you want agent autonomy with a filesystem fence.</li>
<li>Combine <code>ai-jail</code> with dangerous Claude/Codex permissions when the project is protected by Git.</li>
<li>Have real backup: Btrfs snapshots, restic, NAS, offsite, Git, Bitwarden.</li>
<li>Review <code>git add</code>, <code>git diff --cached</code>, and pushes so you do not leak secrets.</li>
<li>Use <code>ai-memory</code> for transient context and handoff between agents.</li>
<li>Write canonical documentation in <code>docs/</code> when information needs to survive with guarantees.</li>
<li>Use <code>ai-usagebar</code> to know when to switch from Claude to Codex, or when to top up OpenRouter.</li>
<li>Use <code>ghpending</code> so you do not abandon issues and PRs.</li>
<li>Ask for refactoring explicitly after large features.</li>
<li>Run a security audit before release, preferably with more than one model.</li>
<li>Create disposable prototypes in <code>experiments/</code> before deciding by faith.</li>
<li>If you disagree with a benchmark, run <a href="https://github.com/akitaonrails/llm-coding-benchmark"target="_blank" rel="noopener">llm-coding-benchmark</a> and bring new data.</li>
<li>Document decisions in markdown. Code got cheap. Documentation too.</li>
<li>Automate deploy. If it depends on a manual ritual, you will stop doing it.</li>
</ul>
<p>In the end, it is the same advice as always: tools change, engineering does not. LLM increases leverage. If you already had good habits, you will produce more. If you did not, you will just produce mess faster.</p>
<p>And yes, this changes the interface of the work. I already wrote about that in <a href="/en/2026/04/11/vs-code-is-the-new-punch-card/">&ldquo;VS Code Is the New Punch Card&rdquo;</a>: polishing pixels in an editor is now old-programmer nostalgia. The hard part is writing intent correctly, reviewing execution without being lazy, measuring results, throwing away cheap code, and not confusing opinion with data.</p>
]]></content:encoded><category>ai-jail</category><category>ai-memory</category><category>ai-usagebar</category><category>ghpending</category></item><item><title>I Built a Waybar Widget for Omarchy to Monitor LLM Plan Usage: ai-usagebar</title><link>https://akitaonrails.github.io/en/2026/05/24/i-built-a-waybar-widget-for-omarchy-to-monitor-llm-usage-ai-usagebar/</link><guid isPermaLink="true">https://akitaonrails.github.io/en/2026/05/24/i-built-a-waybar-widget-for-omarchy-to-monitor-llm-usage-ai-usagebar/</guid><pubDate>Sun, 24 May 2026 00:01:00 -0300</pubDate><description>&lt;p&gt;Anyone following the blog already knows I use a whole bunch of different LLM vendors. The main ones are Claude and GPT, via Claude Code and Codex. I use each one&amp;rsquo;s harness because I&amp;rsquo;m locked into their subscription plans (Pro, Plus, Max), which come out way cheaper than paying per-token credits like OpenRouter. Even so, I also use OpenRouter to reach other models for testing, and I even have a Z.AI GLM subscription for small stuff.&lt;/p&gt;</description><content:encoded><![CDATA[<p>Anyone following the blog already knows I use a whole bunch of different LLM vendors. The main ones are Claude and GPT, via Claude Code and Codex. I use each one&rsquo;s harness because I&rsquo;m locked into their subscription plans (Pro, Plus, Max), which come out way cheaper than paying per-token credits like OpenRouter. Even so, I also use OpenRouter to reach other models for testing, and I even have a Z.AI GLM subscription for small stuff.</p>
<p>The problem with juggling several plans is keeping track of how much I&rsquo;ve burned on each. I&rsquo;d been using <a href="https://github.com/mryll/claudebar"target="_blank" rel="noopener">claudebar</a>, a Waybar widget that shows your Anthropic plan usage. I like it, but I wanted to see all my vendors in one place, glance at it and know where I stand. And I didn&rsquo;t want to clutter my Waybar with a separate widget per vendor. So I built my own: <strong><a href="https://github.com/akitaonrails/ai-usagebar"target="_blank" rel="noopener">ai-usagebar</a></strong>.</p>
<p><img src="https://new-uploads-akitaonrails.s3.us-east-2.amazonaws.com/2026/05/24/ai-usagebar/ai-usagebar-waybar.png" alt="Waybar widget showing “cld 29% · 1h 12m” in the top-right corner, with the tooltip open showing the Claude Max 20x plan: Session 29%, Weekly 47%, Sonnet only 0%, Extra usage $0.00 against a $1100 limit, and the last-updated time."  loading="lazy" /></p>
<p>It&rsquo;s a Rust port of claudebar, drop-in compatible, extended to four vendors: Anthropic Claude, OpenAI Codex/ChatGPT, Z.AI (GLM), and OpenRouter. It keeps the same flags (<code>--icon</code>, <code>--format</code>, <code>--tooltip-format</code>, etc.), the same minimalist Pango-bordered tooltip, and the same Omarchy theme auto-detection. The difference is that now all four vendors show up in the same place, instead of 865 lines of bash babysitting just one.</p>
<h2>How it authenticates with each vendor<span class="hx:absolute hx:-mt-20" id="how-it-authenticates-with-each-vendor"></span>
    <a href="#how-it-authenticates-with-each-vendor" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>This is the part worth explaining, because each vendor does it differently. Claude and Codex use OAuth: their official CLIs (<code>claude</code> and <code>codex</code>) already wrote the credentials to disk when you logged in, and ai-usagebar reads those same files. No environment variable needed, the token even refreshes itself.</p>
<p>Z.AI and OpenRouter use API keys, so for those you need to set a key (via env var or inline in the config).</p>
<table>
  <thead>
      <tr>
          <th>Vendor</th>
          <th>Method</th>
          <th>What you need to do</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Anthropic</td>
          <td>OAuth, reads from <code>~/.claude/.credentials.json</code></td>
          <td>Run <code>claude</code> once to log in. Token refreshes itself.</td>
      </tr>
      <tr>
          <td>OpenAI</td>
          <td>OAuth, reads from <code>~/.codex/auth.json</code></td>
          <td>Run <code>codex login</code> once. Token refreshes itself.</td>
      </tr>
      <tr>
          <td>Z.AI</td>
          <td>API key (<code>ZAI_API_KEY</code> or <code>[zai] api_key</code> in config)</td>
          <td>Set either one.</td>
      </tr>
      <tr>
          <td>OpenRouter</td>
          <td>API key (<code>OPENROUTER_API_KEY</code> or <code>[openrouter] api_key</code>)</td>
          <td>Set either one.</td>
      </tr>
  </tbody>
</table>
<h2>The interface beyond Waybar<span class="hx:absolute hx:-mt-20" id="the-interface-beyond-waybar"></span>
    <a href="#the-interface-beyond-waybar" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>Besides the widget on the bar, there&rsquo;s a tabbed TUI (<code>ai-usagebar-tui</code>) to see everything at once. Navigate with Tab / h / l between vendors, auto-refresh every 60s. You can open it by clicking the Waybar widget, or run it straight from the terminal (more on that in the next section).</p>
<p>The OpenRouter tab shows credit balance, today/week/month spend, and the tier:</p>
<p><img src="https://new-uploads-akitaonrails.s3.us-east-2.amazonaws.com/2026/05/24/ai-usagebar/ai-usagebar-tui-openrouter.png" alt="ai-usagebar-tui on the OpenRouter tab: credit-balance gauge at 98% in red ($13.67 left of $900), usage-by-period block (today/week/month), paid tier."  loading="lazy" /></p>
<p>And there&rsquo;s a settings overlay to pick the primary vendor and paste the API keys without editing the config by hand:</p>
<p><img src="https://new-uploads-akitaonrails.s3.us-east-2.amazonaws.com/2026/05/24/ai-usagebar/ai-usagebar-tui-settings.png" alt="Settings overlay floating over the TUI: primary-vendor radio (Anthropic selected), masked Z.AI API key (•••), masked OpenRouter API key (•••), Save button, key hints in the footer."  loading="lazy" /></p>
<h2>Not on Omarchy or Hyprland? Run it as a standalone TUI<span class="hx:absolute hx:-mt-20" id="not-on-omarchy-or-hyprland-run-it-as-a-standalone-tui"></span>
    <a href="#not-on-omarchy-or-hyprland-run-it-as-a-standalone-tui" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>The Waybar widget is optional. The two binaries are independent, so if you don&rsquo;t run Omarchy, or Hyprland, or Waybar (or you just prefer to check usage now and then instead of having it on the bar all the time), <code>ai-usagebar-tui</code> works as a fully standalone terminal app:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">

<div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">ai-usagebar-tui    <span class="c1"># opens in your current terminal</span></span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
  <button
    class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
    title="Copy code"
  >
    <div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
  </button>
</div>
</div>
<p>It runs in any terminal emulator (Kitty, Alacritty, Foot, Ghostty, etc.), works even over a plain SSH session, and doesn&rsquo;t depend on a compositor or any window-manager feature. All the controls and the settings overlay work the same. Same four vendors, same tabs:</p>
<p><img src="https://new-uploads-akitaonrails.s3.us-east-2.amazonaws.com/2026/05/24/ai-usagebar/ai-usagebar-tui-openai.png" alt="ai-usagebar-tui on the OpenAI tab running in a terminal: Codex 5h and weekly gauges, Credits block with message-count ranges, Claude / OpenAI / GLM (Z.AI) / OpenRouter tabs at the top, key hints in the footer."  loading="lazy" /></p>
<p>Typical use off Omarchy: a quick check before starting a long session (&ldquo;am I close to my Claude weekly limit?&rdquo;), a monitor in a tmux pane while you code, or a shell-only tool on a remote machine (install the binary and that&rsquo;s it, no Waybar or Hyprland dependency). The TUI is the canonical way to see all four vendors at once, whether or not you ever set up the widget.</p>
<h2>Install<span class="hx:absolute hx:-mt-20" id="install"></span>
    <a href="#install" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>On Arch there&rsquo;s an AUR package, two flavors:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">

<div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">yay -S ai-usagebar-bin    <span class="c1"># prebuilt binary from GitHub Releases (~5s)</span>
</span></span><span class="line"><span class="cl">yay -S ai-usagebar        <span class="c1"># compiles from source (~30-60s)</span></span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
  <button
    class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
    title="Copy code"
  >
    <div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
  </button>
</div>
</div>
<p>Or straight from source:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">

<div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">cargo build --release
</span></span><span class="line"><span class="cl">sudo make install                  <span class="c1"># → /usr/local/bin</span>
</span></span><span class="line"><span class="cl"><span class="c1"># or</span>
</span></span><span class="line"><span class="cl">make install <span class="nv">PREFIX</span><span class="o">=</span><span class="nv">$HOME</span>/.local   <span class="c1"># → ~/.local/bin</span></span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
  <button
    class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
    title="Copy code"
  >
    <div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
  </button>
</div>
</div>
<p>The recommended Waybar config is a single module you scroll to cycle through vendors, with click to open the TUI:</p>
<div class="hextra-code-block hx:relative hx:mt-6 hx:first:mt-0 hx:group/code">

<div><div class="highlight"><pre tabindex="0" class="chroma"><code class="language-jsonc" data-lang="jsonc"><span class="line"><span class="cl"><span class="s2">&#34;custom/aibar&#34;</span><span class="err">:</span> <span class="p">{</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;exec&#34;</span><span class="p">:</span> <span class="s2">&#34;ai-usagebar --format &#39;{vendor_short} {session_pct}% · {session_reset}&#39;&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;return-type&#34;</span><span class="p">:</span> <span class="s2">&#34;json&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;interval&#34;</span><span class="p">:</span> <span class="mi">300</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;signal&#34;</span><span class="p">:</span> <span class="mi">13</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;tooltip&#34;</span><span class="p">:</span> <span class="kc">true</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;on-click&#34;</span><span class="p">:</span> <span class="s2">&#34;ai-usagebar-tui&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;on-scroll-up&#34;</span><span class="p">:</span>   <span class="s2">&#34;ai-usagebar --cycle-next&#34;</span><span class="p">,</span>
</span></span><span class="line"><span class="cl">    <span class="nt">&#34;on-scroll-down&#34;</span><span class="p">:</span> <span class="s2">&#34;ai-usagebar --cycle-prev&#34;</span>
</span></span><span class="line"><span class="cl"><span class="p">}</span></span></span></code></pre></div></div><div class="hextra-code-copy-btn-container hx:opacity-0 hx:transition hx:group-hover/code:opacity-100 hx:flex hx:gap-1 hx:absolute hx:m-[11px] hx:right-0 hx:top-0">
  <button
    class="hextra-code-copy-btn hx:group/copybtn hx:cursor-pointer hx:transition-all hx:active:opacity-50 hx:bg-primary-700/5 hx:border hx:border-black/5 hx:text-gray-600 hx:hover:text-gray-900 hx:rounded-md hx:p-1.5 hx:dark:bg-primary-300/10 hx:dark:border-white/10 hx:dark:text-gray-400 hx:dark:hover:text-gray-50"
    title="Copy code"
  >
    <div class="hextra-copy-icon hx:group-[.copied]/copybtn:hidden hx:pointer-events-none hx:h-4 hx:w-4"></div>
<div class="hextra-success-icon hx:hidden hx:group-[.copied]/copybtn:block hx:pointer-events-none hx:h-4 hx:w-4"></div>
  </button>
</div>
</div>
<p>If you&rsquo;d rather see all four vendors at once, you can use one module per vendor. The <a href="https://github.com/akitaonrails/ai-usagebar"target="_blank" rel="noopener">README</a> has the full config detail, format placeholders, and the variations.</p>
<h2>Why I built it<span class="hx:absolute hx:-mt-20" id="why-i-built-it"></span>
    <a href="#why-i-built-it" class="subheading-anchor" aria-label="Permalink for this section"></a></h2><p>This looked like a Saturday-night little project, so I just did it. And it was: porting claudebar to Rust and adding the extra vendors I wanted was painless. I came out of one night with a widget that does exactly what I needed and is more reliable (tested, modular) than the original shell script.</p>
<p>If you use other vendors I didn&rsquo;t cover, or you hit a bug, send an issue or pull request: <a href="https://github.com/akitaonrails/ai-usagebar"target="_blank" rel="noopener">github.com/akitaonrails/ai-usagebar</a>. It&rsquo;s MIT.</p>
]]></content:encoded><category>ai-usagebar</category><category>omarchy</category><category>developer-tools</category><category>llms</category></item></channel></rss>