<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Wasim Akhtar</title>
    <description>The latest articles on DEV Community by Wasim Akhtar (@akhwasim).</description>
    <link>https://dev.to/akhwasim</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4017410%2Ff33f1bd3-66b6-4a61-a44e-e210d965445b.jpg</url>
      <title>DEV Community: Wasim Akhtar</title>
      <link>https://dev.to/akhwasim</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/akhwasim"/>
    <language>en</language>
    <item>
      <title>Your Terminal Has Amnesia. I Spent My Semester Trying to Fix That.</title>
      <dc:creator>Wasim Akhtar</dc:creator>
      <pubDate>Mon, 06 Jul 2026 09:53:08 +0000</pubDate>
      <link>https://dev.to/akhwasim/your-terminal-has-amnesia-i-spent-my-semester-trying-to-fix-that-3743</link>
      <guid>https://dev.to/akhwasim/your-terminal-has-amnesia-i-spent-my-semester-trying-to-fix-that-3743</guid>
      <description>&lt;h2&gt;
  
  
  Your Terminal Has Amnesia. I Fixed it.
&lt;/h2&gt;

&lt;p&gt;Every terminal I've ever used has the same problem.&lt;/p&gt;

&lt;p&gt;You close it.&lt;/p&gt;

&lt;p&gt;You open it again.&lt;/p&gt;

&lt;p&gt;It has no idea what happened yesterday.&lt;/p&gt;

&lt;p&gt;It doesn't remember the command that finally fixed that weird Cargo error after two hours of debugging. It doesn't remember that you always use &lt;code&gt;pnpm&lt;/code&gt; instead of &lt;code&gt;npm&lt;/code&gt;. It doesn't remember the project you spent all week working on.&lt;/p&gt;

&lt;p&gt;Every session starts from zero.&lt;/p&gt;

&lt;p&gt;After a while I realized something strange.&lt;/p&gt;

&lt;p&gt;My terminal forgot everything.&lt;/p&gt;

&lt;p&gt;I was the memory.&lt;/p&gt;

&lt;p&gt;So I started building Luna.&lt;/p&gt;




&lt;h2&gt;
  
  
  It didn't start as an AI project.
&lt;/h2&gt;

&lt;p&gt;It started as a frustration.&lt;/p&gt;

&lt;p&gt;I'm a Computer Science student, and like most developers, I spend a huge part of my day inside a terminal.&lt;/p&gt;

&lt;p&gt;Not because terminals are exciting.&lt;/p&gt;

&lt;p&gt;Because that's where software gets built.&lt;/p&gt;

&lt;p&gt;After a few months I noticed I wasn't struggling with commands.&lt;/p&gt;

&lt;p&gt;I was struggling with remembering everything around them.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Google the same error.

Copy the solution.

Paste it.

Forget it.

Repeat three weeks later.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or I'd switch to another project for a few days, come back, and think:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"How did I solve this last time?"&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The terminal had no answer.&lt;/p&gt;

&lt;p&gt;It never does.&lt;/p&gt;

&lt;p&gt;History only tells you &lt;strong&gt;what&lt;/strong&gt; you typed.&lt;/p&gt;

&lt;p&gt;It never tells you &lt;strong&gt;why&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  So I asked a simple question.
&lt;/h2&gt;

&lt;p&gt;What if the terminal remembered?&lt;/p&gt;

&lt;p&gt;Not just command history.&lt;/p&gt;

&lt;p&gt;Actually remembered.&lt;/p&gt;

&lt;p&gt;Projects.&lt;/p&gt;

&lt;p&gt;Errors.&lt;/p&gt;

&lt;p&gt;Directories.&lt;/p&gt;

&lt;p&gt;Commands that worked.&lt;/p&gt;

&lt;p&gt;Commands that failed.&lt;/p&gt;

&lt;p&gt;Patterns in how I work.&lt;/p&gt;

&lt;p&gt;That question eventually became Luna.&lt;/p&gt;




&lt;h2&gt;
  
  
  Before writing any AI code, I had to answer another question.
&lt;/h2&gt;

&lt;p&gt;What exactly &lt;strong&gt;is&lt;/strong&gt; Luna?&lt;/p&gt;

