<?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: Omer Saleem</title>
    <description>The latest articles on DEV Community by Omer Saleem (@omerbinsaleem).</description>
    <link>https://dev.to/omerbinsaleem</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4219394%2F32e4d4cf-ac5e-4d15-885b-96818bb077bc.gif</url>
      <title>DEV Community: Omer Saleem</title>
      <link>https://dev.to/omerbinsaleem</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/omerbinsaleem"/>
    <language>en</language>
    <item>
      <title>One editor window quietly loaded every worktree I opened</title>
      <dc:creator>Omer Saleem</dc:creator>
      <pubDate>Tue, 24 Nov 2026 06:36:43 +0000</pubDate>
      <link>https://dev.to/omerbinsaleem/one-editor-window-quietly-loaded-every-worktree-i-opened-4a4j</link>
      <guid>https://dev.to/omerbinsaleem/one-editor-window-quietly-loaded-every-worktree-i-opened-4a4j</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.omerbinsaleem.com/hacks/one-window-loads-every-worktree/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt; by Omer Bin Saleem (Omer Saleem).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Stacked "Initializing" notifications were not a slow start. The language server was running out of memory and restarting, once per popup.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to do it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Read the stacked popups as a symptom, not a status. A notification that never closes belongs to a process that died before it could close it, so count them: each one is a restart.&lt;/li&gt;
&lt;li&gt;Open the extension host output log for that server in your editor's log folder for the current window (mine was the Angular Language Service in Cursor, under output_logging_*), and grep for three strings: &lt;code&gt;exited with signal&lt;/code&gt;, &lt;code&gt;heap out of memory&lt;/code&gt;, and &lt;code&gt;Enabling language service for&lt;/code&gt;. The first two confirm a crash loop. The third tells you what the server was holding when it died.&lt;/li&gt;
&lt;li&gt;Count the distinct projects in that third list. One server runs per editor window, and it keeps every project whose file was ever opened in that window. Mine held seventeen worktrees of our app at once, with ten crashes in the log.&lt;/li&gt;
&lt;li&gt;Check whether you can cap it before you try to. That extension has no memory or exclude setting, and the 4 GB heap is the editor runtime's own pointer compression limit, so no configuration fixes this. About six to eight copies of our app fill it.&lt;/li&gt;
&lt;li&gt;Reload the window. That clears the dead popups and starts one fresh server holding nothing.&lt;/li&gt;
&lt;li&gt;Change the habit instead of the setting: open a worktree in its own window rather than browsing its files from the main one. With several branches and sessions in flight, a worktree sitting on disk costs nothing. Opening one of its files in the main window is what loads it for the rest of the session.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prompt to copy
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;My editor keeps stacking "Initializing" notifications from a language server extension in one window, and the old ones never close. Find the extension host output log for that server for the current window, then grep it for `exited with signal`, `heap out of memory`, and `Enabling language service for`. Tell me how many times it crashed, and list the distinct projects it had loaded with a count. Do not change any settings yet.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;I am Omer Bin Saleem, a frontend chapter lead who builds with AI every day. One practical AI hack a day at &lt;a href="https://www.omerbinsaleem.com/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt;. LinkedIn: &lt;a href="https://www.linkedin.com/in/omer-bin-saleem/" rel="noopener noreferrer"&gt;omer-bin-saleem&lt;/a&gt; · Instagram: &lt;a href="https://www.instagram.com/iomerbinsaleem/" rel="noopener noreferrer"&gt;@iomerbinsaleem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written with AI assistance, from my own work notes.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>agents</category>
      <category>webdev</category>
    </item>
    <item>
      <title>A review bot should earn every message it sends</title>
      <dc:creator>Omer Saleem</dc:creator>
      <pubDate>Fri, 20 Nov 2026 05:02:41 +0000</pubDate>
      <link>https://dev.to/omerbinsaleem/a-review-bot-should-earn-every-message-it-sends-4ig7</link>
      <guid>https://dev.to/omerbinsaleem/a-review-bot-should-earn-every-message-it-sends-4ig7</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.omerbinsaleem.com/hacks/a-review-bot-should-earn-every-message/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt; by Omer Bin Saleem (Omer Saleem).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;The findings were fine, the volume was the problem. Cutting our review bot down to one card per thread took two moves: edit in place, and ignore events that were never requests.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Each thread now has one card, taken over and updated in place every hour instead of posted again.&lt;/li&gt;