&lt;p&gt;A shell?&lt;/p&gt;

&lt;p&gt;A wrapper?&lt;/p&gt;

&lt;p&gt;A plugin?&lt;/p&gt;

&lt;p&gt;A chatbot?&lt;/p&gt;

&lt;p&gt;I realized pretty quickly I didn't want another tool sitting on top of Bash.&lt;/p&gt;

&lt;p&gt;I wanted something that actually felt like its own terminal.&lt;/p&gt;

&lt;p&gt;So Luna became its own shell.&lt;/p&gt;

&lt;p&gt;Not a plugin.&lt;/p&gt;

&lt;p&gt;Not an extension.&lt;/p&gt;

&lt;p&gt;A standalone binary written in Rust.&lt;/p&gt;




&lt;h2&gt;
  
  
  How Luna actually works
&lt;/h2&gt;

&lt;p&gt;At a very high level, Luna is surprisingly simple.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                        You
                         │
                         ▼
              Natural Language Input
                         │
                         ▼
                    AI Provider
      (Groq • Gemini • Claude • OpenAI • Ollama...)
                         │
                         ▼
                   Safety Engine
                         │
              LOW ───────┴──────── HIGH
               │                     │
               ▼                     ▼
            Execute            Ask Permission
               │
               ▼
          SQLite Memory
               │
               ▼
   Future Context &amp;amp; Suggestions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Every feature in Luna comes from those four building blocks.&lt;/p&gt;

&lt;p&gt;The AI generates commands.&lt;/p&gt;

&lt;p&gt;The safety engine decides whether those commands are safe enough to execute.&lt;/p&gt;

&lt;p&gt;The shell runs them.&lt;/p&gt;

&lt;p&gt;SQLite remembers everything that happened so future suggestions become more useful instead of starting from zero again.&lt;/p&gt;

&lt;p&gt;The language model is only one piece of the system.&lt;/p&gt;

&lt;p&gt;It never gets the final decision.&lt;/p&gt;




&lt;h2&gt;
  
  
  Building Luna happened in three phases.
&lt;/h2&gt;

&lt;p&gt;Looking back, they seem obvious.&lt;/p&gt;

&lt;p&gt;While building them, they definitely weren't.&lt;/p&gt;

&lt;h3&gt;
  
  
  Phase 1 - Build a real shell.
&lt;/h3&gt;

&lt;p&gt;Before AI could do anything useful, Luna had to behave like an actual terminal.&lt;/p&gt;

&lt;p&gt;That meant implementing built-in commands, history, directory navigation, command execution, a REPL loop, and all the boring things people expect without ever thinking about them.&lt;/p&gt;

&lt;p&gt;Ironically, none of this involved AI.&lt;/p&gt;

&lt;p&gt;It was just engineering.&lt;/p&gt;




&lt;h3&gt;
  
  
  Phase 2 - Natural language.
&lt;/h3&gt;

&lt;p&gt;Only after the shell worked did I integrate AI.&lt;/p&gt;

&lt;p&gt;The first demo felt magical.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;find files larger than 10MB
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;became&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;find &lt;span class="nb"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;-type&lt;/span&gt; f &lt;span class="nt"&gt;-size&lt;/span&gt; +10M
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;without me writing the command.&lt;/p&gt;

&lt;p&gt;For about five minutes I thought I was done.&lt;/p&gt;

&lt;p&gt;Then I asked myself a much more uncomfortable question.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Should I actually trust this?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That single question completely changed the direction of the project.&lt;/p&gt;

&lt;p&gt;Generating shell commands turned out to be the easy part.&lt;/p&gt;

&lt;p&gt;Trusting them wasn't.&lt;/p&gt;




&lt;h3&gt;
  
  
  Phase 3 - Security
&lt;/h3&gt;

&lt;p&gt;Security is my favorite part of the project.&lt;/p&gt;

&lt;p&gt;Every time a command enter &lt;strong&gt;Luna&lt;/strong&gt; shell it goes through security check and determine either command is safe to run or not. &lt;/p&gt;

&lt;p&gt;No matter where that command came from, either from &lt;strong&gt;User&lt;/strong&gt;, &lt;strong&gt;AI Generated&lt;/strong&gt; or from saved &lt;strong&gt;workflows&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Workflow command are checked both at creation and while running.&lt;/p&gt;




&lt;h3&gt;
  
  
  Phase 4 - Give it memory.
&lt;/h3&gt;

&lt;p&gt;Instead of treating every terminal session as a brand-new conversation, Luna stores context locally.&lt;/p&gt;

&lt;p&gt;Directories.&lt;/p&gt;

&lt;p&gt;Projects.&lt;/p&gt;

&lt;p&gt;Commands.&lt;/p&gt;

&lt;p&gt;Previous errors.&lt;/p&gt;

&lt;p&gt;Successful fixes.&lt;/p&gt;

&lt;p&gt;Frequently used workflows.&lt;/p&gt;

&lt;p&gt;After using it for a while, something changed.&lt;/p&gt;

&lt;p&gt;Instead of wondering&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"What was that command again?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Luna usually already knew.&lt;/p&gt;

&lt;p&gt;That was the first moment it actually felt different from every shell I'd used before.&lt;/p&gt;

&lt;p&gt;Not smarter.&lt;/p&gt;

&lt;p&gt;Just less forgetful.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Rust?
&lt;/h2&gt;

&lt;p&gt;People ask this surprisingly often.&lt;/p&gt;

&lt;p&gt;The short answer is that Python would've been much faster to build.&lt;/p&gt;

&lt;p&gt;The long answer is that I didn't want users thinking about Python versions, virtual environments, or dependency conflicts before they could even open the terminal.&lt;/p&gt;

&lt;p&gt;I wanted this experience:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo build &lt;span class="nt"&gt;--release&lt;/span&gt;

./luna
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it.&lt;/p&gt;

&lt;p&gt;One binary.&lt;/p&gt;

&lt;p&gt;No runtime.&lt;/p&gt;

&lt;p&gt;No setup guide longer than the project itself.&lt;/p&gt;

&lt;p&gt;Rust also forced me to think carefully about architecture instead of continuously patching things together.&lt;/p&gt;

&lt;p&gt;Looking back, that probably made Luna a better project than if I'd optimized only for development speed.&lt;/p&gt;




&lt;p&gt;At this point, I thought the difficult part was over.&lt;/p&gt;

&lt;p&gt;I had a shell.&lt;/p&gt;

&lt;p&gt;I had AI.&lt;/p&gt;

&lt;p&gt;I had memory.&lt;/p&gt;

&lt;p&gt;Then the real engineering started.&lt;/p&gt;

&lt;h2&gt;
  
  
  The first version was... honestly pretty dumb.
&lt;/h2&gt;

&lt;p&gt;It could take plain English, send it to an LLM, and print back a shell command.&lt;/p&gt;

&lt;p&gt;That sounds impressive until you actually use it.&lt;/p&gt;

&lt;p&gt;The first problem wasn't generating commands.&lt;/p&gt;

&lt;p&gt;The first problem was trusting them.&lt;/p&gt;

&lt;p&gt;An AI can confidently suggest&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; something
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;just as easily as&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;ls&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One is harmless.&lt;/p&gt;

&lt;p&gt;One can ruin your afternoon.&lt;/p&gt;

&lt;p&gt;I knew very early that if Luna was going to exist, there had to be something sitting between&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;AI

↓

Your filesystem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That became the safety engine.&lt;/p&gt;

&lt;p&gt;Not an AI.&lt;/p&gt;

&lt;p&gt;Not another model.&lt;/p&gt;

&lt;p&gt;Just deterministic Rust code.&lt;/p&gt;

&lt;p&gt;Every command, regardless of where it came from, passes through exactly the same classifier before it ever reaches the shell.&lt;/p&gt;

&lt;p&gt;High-risk commands stop.&lt;/p&gt;

&lt;p&gt;The user sees exactly what's about to happen.&lt;/p&gt;

&lt;p&gt;Nothing executes silently.&lt;/p&gt;

&lt;p&gt;That became the rule I never compromised on.&lt;/p&gt;

&lt;p&gt;I trust AI enough to make suggestions.&lt;/p&gt;