&lt;li&gt;A re-review in a thread costs four fewer messages.&lt;/li&gt;
&lt;li&gt;The bot stops after two rounds and names what actually breaks.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to do it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Count the messages one review produces, not just the findings it reports. Our re-review in a thread was spending four messages more than the work needed.&lt;/li&gt;
&lt;li&gt;Give each thread exactly one card. On the next run, take over the card that is already there and update it in place, rather than appending a second one.&lt;/li&gt;
&lt;li&gt;Decide what counts as a request before the bot is allowed to speak. Another reviewer's verdict is not a request for yours, a merge needs no notice, and a roundup of open merge requests is not a review request.&lt;/li&gt;
&lt;li&gt;Collapse the repeats. One message for a request that covers several merge requests, one notice per duplicate pair, and a conflict said once instead of on every pass.&lt;/li&gt;
&lt;li&gt;Cap the argument. After two rounds the bot stops and states what breaks, so a disagreement with the author does not grow into a thread nobody finishes reading.&lt;/li&gt;
&lt;li&gt;Print nothing when there is nothing. A row of zeros is noise, and it teaches the team to scroll past the card that will matter next week.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prompt to copy
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Here is my review bot's code and the log of one real run. List every message it sent for a single review, in order, and the event that triggered each one. Then tell me: which of those messages could have been an edit of an earlier message instead of a new one, and which triggers were not actually a request for the bot to act. Finish with the smallest change that gets me to one card per thread, updated in place, and a hard stop after two rounds of back and forth.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;I am Omer Bin Saleem, a frontend chapter lead who builds with AI every day. One practical AI hack a day at &lt;a href="https://www.omerbinsaleem.com/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt;. LinkedIn: &lt;a href="https://www.linkedin.com/in/omer-bin-saleem/" rel="noopener noreferrer"&gt;omer-bin-saleem&lt;/a&gt; · Instagram: &lt;a href="https://www.instagram.com/iomerbinsaleem/" rel="noopener noreferrer"&gt;@iomerbinsaleem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written with AI assistance, from my own work notes.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>agents</category>
      <category>webdev</category>
    </item>
    <item>
      <title>When the browser link drops, which comment actually landed?</title>
      <dc:creator>Omer Saleem</dc:creator>
      <pubDate>Thu, 19 Nov 2026 05:03:25 +0000</pubDate>
      <link>https://dev.to/omerbinsaleem/when-the-browser-link-drops-which-comment-actually-landed-10d8</link>
      <guid>https://dev.to/omerbinsaleem/when-the-browser-link-drops-which-comment-actually-landed-10d8</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.omerbinsaleem.com/hacks/a-dropped-call-is-not-a-failed-post/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt; by Omer Bin Saleem (Omer Saleem).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;An agent sent a comment and the connection died before the result came back. Retrying blind is how you end up posting twice.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Every queued item now carries its verification URL and a search phrase in the run log.&lt;/li&gt;
&lt;li&gt;A call whose result never returned is logged as unknown, and checked on the page before any retry.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to do it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Treat any call whose result you never saw as unknown, not failed. In one run the browser link dropped three times: a frozen tab, then two lost connections. Both times the call had already gone through or was still in flight, so a retry would have been a second post.&lt;/li&gt;
&lt;li&gt;Decide the verification path before you need it. For each queued item, write down the exact URL that lists your own writes and a short phrase from the text you are about to send. One line of the comment is enough to search for.&lt;/li&gt;
&lt;li&gt;Do not trust the page you were working on. After a reload, the author's activity page showed the post without its comments, so the agent's own "already on page" check could not see a comment that was already there.&lt;/li&gt;
&lt;li&gt;Check the page that only shows your own writes. Present means record it as done. Absent means send it once, then verify again.&lt;/li&gt;
&lt;li&gt;Pace the queue so one drop costs one item. Items went out one every five minutes, so the remaining twenty three comments simply waited while the unknown one was resolved.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prompt to copy
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are posting through my browser, one item at a time, from a queue. For every item, record in the run log: the item id, the exact URL that lists my own posts or comments, and a short phrase from the text you are about to send. If a call's result never comes back, mark that item unknown, not failed. Before touching it again, open the own-posts URL and search for the phrase: if it is there, record the item as done; if it is not, send it once and check again. Never judge from the page you were working on, because a reload can show a post without its comments. Then continue the queue in order, oldest first.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;I am Omer Bin Saleem, a frontend chapter lead who builds with AI every day. One practical AI hack a day at &lt;a href="https://www.omerbinsaleem.com/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt;. LinkedIn: &lt;a href="https://www.linkedin.com/in/omer-bin-saleem/" rel="noopener noreferrer"&gt;omer-bin-saleem&lt;/a&gt; · Instagram: &lt;a href="https://www.instagram.com/iomerbinsaleem/" rel="noopener noreferrer"&gt;@iomerbinsaleem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written with AI assistance, from my own work notes.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>agents</category>
      <category>webdev</category>
    </item>
    <item>
      <title>A resumed tab had zero width, so nothing opened</title>
      <dc:creator>Omer Saleem</dc:creator>
      <pubDate>Wed, 18 Nov 2026 07:26:53 +0000</pubDate>
      <link>https://dev.to/omerbinsaleem/a-resumed-tab-had-zero-width-so-nothing-opened-1g1m</link>
      <guid>https://dev.to/omerbinsaleem/a-resumed-tab-had-zero-width-so-nothing-opened-1g1m</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.omerbinsaleem.com/hacks/resumed-tabs-can-have-zero-width/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt; by Omer Bin Saleem (Omer Saleem).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A queued browser run finished 40 of 42 items. The two that failed were not blocked by the site: the tab they ran in measured zero width, so the editor was never built.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Each item now measures the window before it acts, and refuses rather than types when the size is zero&lt;/li&gt;