&lt;p&gt;I don't trust it enough to execute commands without asking.&lt;/p&gt;




&lt;h2&gt;
  
  
  Then Rust reminded me who's in charge.
&lt;/h2&gt;

&lt;p&gt;People like to joke that Rust makes you fight the compiler.&lt;/p&gt;

&lt;p&gt;They're right.&lt;/p&gt;

&lt;p&gt;But most of my problems weren't borrow checker problems.&lt;/p&gt;

&lt;p&gt;They were architecture problems.&lt;/p&gt;

&lt;p&gt;One evening every AI request suddenly started failing with&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Cannot start a runtime from within a runtime
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I was convinced something was wrong with Groq.&lt;/p&gt;

&lt;p&gt;Spent hours checking API keys.&lt;/p&gt;

&lt;p&gt;Reading documentation.&lt;/p&gt;

&lt;p&gt;Testing requests outside Luna.&lt;/p&gt;

&lt;p&gt;Nothing.&lt;/p&gt;

&lt;p&gt;Eventually I realized the problem wasn't Groq at all.&lt;/p&gt;

&lt;p&gt;It was me.&lt;/p&gt;

&lt;p&gt;I had accidentally created a Tokio runtime inside another Tokio runtime.&lt;/p&gt;

&lt;p&gt;The fix ended up being surprisingly small.&lt;/p&gt;

&lt;p&gt;Spawn a dedicated thread with its own runtime for AI requests.&lt;/p&gt;

&lt;p&gt;Problem solved.&lt;/p&gt;

&lt;p&gt;It was one of those bugs where the solution takes ten minutes.&lt;/p&gt;

&lt;p&gt;Understanding the problem takes four hours.&lt;/p&gt;




&lt;h2&gt;
  
  
  Prompt engineering wasn't nearly as glamorous as people make it sound.
&lt;/h2&gt;

&lt;p&gt;One day Luna suggested&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;history&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;to inspect previous commands.&lt;/p&gt;

&lt;p&gt;Except...&lt;/p&gt;

&lt;p&gt;&lt;code&gt;history&lt;/code&gt; wasn't even a shell command.&lt;/p&gt;

&lt;p&gt;It was Luna's own built-in.&lt;/p&gt;

&lt;p&gt;The model had no way of knowing that.&lt;/p&gt;

&lt;p&gt;The bug wasn't in the AI.&lt;/p&gt;

&lt;p&gt;The bug was in the instructions I gave it.&lt;/p&gt;

&lt;p&gt;So I went back and rewrote the system prompt.&lt;/p&gt;

&lt;p&gt;Again.&lt;/p&gt;

&lt;p&gt;That became a recurring pattern throughout the project.&lt;/p&gt;

&lt;p&gt;Whenever the AI did something strange, my first instinct slowly changed from&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The model is wrong."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;to&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"What assumptions did I accidentally teach it?"&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h2&gt;
  
  
  Then came my favorite category of bugs.
&lt;/h2&gt;

&lt;p&gt;The ones where the software technically worked.&lt;/p&gt;

&lt;p&gt;Until someone got creative.&lt;/p&gt;

&lt;p&gt;For example,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;bash &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"rm -rf /"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;was caught by the safety engine.&lt;/p&gt;

&lt;p&gt;Good.&lt;/p&gt;

&lt;p&gt;Then I stopped for a second and thought&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"Wait..."&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;What about&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;eval&lt;/span&gt; &lt;span class="s2"&gt;"rm -rf /"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It wasn't caught.&lt;/p&gt;

&lt;p&gt;That wasn't a hypothetical vulnerability.&lt;/p&gt;

&lt;p&gt;It was an actual hole in my classifier.&lt;/p&gt;

&lt;p&gt;So I added &lt;code&gt;eval&lt;/code&gt; to the recursive shell unwrapper.&lt;/p&gt;

&lt;p&gt;Then another question appeared.&lt;/p&gt;

&lt;p&gt;What about&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;bash &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"..."&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Already handled.&lt;/p&gt;

&lt;p&gt;Good.&lt;/p&gt;

&lt;p&gt;Then&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nv"&gt;$cmd&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Command substitution.&lt;/p&gt;

&lt;p&gt;Also handled.&lt;/p&gt;

&lt;p&gt;Only because I'd already implemented recursive payload extraction.&lt;/p&gt;

&lt;p&gt;Building the safety engine slowly became an exercise in asking myself one question over and over.&lt;/p&gt;

&lt;p&gt;"What would someone do to get around this?"&lt;/p&gt;

&lt;p&gt;Every answer became another test.&lt;/p&gt;

&lt;p&gt;Another edge case.&lt;/p&gt;

&lt;p&gt;Another rule.&lt;/p&gt;

&lt;p&gt;Not because users are malicious.&lt;/p&gt;

&lt;p&gt;Because software eventually reaches people who are more creative than its author.&lt;/p&gt;




&lt;h2&gt;
  
  
  The most boring file in the repository is also my favorite.
&lt;/h2&gt;

&lt;p&gt;It's around 250 lines of Rust.&lt;/p&gt;

&lt;p&gt;No machine learning.&lt;/p&gt;

&lt;p&gt;No APIs.&lt;/p&gt;

&lt;p&gt;No fancy algorithms.&lt;/p&gt;

&lt;p&gt;Just pattern matching.&lt;/p&gt;

&lt;p&gt;But that file probably taught me more than the rest of the project combined.&lt;/p&gt;

&lt;p&gt;At one point I noticed I was warning users every time they used&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mv&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Technically they &lt;em&gt;could&lt;/em&gt; be dangerous.&lt;/p&gt;

&lt;p&gt;Practically...&lt;/p&gt;

&lt;p&gt;Nobody wants to confirm&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;mv &lt;/span&gt;old.txt new.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;every five minutes.&lt;/p&gt;

&lt;p&gt;Warnings people ignore are worse than warnings that don't exist.&lt;/p&gt;

&lt;p&gt;So I removed them.&lt;/p&gt;

&lt;p&gt;The safety engine became quieter.&lt;/p&gt;

&lt;p&gt;And because of that,&lt;/p&gt;

&lt;p&gt;it became more useful.&lt;/p&gt;




&lt;h2&gt;
  
  
  I made exactly the same mistake somewhere else.
&lt;/h2&gt;

&lt;p&gt;I wanted Luna's personalized command ranking to feel intelligent.&lt;/p&gt;

&lt;p&gt;So I experimented with fuzzy matching.&lt;/p&gt;

&lt;p&gt;Token similarity.&lt;/p&gt;

&lt;p&gt;Partial matches.&lt;/p&gt;

&lt;p&gt;Prefix scoring.&lt;/p&gt;

&lt;p&gt;The results looked clever.&lt;/p&gt;

&lt;p&gt;Until I actually used them.&lt;/p&gt;

&lt;p&gt;Luna started recommending commands that were &lt;em&gt;kind of similar&lt;/em&gt; to things I'd run before.&lt;/p&gt;

&lt;p&gt;Not the exact command.&lt;/p&gt;

&lt;p&gt;Just close enough.&lt;/p&gt;

&lt;p&gt;It felt wrong immediately.&lt;/p&gt;

&lt;p&gt;So I deleted all of it.&lt;/p&gt;

&lt;p&gt;Now the ranking is intentionally simple.&lt;/p&gt;

&lt;p&gt;If you've successfully run&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;twenty times,&lt;/p&gt;

&lt;p&gt;Luna assumes you probably like&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo run
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Not&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Not&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;cargo build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Just the thing you've repeatedly chosen yourself.&lt;/p&gt;

&lt;p&gt;Sometimes software becomes better because it gets smarter.&lt;/p&gt;

&lt;p&gt;Sometimes it becomes better because it stops pretending to be.&lt;/p&gt;




&lt;h2&gt;
  
  
  SQLite was probably the easiest decision in the whole project.
&lt;/h2&gt;

&lt;p&gt;People sometimes ask why I didn't use PostgreSQL.&lt;/p&gt;

&lt;p&gt;Or Redis.&lt;/p&gt;

&lt;p&gt;Or some embedded vector database.&lt;/p&gt;

&lt;p&gt;Because Luna isn't a distributed system.&lt;/p&gt;