&lt;li&gt;A fresh tab replaces the one a resumed session hands back&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to do it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Measure the window before every action, not once at the start. In the failed run the page was there, the item was there, and window.innerWidth was 0, so the comment box was never laid out and no editor existed to type into.&lt;/li&gt;
&lt;li&gt;Treat a closed and resumed session as a suspect environment. The two failures came after a resume, in the tab the session restored. From the third item on, the run opened a new tab instead, and 28 of 28 remaining items went out.&lt;/li&gt;
&lt;li&gt;Refuse, do not improvise. Both failures were labelled for one cause and nothing was typed or posted, so no half written text reached anyone. A run that cannot act should produce a reason, not a guess.&lt;/li&gt;
&lt;li&gt;Do not retry into the same broken window. Neither failure was retried, and that was the right call: the next attempt would have met the same zero width tab. Fix the window first, then continue.&lt;/li&gt;
&lt;li&gt;Report refusals separately from sends. A line that says 40 of 42 done, 2 refused, with the cause next to each, tells you whether to change the automation or the content. A single success rate hides which one.&lt;/li&gt;
&lt;li&gt;Keep the check cheap, because the queue is slow. With about five minutes between items, a long list outlives the window it started in, so one measurement per item costs nothing and catches the change.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prompt to copy
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I am running a queue of browser actions with a few minutes between items, in a session that may be closed and resumed between them. Before each action, measure window.innerWidth and window.innerHeight. If either is 0, refuse that item, log a one word reason, and type nothing. Prefer opening a fresh tab over reusing the tab a resumed session restored. Never retry into a window that already measured zero. At the end, report done, refused and skipped as separate counts, with the reason beside each refusal.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;I am Omer Bin Saleem, a frontend chapter lead who builds with AI every day. One practical AI hack a day at &lt;a href="https://www.omerbinsaleem.com/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt;. LinkedIn: &lt;a href="https://www.linkedin.com/in/omer-bin-saleem/" rel="noopener noreferrer"&gt;omer-bin-saleem&lt;/a&gt; · Instagram: &lt;a href="https://www.instagram.com/iomerbinsaleem/" rel="noopener noreferrer"&gt;@iomerbinsaleem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written with AI assistance, from my own work notes.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>agents</category>
      <category>webdev</category>
    </item>
    <item>
      <title>A rulebook rots quietly. What checks it every Monday?</title>
      <dc:creator>Omer Saleem</dc:creator>
      <pubDate>Mon, 16 Nov 2026 05:03:08 +0000</pubDate>
      <link>https://dev.to/omerbinsaleem/a-rulebook-rots-quietly-what-checks-it-every-monday-50d3</link>
      <guid>https://dev.to/omerbinsaleem/a-rulebook-rots-quietly-what-checks-it-every-monday-50d3</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.omerbinsaleem.com/hacks/lint-the-rulebook-weekly/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt; by Omer Bin Saleem (Omer Saleem).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Rules for Claude Code pile up until two of them contradict each other and nobody notices. A scheduled read-only lint found the contradictions the team had stopped seeing.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to do it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Start without a model. A plain script can find rule IDs, commands, scripts and links that point at nothing. Those are the cheapest findings and they need no Claude at all.&lt;/li&gt;
&lt;li&gt;Add four read-only passes with claude -p, one question each: CONFLICT, STALE, DRIFT and DUPLICATE. Give it only Read, Grep and Glob, no project settings loaded, no session saved. One pass with one question is easier to trust than one pass that asks everything.&lt;/li&gt;
&lt;li&gt;Put it on a schedule, not in a hook. Ours is a launchd job on Monday at 11:00. It runs the lint script straight from the remote main branch, so the local checkout is never pulled and never changes under it.&lt;/li&gt;
&lt;li&gt;Write the report to a dated file and keep a log. The first report held 41 findings. Three were checked by hand and were real: a gate script blocked a push that the handoff guide said goes through, and a guide accepted a ticket prefix that a check script refused. Each had sat there while people read the files every day.&lt;/li&gt;
&lt;li&gt;Keep the fixes human. Nothing in the job edits a rule. Every finding goes through the same review as any other rule change, because only one person on the team approves rules.&lt;/li&gt;
&lt;li&gt;Say no to the full wiki. We looked at the LLM Wiki pattern and took only the lint job. An earlier auto-capture queue had collected 1669 events and nobody ever read one of them. A weekly report someone opens beats a stream nobody consumes.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prompt to copy
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are linting a rulebook that a coding agent follows. Read-only: do not edit, create or move any file. Read every rule, script and guide under the rules directory. Report only CONFLICT findings: two places that cannot both be true, such as a script that blocks what a guide says is allowed, or two rules that give different answers to the same situation. For each finding give both file paths, quote the exact lines, and say in one sentence what happens to an engineer who follows the first one. Do not propose rewrites. If you find nothing, say so in one line.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;I am Omer Bin Saleem, a frontend chapter lead who builds with AI every day. One practical AI hack a day at &lt;a href="https://www.omerbinsaleem.com/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt;. LinkedIn: &lt;a href="https://www.linkedin.com/in/omer-bin-saleem/" rel="noopener noreferrer"&gt;omer-bin-saleem&lt;/a&gt; · Instagram: &lt;a href="https://www.instagram.com/iomerbinsaleem/" rel="noopener noreferrer"&gt;@iomerbinsaleem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written with AI assistance, from my own work notes.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>agents</category>
      <category>webdev</category>
    </item>
    <item>
      <title>When the contact form cannot send, who delivers the message?</title>
      <dc:creator>Omer Saleem</dc:creator>
      <pubDate>Sat, 14 Nov 2026 05:02:30 +0000</pubDate>
      <link>https://dev.to/omerbinsaleem/when-the-contact-form-cannot-send-who-delivers-the-message-4m9i</link>
      <guid>https://dev.to/omerbinsaleem/when-the-contact-form-cannot-send-who-delivers-the-message-4m9i</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.omerbinsaleem.com/hacks/contact-form-fallback-to-email-app/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt; by Omer Bin Saleem (Omer Saleem).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A contact form that depends on one server call loses the message the moment that call fails. The fallback we shipped hands the message to the visitor's own email app instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;2026-11-13: when the server cannot send, the inquiry form opens the visitor's email app with the message.&lt;/li&gt;
&lt;li&gt;2026-11-14: the form now sends through the site's own mailbox, straight to the inbox. The endpoint needs only its key.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to do it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Send through the site's own mailbox. Our inquiry form posts to one endpoint that needs only its key and delivers straight to the inbox, so there is no third-party form service to configure, pay for or outlive.&lt;/li&gt;
&lt;li&gt;Treat every send failure the same way. Network error, bad response, missing key: the form does not show an error and stop. It opens the visitor's email app with the subject and the typed message already filled in, so the message still reaches you.&lt;/li&gt;
&lt;li&gt;Build the fallback from the live form fields. The mailto link must carry exactly what the visitor typed at the moment the request failed. If the form resets before the fallback runs, the visitor is left with an empty mail window and no reason to type it again.&lt;/li&gt;
&lt;li&gt;Keep the two paths in one handler. One function submits, catches any failure, and falls through to the mailto. Two separate code paths drift apart and one of them stops being tested.&lt;/li&gt;
&lt;li&gt;Test the failure path on purpose. Remove the key or block the endpoint locally and submit the form. If your email app does not open with the message inside it, the fallback is not done.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prompt to copy
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;My site has a contact form that posts to a serverless endpoint and sends mail from the site's own mailbox using a single key. Add a fallback: if the request fails for any reason (network error, non-2xx response, missing or wrong key), open the visitor's email app with a mailto link that carries the subject and the full message they typed, read from the live form fields at the moment of failure. Do not clear the form before the fallback runs. Keep submit and fallback in one handler. Then show me how to trigger the failure locally so I can watch the mail app open with my text inside it.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;I am Omer Bin Saleem, a frontend chapter lead who builds with AI every day. One practical AI hack a day at &lt;a href="https://www.omerbinsaleem.com/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt;. LinkedIn: &lt;a href="https://www.linkedin.com/in/omer-bin-saleem/" rel="noopener noreferrer"&gt;omer-bin-saleem&lt;/a&gt; · Instagram: &lt;a href="https://www.instagram.com/iomerbinsaleem/" rel="noopener noreferrer"&gt;@iomerbinsaleem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written with AI assistance, from my own work notes.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>agents</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Why commits in a git worktree ran no husky hooks</title>
      <dc:creator>Omer Saleem</dc:creator>
      <pubDate>Fri, 13 Nov 2026 05:02:46 +0000</pubDate>
      <link>https://dev.to/omerbinsaleem/why-commits-in-a-git-worktree-ran-no-husky-hooks-4cdm</link>
      <guid>https://dev.to/omerbinsaleem/why-commits-in-a-git-worktree-ran-no-husky-hooks-4cdm</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.omerbinsaleem.com/hacks/git-worktree-commits-skip-husky-hooks/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt; by Omer Bin Saleem (Omer Saleem).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;In a linked worktree, husky's runner folder was missing, so commits ran no hooks at all. Copying it in exposed a second trap, and a local clone fixed both.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to do it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Check first whether hooks run at all. Husky's runner folder &lt;code&gt;.husky/_&lt;/code&gt; is generated and gitignored, and &lt;code&gt;core.hooksPath=.husky/_&lt;/code&gt; resolves per worktree. A linked worktree has no such folder, so commits there ran no pre-commit, commit-msg or pre-push hook.&lt;/li&gt;