&lt;p&gt;It's your terminal.&lt;/p&gt;

&lt;p&gt;I didn't need clusters.&lt;/p&gt;

&lt;p&gt;I didn't need replication.&lt;/p&gt;

&lt;p&gt;I needed one file.&lt;/p&gt;

&lt;p&gt;One database that starts instantly, survives restarts, and doesn't ask users to install anything else.&lt;/p&gt;

&lt;p&gt;SQLite has been solving exactly that problem for over twenty years.&lt;/p&gt;

&lt;p&gt;Sometimes boring technology is exactly the right technology.&lt;/p&gt;




&lt;h2&gt;
  
  
  Somewhere around this point, something changed.
&lt;/h2&gt;

&lt;p&gt;When I started Luna, I thought integrating AI would be the difficult part.&lt;/p&gt;

&lt;p&gt;It wasn't.&lt;/p&gt;

&lt;p&gt;Calling an LLM API took an afternoon.&lt;/p&gt;

&lt;p&gt;Everything around the model took months.&lt;/p&gt;

&lt;p&gt;Deciding when not to trust it.&lt;/p&gt;

&lt;p&gt;Remembering useful context without remembering everything.&lt;/p&gt;

&lt;p&gt;Making sure users stayed in control.&lt;/p&gt;

&lt;p&gt;Building software around AI turned out to be far more interesting than calling AI itself.&lt;/p&gt;

&lt;p&gt;That wasn't what I expected to learn when I started this project.&lt;/p&gt;

&lt;p&gt;But it's probably the lesson that's going to stay with me the longest.&lt;/p&gt;

&lt;h2&gt;
  
  
  Shipping was harder than building.
&lt;/h2&gt;

&lt;p&gt;At some point, Luna reached a stage where it actually worked.&lt;/p&gt;

&lt;p&gt;The shell worked.&lt;/p&gt;

&lt;p&gt;The AI worked.&lt;/p&gt;

&lt;p&gt;The memory worked.&lt;/p&gt;

&lt;p&gt;The safety engine worked.&lt;/p&gt;

&lt;p&gt;I thought I was almost finished.&lt;/p&gt;

&lt;p&gt;I wasn't.&lt;/p&gt;

&lt;p&gt;Because working software on your own machine isn't a product.&lt;/p&gt;

&lt;p&gt;It's just software.&lt;/p&gt;

&lt;p&gt;Making it usable by someone else turned out to be an entirely different project.&lt;/p&gt;

&lt;p&gt;I had to think about installation.&lt;/p&gt;

&lt;p&gt;Releases.&lt;/p&gt;

&lt;p&gt;GitHub Actions.&lt;/p&gt;

&lt;p&gt;Configuration files.&lt;/p&gt;

&lt;p&gt;Auto-updates.&lt;/p&gt;

&lt;p&gt;Backward compatibility.&lt;/p&gt;

&lt;p&gt;Migration when configuration formats changed.&lt;/p&gt;

&lt;p&gt;The installer alone took much longer than I expected.&lt;/p&gt;

&lt;p&gt;The core logic is maybe fifty lines of Bash.&lt;/p&gt;

&lt;p&gt;Everything around it—missing &lt;code&gt;PATH&lt;/code&gt; entries, unsupported platforms, build-from-source fallback, release detection, user mistakes—added hundreds more.&lt;/p&gt;

&lt;p&gt;None of it was exciting.&lt;/p&gt;

&lt;p&gt;All of it mattered.&lt;/p&gt;

&lt;p&gt;Building features gets attention.&lt;/p&gt;

&lt;p&gt;Building a good experience doesn't.&lt;/p&gt;




&lt;h2&gt;
  
  
  Luna today
&lt;/h2&gt;

&lt;p&gt;Today Luna supports six AI providers.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Groq&lt;/li&gt;
&lt;li&gt;OpenAI&lt;/li&gt;
&lt;li&gt;Anthropic Claude&lt;/li&gt;
&lt;li&gt;Google Gemini&lt;/li&gt;
&lt;li&gt;OpenRouter&lt;/li&gt;
&lt;li&gt;Ollama&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That wasn't originally the plan.&lt;/p&gt;