&lt;li&gt;Copying &lt;code&gt;.husky/_&lt;/code&gt; in makes the hooks run, but a hook that falls back to Docker can still fail. Our gitleaks step mounted only the worktree, whose &lt;code&gt;.git&lt;/code&gt; file points at &lt;code&gt;&amp;lt;main&amp;gt;/.git/worktrees/&amp;lt;name&amp;gt;&lt;/code&gt;, outside the mount, so it stopped with "not a git repository".&lt;/li&gt;
&lt;li&gt;Commit from a local clone instead: &lt;code&gt;git clone -q --no-checkout &amp;lt;main repo&amp;gt; &amp;lt;dir&amp;gt;&lt;/code&gt;. A local clone hardlinks the objects, so the container can read them. Do not use &lt;code&gt;--shared&lt;/code&gt;, because its alternates point at host paths.&lt;/li&gt;
&lt;li&gt;In the clone, run &lt;code&gt;checkout --detach &amp;lt;origin/branch SHA&amp;gt;&lt;/code&gt; and &lt;code&gt;remote set-url origin &amp;lt;remote URL&amp;gt;&lt;/code&gt;, copy user.name and user.email, &lt;code&gt;cp -R .husky/_&lt;/code&gt;, set &lt;code&gt;core.hooksPath .husky/_&lt;/code&gt;, and symlink &lt;code&gt;node_modules&lt;/code&gt;. Commit and push from there, and delete the clone once &lt;code&gt;git ls-remote&lt;/code&gt; shows the SHA.&lt;/li&gt;
&lt;li&gt;Read the working tree after each commit. The clone's local main was 114 commits behind, so lint-staged's &lt;code&gt;nx format:write&lt;/code&gt; reformatted 30 app files that were never staged. The commit held only the staged files; &lt;code&gt;git show --name-only HEAD&lt;/code&gt;, &lt;code&gt;git status&lt;/code&gt; and &lt;code&gt;git restore --worktree -- .&lt;/code&gt; cleared the rest.&lt;/li&gt;
&lt;li&gt;Keep the guard rails while you fix it: never &lt;code&gt;--no-verify&lt;/code&gt;, and do not quietly install a local gitleaks, since every future commit would move off the pinned Docker version.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prompt to copy
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;I commit from a linked git worktree in a repo that uses husky. Check whether hooks really run here: read `git config core.hooksPath`, check that folder exists in this worktree, and list the hooks that would fire. Never use --no-verify or install a tool. If the runner is missing or a Docker hook cannot see the repo, set up a local clone with `git clone --no-checkout` (never --shared) at my branch SHA, copy the hooks folder and git identity, symlink node_modules, and show each command before running it. After the commit, show `git status` so I can restore files a formatter touched outside the commit.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;I am Omer Bin Saleem, a frontend chapter lead who builds with AI every day. One practical AI hack a day at &lt;a href="https://www.omerbinsaleem.com/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt;. LinkedIn: &lt;a href="https://www.linkedin.com/in/omer-bin-saleem/" rel="noopener noreferrer"&gt;omer-bin-saleem&lt;/a&gt; · Instagram: &lt;a href="https://www.instagram.com/iomerbinsaleem/" rel="noopener noreferrer"&gt;@iomerbinsaleem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written with AI assistance, from my own work notes.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>agents</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Your Claude Code sessions outlive the work. Who closes them?</title>
      <dc:creator>Omer Saleem</dc:creator>
      <pubDate>Thu, 12 Nov 2026 05:02:17 +0000</pubDate>
      <link>https://dev.to/omerbinsaleem/your-claude-code-sessions-outlive-the-work-who-closes-them-1jmk</link>
      <guid>https://dev.to/omerbinsaleem/your-claude-code-sessions-outlive-the-work-who-closes-them-1jmk</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.omerbinsaleem.com/hacks/idle-claude-sessions-need-a-reaper/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt; by Omer Bin Saleem (Omer Saleem).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;A usage report said most of my sessions had been open for more than eight hours. The fix was a small hourly job, and its first version had a timezone bug that would have closed nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to do it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Read what /usage is telling you before guessing. Mine showed 94% of sessions asking for /clear and 65% open for 8 hours or more, with 10 sessions alive and 9 editor tabs between 15 and 17 hours old.&lt;/li&gt;
&lt;li&gt;Check the suspect before blaming it. I assumed Remote Control was keeping the tabs alive, but only 2 of the 5 old idle tabs had a bridge at all. The real cause was simpler: an editor tab keeps its process alive until the tab closes, and Claude Code never closes an idle session by itself.&lt;/li&gt;
&lt;li&gt;Make the reaper narrow on purpose. Mine closes only editor sessions that are idle past a threshold and have no shell or Claude child process. It never touches launchd services, CLI, SDK or memory sessions, and /resume brings any closed session back, so the worst case is a reopen.&lt;/li&gt;
&lt;li&gt;Give it a --dry-run flag that prints every session with its keep or close reason, plus an --hours flag for the threshold. Run the dry run until each reason reads right, and only then let it close anything.&lt;/li&gt;
&lt;li&gt;Compare timestamps in one timezone. The session file records the process start in UTC, while ps -o lstart prints local time. Run ps with TZ=UTC. My first version missed this and would never have closed a single session.&lt;/li&gt;
&lt;li&gt;Schedule it with launchd, once an hour with a 4 hour threshold. Log only the sessions it closed, and send errors to a separate file so the log stays readable.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prompt to copy
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Write a Python script that lists my Claude Code sessions from ~/.claude/sessions/*.json and closes only editor sessions that have been idle longer than --hours (default 4) and have no shell or claude child process. Add a --dry-run flag that prints every session with a keep or close reason. The session files record procStart in UTC, so compare against ps run with TZ=UTC. Never touch launchd services, CLI or SDK sessions. Log closed sessions to one file and errors to another. Then write a launchd plist that runs the script every hour.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;I am Omer Bin Saleem, a frontend chapter lead who builds with AI every day. One practical AI hack a day at &lt;a href="https://www.omerbinsaleem.com/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt;. LinkedIn: &lt;a href="https://www.linkedin.com/in/omer-bin-saleem/" rel="noopener noreferrer"&gt;omer-bin-saleem&lt;/a&gt; · Instagram: &lt;a href="https://www.instagram.com/iomerbinsaleem/" rel="noopener noreferrer"&gt;@iomerbinsaleem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written with AI assistance, from my own work notes.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>agents</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Does your merge-request pipeline clone and build more than it reads?</title>
      <dc:creator>Omer Saleem</dc:creator>
      <pubDate>Wed, 11 Nov 2026 05:02:44 +0000</pubDate>
      <link>https://dev.to/omerbinsaleem/does-your-merge-request-pipeline-clone-and-build-more-than-it-reads-2gih</link>
      <guid>https://dev.to/omerbinsaleem/does-your-merge-request-pipeline-clone-and-build-more-than-it-reads-2gih</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.omerbinsaleem.com/hacks/trim-the-merge-request-pipeline/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt; by Omer Bin Saleem (Omer Saleem).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Last week our app's merge-request pipeline started cloning only what each job reads, skipping the build when no app code changed, and running related specs in four shards. A big merge request's tests now finish in about a third of the time.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to do it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Write down what each pipeline job actually opens. Change its clone so it fetches only those paths. A lint job for one app does not need the whole monorepo on disk.&lt;/li&gt;
&lt;li&gt;Make the build job look at the diff first. When no app code changed, for example only a spec or a pipeline file, skip the build and let lint and tests carry the merge request.&lt;/li&gt;
&lt;li&gt;Run only the specs related to the changed files, and split them across shards that run side by side. Our pipeline uses 4 shards. Match the count to the runners you have.&lt;/li&gt;
&lt;li&gt;Stop downloading tools the pipeline does not use. Our merge-request pipeline no longer downloads Cypress at all; the unit-test jobs ran fine without it.&lt;/li&gt;
&lt;li&gt;Give main the same pipeline as staging: lint, build and tests side by side, plus the nightly scripts. One pipeline definition is easier to trim than two that drift apart.&lt;/li&gt;
&lt;li&gt;Tell the team when a pipeline starts and when a shared branch is green again. In our merge-request channel each new merge request is announced as soon as its pipeline starts, even when its tests fail, and a follow-up says when main, staging or dev is green again.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prompt to copy
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Read my CI pipeline config at &amp;lt;path to .gitlab-ci.yml or workflow file&amp;gt;. For each job, list what files it reads, what it clones or downloads, and whether it still runs when only tests or pipeline files changed. Then propose four changes: a narrower clone per job, a rule that skips the build when no app code changed, a way to run only the specs related to the diff split across N shards, and the removal of any download no job needs. Show the config diff for each change and say in one line what it saves and what it risks.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;I am Omer Bin Saleem, a frontend chapter lead who builds with AI every day. One practical AI hack a day at &lt;a href="https://www.omerbinsaleem.com/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt;. LinkedIn: &lt;a href="https://www.linkedin.com/in/omer-bin-saleem/" rel="noopener noreferrer"&gt;omer-bin-saleem&lt;/a&gt; · Instagram: &lt;a href="https://www.instagram.com/iomerbinsaleem/" rel="noopener noreferrer"&gt;@iomerbinsaleem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written with AI assistance, from my own work notes.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>agents</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Which flag keeps claude -p from running your hooks?</title>
      <dc:creator>Omer Saleem</dc:creator>
      <pubDate>Tue, 10 Nov 2026 05:02:13 +0000</pubDate>
      <link>https://dev.to/omerbinsaleem/which-flag-keeps-claude-p-from-running-your-hooks-3mbn</link>
      <guid>https://dev.to/omerbinsaleem/which-flag-keeps-claude-p-from-running-your-hooks-3mbn</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.omerbinsaleem.com/hacks/claude-p-without-your-hooks/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt; by Omer Bin Saleem (Omer Saleem).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I wanted a scheduled claude -p job that only reads files. I tested which flags keep project hooks out while the subscription login keeps working.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Our weekly rules lint now runs four read-only claude -p passes with this flag set: one each for conflicts, stale lines, drift and duplicates.&lt;/li&gt;
&lt;li&gt;launchd runs it on Mondays, so nobody has to remember it.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to do it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Test before you trust a flag. Make a throwaway folder whose .claude/settings.json has a SessionStart hook that touches a file. Run claude -p there and check whether the file appears.&lt;/li&gt;
&lt;li&gt;Pass --setting-sources "" so no settings files load. On Claude Code 2.1.314 the hook did not run, and my subscription login still worked and returned an answer. With --setting-sources project, the hook ran.&lt;/li&gt;
&lt;li&gt;Skip --bare if you log in with a subscription. It reads only ANTHROPIC_API_KEY and never OAuth or the keychain, so it was unusable for me.&lt;/li&gt;
&lt;li&gt;Limit the run to reading: --tools Read,Grep,Glob with the same list in --allowedTools, plus --strict-mcp-config, --no-session-persistence and --output-format text.&lt;/li&gt;
&lt;li&gt;macOS has no timeout command. Wrap the call in perl -e 'alarm shift; exec @ARGV' . A killed run exits with code 142, so the script can check for that code.&lt;/li&gt;
&lt;li&gt;The stock macOS bash 3.2 cannot parse a heredoc inside $( ) when the text has a backtick. Load the prompt with IFS= read -r -d '' var &amp;lt;&amp;lt;'EOF' || true instead.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prompt to copy
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Write a bash script &lt;span class="k"&gt;for&lt;/span&gt; macOS that runs claude -p headless and read-only. Use exactly these flags: --tools Read,Grep,Glob --allowedTools Read,Grep,Glob --strict-mcp-config --setting-sources &lt;span class="s2"&gt;""&lt;/span&gt; --no-session-persistence --output-format text. Wrap the call &lt;span class="k"&gt;in&lt;/span&gt; perl -e &lt;span class="s1"&gt;'alarm shift; exec @ARGV'&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;SECONDS&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; and report &lt;span class="nb"&gt;exit&lt;/span&gt; code 142 as a timeout. Load the prompt with &lt;span class="nv"&gt;IFS&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;read&lt;/span&gt; -r -d &lt;span class="s1"&gt;''&lt;/span&gt; PROMPT &lt;span class="o"&gt;&amp;lt;&amp;lt;&lt;/span&gt;&lt;span class="s1"&gt;'EOF'&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; true, never a heredoc inside &lt;span class="nv"&gt;$(&lt;/span&gt; &lt;span class="o"&gt;)&lt;/span&gt;, because bash 3.2 breaks on backticks there. Then give me a test: a temp folder whose .claude/settings.json has a SessionStart hook that touches a file, and a check that the file was not created.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;I am Omer Bin Saleem, a frontend chapter lead who builds with AI every day. One practical AI hack a day at &lt;a href="https://www.omerbinsaleem.com/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt;. LinkedIn: &lt;a href="https://www.linkedin.com/in/omer-bin-saleem/" rel="noopener noreferrer"&gt;omer-bin-saleem&lt;/a&gt; · Instagram: &lt;a href="https://www.instagram.com/iomerbinsaleem/" rel="noopener noreferrer"&gt;@iomerbinsaleem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written with AI assistance, from my own work notes.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>agents</category>
      <category>webdev</category>
    </item>
    <item>
      <title>LinkedIn's composer has no file input. So where does the upload go?</title>
      <dc:creator>Omer Saleem</dc:creator>
      <pubDate>Mon, 09 Nov 2026 05:02:23 +0000</pubDate>
      <link>https://dev.to/omerbinsaleem/linkedins-composer-has-no-file-input-so-where-does-the-upload-go-25c3</link>
      <guid>https://dev.to/omerbinsaleem/linkedins-composer-has-no-file-input-so-where-does-the-upload-go-25c3</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.omerbinsaleem.com/hacks/upload-when-the-file-input-is-missing/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt; by Omer Bin Saleem (Omer Saleem).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Some web apps build their file input only at the moment you click, so an agent's upload tool finds nothing to fill. A small patch to one browser method gives it a target.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to do it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Look at the page before you automate it. LinkedIn's post composer keeps no file input in the DOM. It creates one when you press 'Choose file' and calls click() on it, which opens the system file picker, and an agent can't drive that dialog.&lt;/li&gt;
&lt;li&gt;Patch HTMLInputElement.prototype.click before you press the button. When the input being clicked is a file input, attach it to the page instead of opening the picker. Let every other input click as normal.&lt;/li&gt;
&lt;li&gt;Press 'Choose file' the way a person would. The app builds its input and calls click(), your patch catches the call, and the input now sits in the page where the agent can see it.&lt;/li&gt;
&lt;li&gt;Point the agent's file_upload tool at that input with your file path. That is how a 10-page PDF document post went up, and LinkedIn showed 'Post successful'. The upload tool takes at most 10 MB per call, so compress large files first.&lt;/li&gt;
&lt;li&gt;Keep a person on the last click. Show the caption and the first comment as a preview, and post only after an explicit yes.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prompt to copy
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;In the open tab, the upload button creates its file input only when clicked, so there is nothing to fill yet. Before you press it, run JavaScript that wraps HTMLInputElement.prototype.click: if this.type is 'file', append the input to document.body and return without opening the picker; otherwise call the original click. Then press the upload button, find the new file input, and use the file upload tool on it with [FILE PATH]. Check that the file shows in the composer. Do not post. Show me the caption and the preview, and wait for my yes.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;I am Omer Bin Saleem, a frontend chapter lead who builds with AI every day. One practical AI hack a day at &lt;a href="https://www.omerbinsaleem.com/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt;. LinkedIn: &lt;a href="https://www.linkedin.com/in/omer-bin-saleem/" rel="noopener noreferrer"&gt;omer-bin-saleem&lt;/a&gt; · Instagram: &lt;a href="https://www.instagram.com/iomerbinsaleem/" rel="noopener noreferrer"&gt;@iomerbinsaleem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written with AI assistance, from my own work notes.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>agents</category>
      <category>webdev</category>
    </item>
    <item>
      <title>My background agents went quiet for hours. Nothing had failed.</title>
      <dc:creator>Omer Saleem</dc:creator>
      <pubDate>Sun, 08 Nov 2026 05:02:07 +0000</pubDate>
      <link>https://dev.to/omerbinsaleem/my-background-agents-went-quiet-for-hours-nothing-had-failed-18dg</link>
      <guid>https://dev.to/omerbinsaleem/my-background-agents-went-quiet-for-hours-nothing-had-failed-18dg</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://www.omerbinsaleem.com/hacks/background-agents-hang-silently/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt; by Omer Bin Saleem (Omer Saleem).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Two background agents each sat on one command for about two and a half hours, with no error and no completion notice. Here is the brief rule and the silence check I use now.&lt;/p&gt;

&lt;h2&gt;
  
  
  What changed
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Every build brief now bans wait loops and rm -rf.&lt;/li&gt;
&lt;li&gt;Any agent quiet for about 30 minutes gets a timestamp check instead of more waiting.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to do it
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Know the failure mode. In a background agent, a command that needs a permission prompt, or a blocked foreground sleep, does not fail. It just waits forever. One of my agents stopped on &lt;code&gt;cp ... &amp;amp;&amp;amp; rm -rf ...&lt;/code&gt;, the other on &lt;code&gt;until ...; do sleep 5; done&lt;/code&gt;. Both looked like they were still working.&lt;/li&gt;
&lt;li&gt;Ban the risky shapes in every brief: no sleep, until or while wait loops, and no rm -rf. Plain rm on named files is allowed, so the agent can still clean up.&lt;/li&gt;
&lt;li&gt;Give long jobs a real ending. Run them in the foreground with a timeout, or with run_in_background and wait for its completion notification instead of polling in a loop.&lt;/li&gt;
&lt;li&gt;Check silence, do not trust it. If an agent has been quiet for more than about 30 minutes, grep the last "timestamp" in its output file and compare it with the file mtimes in its working folder.&lt;/li&gt;
&lt;li&gt;If both are stale, stop the agent and relaunch it with "continue from build-progress.md". This only works if the agent wrote a progress file as it went, so ask for one in the brief from the start.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Prompt to copy
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You are a background build agent. Follow these rules for every shell command:
- Never use sleep, until or while loops to wait for something.
- Never use rm -rf. Use plain rm on named files only.
- Run long jobs in the foreground with a timeout, or with run_in_background and wait for its completion notification.
- After each finished step, update build-progress.md with what is done, what is next and which files changed.
- If you are told "continue from build-progress.md", read it first and resume from the next step without redoing finished work.

Task: &amp;lt;describe the build here&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;p&gt;I am Omer Bin Saleem, a frontend chapter lead who builds with AI every day. One practical AI hack a day at &lt;a href="https://www.omerbinsaleem.com/" rel="noopener noreferrer"&gt;omerbinsaleem.com&lt;/a&gt;. LinkedIn: &lt;a href="https://www.linkedin.com/in/omer-bin-saleem/" rel="noopener noreferrer"&gt;omer-bin-saleem&lt;/a&gt; · Instagram: &lt;a href="https://www.instagram.com/iomerbinsaleem/" rel="noopener noreferrer"&gt;@iomerbinsaleem&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written with AI assistance, from my own work notes.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>claude</category>
      <category>agents</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