&lt;p&gt;Early on I only wanted one provider.&lt;/p&gt;

&lt;p&gt;Then I realized something.&lt;/p&gt;

&lt;p&gt;The AI ecosystem changes too quickly.&lt;/p&gt;

&lt;p&gt;Models improve.&lt;/p&gt;

&lt;p&gt;Pricing changes.&lt;/p&gt;

&lt;p&gt;Rate limits appear.&lt;/p&gt;

&lt;p&gt;Companies disappear.&lt;/p&gt;

&lt;p&gt;I didn't want Luna to depend on one API.&lt;/p&gt;

&lt;p&gt;I wanted users to decide.&lt;/p&gt;

&lt;p&gt;If someone prefers cloud models, great.&lt;/p&gt;

&lt;p&gt;If someone wants everything to stay local through Ollama, that's great too.&lt;/p&gt;

&lt;p&gt;Luna doesn't care.&lt;/p&gt;

&lt;p&gt;Switch providers.&lt;/p&gt;

&lt;p&gt;Keep working.&lt;/p&gt;

&lt;p&gt;That flexibility became part of the design rather than an extra feature.&lt;/p&gt;




&lt;h2&gt;
  
  
  Looking back, Luna isn't really about AI.
&lt;/h2&gt;

&lt;p&gt;This surprised me.&lt;/p&gt;

&lt;p&gt;If someone asked what Luna is, the easy answer would be&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"An AI-powered terminal."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Technically that's true.&lt;/p&gt;

&lt;p&gt;But I don't think that's what I built.&lt;/p&gt;

&lt;p&gt;I think I built software that tries to answer a different question.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What happens when AI becomes part of everyday tools?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;My conclusion is that the model itself isn't the difficult part.&lt;/p&gt;

&lt;p&gt;The difficult part is everything surrounding it.&lt;/p&gt;

&lt;p&gt;When should it remember?&lt;/p&gt;

&lt;p&gt;When should it forget?&lt;/p&gt;

&lt;p&gt;When should it ask for confirmation?&lt;/p&gt;

&lt;p&gt;When should it stay completely out of the way?&lt;/p&gt;

&lt;p&gt;Those questions don't have API endpoints.&lt;/p&gt;

&lt;p&gt;They're product decisions.&lt;/p&gt;

&lt;p&gt;They're engineering decisions.&lt;/p&gt;

&lt;p&gt;And they're trust decisions.&lt;/p&gt;

&lt;p&gt;Building Luna changed how I think about AI.&lt;/p&gt;

&lt;p&gt;I used to think the interesting challenge was making models smarter.&lt;/p&gt;

&lt;p&gt;Now I think the more interesting challenge is making them predictable.&lt;/p&gt;




&lt;h2&gt;
  
  
  What I learned
&lt;/h2&gt;

&lt;p&gt;If I had to summarize six months of building Luna into a few lessons, they'd be these.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Safety is a feature.
&lt;/h3&gt;

&lt;p&gt;It's easy to get excited about what AI &lt;em&gt;can&lt;/em&gt; do.&lt;/p&gt;

&lt;p&gt;It's harder—and more important—to decide what it &lt;em&gt;shouldn't&lt;/em&gt; do.&lt;/p&gt;

&lt;p&gt;The safety engine isn't the flashiest part of Luna.&lt;/p&gt;

&lt;p&gt;It's the part I'd miss most if it disappeared.&lt;/p&gt;




&lt;h3&gt;
  
  
  2. Memory changes everything.
&lt;/h3&gt;

&lt;p&gt;The terminal already remembers commands.&lt;/p&gt;

&lt;p&gt;That isn't enough.&lt;/p&gt;

&lt;p&gt;Remembering context is different.&lt;/p&gt;

&lt;p&gt;Context turns repeated work into assisted work.&lt;/p&gt;

&lt;p&gt;The goal was never to replace the user.&lt;/p&gt;

&lt;p&gt;The goal was to stop making the user repeat themselves.&lt;/p&gt;




&lt;h3&gt;
  
  
  3. Boring technology wins.
&lt;/h3&gt;

&lt;p&gt;Rust.&lt;/p&gt;

&lt;p&gt;SQLite.&lt;/p&gt;

&lt;p&gt;Git.&lt;/p&gt;

&lt;p&gt;GitHub Actions.&lt;/p&gt;

&lt;p&gt;None of these are particularly exciting.&lt;/p&gt;

&lt;p&gt;They are reliable.&lt;/p&gt;

&lt;p&gt;Over and over again, I found myself replacing clever ideas with simpler ones.&lt;/p&gt;

&lt;p&gt;Almost every time, the software became better.&lt;/p&gt;




&lt;h3&gt;
  
  
  4. Shipping teaches different lessons than building.
&lt;/h3&gt;

&lt;p&gt;There were features I wanted in v0.1.0.&lt;/p&gt;

&lt;p&gt;Themes.&lt;/p&gt;

&lt;p&gt;Better workflow suggestions.&lt;/p&gt;

&lt;p&gt;Smarter personalization.&lt;/p&gt;

&lt;p&gt;Cross-platform support.&lt;/p&gt;

&lt;p&gt;None of them shipped.&lt;/p&gt;

&lt;p&gt;Not because they weren't useful.&lt;/p&gt;

&lt;p&gt;Because software only becomes useful after people can actually use it.&lt;/p&gt;

&lt;p&gt;Version 1 is never perfect.&lt;/p&gt;

&lt;p&gt;Waiting for perfect means never shipping.&lt;/p&gt;




&lt;h2&gt;
  
  
  What's next
&lt;/h2&gt;

&lt;p&gt;Luna is still at the beginning.&lt;/p&gt;

&lt;p&gt;There are dozens of ideas sitting in my notes.&lt;/p&gt;

&lt;p&gt;Some are small.&lt;/p&gt;

&lt;p&gt;Some probably require rewriting parts of the architecture.&lt;/p&gt;

&lt;p&gt;The biggest things I want to improve are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Better workflow detection.&lt;/li&gt;
&lt;li&gt;Smarter error recovery.&lt;/li&gt;
&lt;li&gt;Cross-platform support beyond Linux and WSL.&lt;/li&gt;
&lt;li&gt;A memory system that understands projects instead of only commands.&lt;/li&gt;
&lt;li&gt;Better explanations for why Luna recommends something, not just what it recommends.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The project will probably change a lot over the next year.&lt;/p&gt;

&lt;p&gt;I hope the core philosophy doesn't.&lt;/p&gt;

&lt;p&gt;Keep users in control.&lt;/p&gt;

&lt;p&gt;Remember useful things.&lt;/p&gt;

&lt;p&gt;Never execute something surprising.&lt;/p&gt;




&lt;h2&gt;
  
  
  Final thoughts
&lt;/h2&gt;

&lt;p&gt;Six months ago I wasn't trying to build a product.&lt;/p&gt;

&lt;p&gt;I was trying to solve an annoyance I'd accepted for years.&lt;/p&gt;

&lt;p&gt;Somewhere along the way, that annoyance turned into the biggest software project I've ever built.&lt;/p&gt;

&lt;p&gt;Luna still has rough edges.&lt;/p&gt;

&lt;p&gt;I'm sure people will find bugs I never imagined.&lt;/p&gt;

&lt;p&gt;Some of my design decisions will probably turn out to be wrong.&lt;/p&gt;

&lt;p&gt;That's okay.&lt;/p&gt;

&lt;p&gt;Open source software gets better because other people challenge your assumptions.&lt;/p&gt;

&lt;p&gt;If you try Luna and think something should work differently, I'd genuinely like to hear why.&lt;/p&gt;

&lt;p&gt;Those conversations are usually where the next version starts.&lt;/p&gt;




&lt;p&gt;Luna is open source under the MIT License.&lt;/p&gt;

&lt;p&gt;If you'd like to try it, contribute, report a bug, or simply tell me what you think, here's the repository:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/akhwasim/luna" rel="noopener noreferrer"&gt;https://github.com/akhwasim/luna&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-fsSL&lt;/span&gt; https://raw.githubusercontent.com/akhwasim/luna/main/install.sh | bash
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Thanks for reading.&lt;/p&gt;

</description>
      <category>rust</category>
      <category>ai</category>
      <category>terminal</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
