<?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: spa</title>
    <description>The latest articles on DEV Community by spa (@spa335l).</description>
    <link>https://dev.to/spa335l</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%2F4170099%2F425ac503-90c1-403f-b81d-0887110d060f.webp</url>
      <title>DEV Community: spa</title>
      <link>https://dev.to/spa335l</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/spa335l"/>
    <language>en</language>
    <item>
      <title>My coding agent now tells me to go outside, and a 4 GB Gemma writes the message</title>
      <dc:creator>spa</dc:creator>
      <pubDate>Thu, 08 Oct 2026 03:27:18 +0000</pubDate>
      <link>https://dev.to/spa335l/my-coding-agent-now-tells-me-to-go-outside-and-a-4-gb-gemma-writes-the-message-531p</link>
      <guid>https://dev.to/spa335l/my-coding-agent-now-tells-me-to-go-outside-and-a-4-gb-gemma-writes-the-message-531p</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/hacktoberfest-week1-2026-10-05"&gt;Hacktoberfest Open-Source AI Challenge: Week 1&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;You send one more prompt. The agent answers. You send another.&lt;/p&gt;

&lt;p&gt;Then you look at the clock and two hours are gone, your water glass is empty, and you have not looked at anything farther away than your monitor.&lt;/p&gt;

&lt;p&gt;A timer is easy to dismiss. It fires in the middle of a thought, and it says the same thing every time. I wanted something that speaks up at the one moment I am already waiting, and says something I have not read a hundred times.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;agent-recess&lt;/strong&gt; is a hook for Claude Code and Codex CLI. It measures how long you have been pairing with your agent. After 90 minutes, when the agent finishes a reply, it suggests a break.&lt;/p&gt;

&lt;p&gt;The suggestion is written by Gemma 4 running on your own machine through Ollama, and it matches the weather outside your window.&lt;/p&gt;

&lt;p&gt;On a clear afternoon:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;🌿 Hey, you've been deep in the code for 94 minutes! Take a quick 10-minute walk outside
to get some fresh air and enjoy that clear sky. Go find a corner shop or just take a
moment to look up at the clouds.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;When it rains:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;🌿 You've been coding for 94 minutes! Since it's a bit wet out, take a quick 10-minute
breather right where you are. Pop a window open, do some big stretches, and grab a
refill of water to reset your eyes.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;The whole screen part is three sentences. After that, the tool wants you gone.&lt;/p&gt;

&lt;p&gt;A few rules keep it from becoming one more thing to dismiss:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A gap of 15 minutes counts as a break and resets the streak.&lt;/li&gt;
&lt;li&gt;It only speaks when the agent has finished. It never blocks a tool call or a reply.&lt;/li&gt;
&lt;li&gt;After one suggestion it stays quiet for 30 minutes.&lt;/li&gt;
&lt;li&gt;Sessions in different terminals, and different agents, share one streak.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzh724lqo4dnnrqj8f2b3.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzh724lqo4dnnrqj8f2b3.gif" alt="Terminal recording: agent-recess status shows a 94-minute streak, then agent-recess preview prints the prompt sent to Gemma and the break suggestion it wrote"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That is a real run on my machine at 22:40 on a clear night. Gemma answered in about two seconds.&lt;/p&gt;

&lt;p&gt;You can try the generation without installing any hook:&lt;br&gt;
&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ollama pull gemma4:e2b-it-qat
npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; github:spa77k/agent-recess
agent-recess preview 94
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;code&gt;preview&lt;/code&gt; prints the exact prompt that went to the model, then the suggestion that came back.&lt;/p&gt;
&lt;h3&gt;
  
  
  I took its advice
&lt;/h3&gt;

&lt;p&gt;I registered the hook in Claude Code and went back to work. At 12:05 pm, 95 minutes into refactoring a Discord bot, the agent finished a reply and this appeared under it:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;🌿 Hey, you've been locked in for 90 minutes! Time for a quick reset. Take a five to fifteen minute break right now to stand up, stretch, and get some fresh air.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;So I did what it said. I walked to a park near my home and sat there for a while, staring at nothing in particular. I came back feeling better than when I left.&lt;/p&gt;

&lt;p&gt;That is the whole feature. The tool spoke for three sentences, and the park did the rest.&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/spa77k" rel="noopener noreferrer"&gt;
        spa77k
      &lt;/a&gt; / &lt;a href="https://github.com/spa77k/agent-recess" rel="noopener noreferrer"&gt;
        agent-recess
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A Claude Code / Codex hook that notices long coding sessions and suggests a break, written by local Gemma 4 with the real weather.
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;agent-recess&lt;/h1&gt;
&lt;/div&gt;

&lt;p&gt;English | &lt;a href="https://github.com/spa77k/agent-recess/README.ja.md" rel="noopener noreferrer"&gt;日本語&lt;/a&gt; | &lt;a href="https://github.com/spa77k/agent-recess/README.ko.md" rel="noopener noreferrer"&gt;한국어&lt;/a&gt; | &lt;a href="https://github.com/spa77k/agent-recess/README.zh-CN.md" rel="noopener noreferrer"&gt;简体中文&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;A hook for Claude Code and Codex CLI that notices when you've been pairing with your coding agent for too long — and tells you to go touch grass.&lt;/p&gt;

&lt;p&gt;The suggestion is written on your own machine by &lt;strong&gt;Gemma 4 running in Ollama&lt;/strong&gt;, and it fits the actual weather outside:&lt;/p&gt;

&lt;p&gt;On a clear afternoon:&lt;/p&gt;

&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;🌿 Hey, you've been deep in the code for 94 minutes! Take a quick 10-minute walk outside
to get some fresh air and enjoy that clear sky. Go find a corner shop or just take a
moment to look up at the clouds
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;When it rains:&lt;/p&gt;
&lt;div class="snippet-clipboard-content notranslate position-relative overflow-auto"&gt;&lt;pre class="notranslate"&gt;&lt;code&gt;🌿 You've been coding for 94 minutes! Since it's a bit wet out, take a quick 10-minute
breather right where you are. Pop a window open, do some big stretches, and grab a
refill of water to reset your eyes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;How&lt;/h2&gt;…&lt;/div&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/spa77k/agent-recess" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;



&lt;p&gt;It is plain Node.js with zero dependencies. The streak logic is one pure function, so the tests run without a clock, a network or a model.&lt;/p&gt;

&lt;h2&gt;
  
  
  How I Built It
&lt;/h2&gt;

&lt;h3&gt;
  
  
  The hook
&lt;/h3&gt;

&lt;p&gt;Both agents call a command at fixed points in a session and pass JSON on stdin. agent-recess listens to two of them:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Event&lt;/th&gt;
&lt;th&gt;What agent-recess does&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;UserPromptSubmit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Records the time&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Stop&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Records the time and, if a break is due, returns a message&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The state is one small JSON file in &lt;code&gt;~/.agent-recess/&lt;/code&gt;. On a normal turn the hook reads it, writes it and exits in about 30 ms.&lt;/p&gt;

&lt;p&gt;One detail is easy to miss. Codex rejects plain text on stdout for &lt;code&gt;Stop&lt;/code&gt;, and Claude Code feeds plain text from &lt;code&gt;UserPromptSubmit&lt;/code&gt; straight into the model's context. So the hook always prints JSON, even when it has nothing to say. In that case it prints &lt;code&gt;{}&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  The model
&lt;/h3&gt;

&lt;p&gt;My first pick was &lt;code&gt;gemma4:e4b&lt;/code&gt;. Ollama pulled a 9.5 GB build, and on my 16 GB Mac it took 78 seconds to produce 7 tokens. Nobody waits 78 seconds to be told to stand up.&lt;/p&gt;

&lt;p&gt;I switched to &lt;code&gt;gemma4:e2b-it-qat&lt;/code&gt;, which is 4.3 GB. The first call after a cold start takes about 7 seconds. Every call after that takes 1 to 3 seconds.&lt;/p&gt;

&lt;h3&gt;
  
  
  The part where Gemma sent me into the rain
&lt;/h3&gt;

&lt;p&gt;My first prompt listed both options and let the model choose. Walk outside if it is dry, stay in if it is wet.&lt;/p&gt;

&lt;p&gt;With rain in the weather data, this is what came back:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Since it is dark and rainy outside, take a 10-minute break to step outside and just watch the rain and the sky.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Poetic, but no.&lt;/p&gt;

&lt;p&gt;The fix was to stop asking a small model to make the decision. Code now looks at the weather and picks indoors or outdoors. The model only gets the option that applies, and its job is the wording. Decisions went to the code and voice went to the model. In every weather case I have tried since, the suggestion has matched.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the model sees
&lt;/h3&gt;

&lt;p&gt;This is the full prompt for a dry night. There is nothing else.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;You write break reminders for a software developer who has been pairing with an AI coding agent.
They have been at it for 94 minutes without a real break. Local time: 22:30.
Weather: clear sky, 18.2°C (feels like 17.4°C), precipitation 0 mm, wind 4.6 km/h, dark outside, sunset at 17:16.

Suggest one concrete break: it is dry but dark — a few minutes of night air at the door or on the balcony, or a stretch indoors.
Keep it to 1-3 short sentences, warm and a little playful, no lists, no markdown, no emoji.
Mention the minutes once. Say how long the break should be (5-15 minutes).
Write in English.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;No code, no prompts, no file names. The hook never opens the transcript.&lt;/p&gt;

&lt;p&gt;Weather comes from &lt;a href="https://open-meteo.com/" rel="noopener noreferrer"&gt;Open-Meteo&lt;/a&gt;, which needs no API key. The only thing that leaves your machine is the latitude and longitude you put in the config file. If you set none, the suggestion simply ignores the weather.&lt;/p&gt;

&lt;p&gt;If Ollama is not running, or does not answer in 12 seconds, you get a fixed sentence instead. A break reminder that hangs your terminal would defeat the point.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Does Open Innovation Matter?
&lt;/h2&gt;

&lt;p&gt;This tool watches how long you work. That is exactly the kind of data I do not want to send to someone else's server so it can tell me to drink water.&lt;/p&gt;

&lt;p&gt;With open weights, it never has to. The model sits on my disk and the prompt stays on my machine. There is no API key to set up and no cost per reminder, so the tool can afford to say something new every time.&lt;/p&gt;

&lt;p&gt;Open weights also let me pick the size. The 9.5 GB build was unusable on my laptop, and the 4.3 GB one answers in two seconds. With a closed API I would get whichever model the provider runs. Here it is one line in a config file, and you can point it at any other model Ollama serves.&lt;/p&gt;

&lt;p&gt;The same goes for the rest of the stack. The weather is open data. The hook formats in Claude Code and Codex are documented, which is why one small script can serve both.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;Run &lt;code&gt;agent-recess preview&lt;/code&gt; once and read what your own machine writes for today's weather. If you like the tone, the hook config for both agents is in the &lt;a href="https://github.com/spa77k/agent-recess#install" rel="noopener noreferrer"&gt;README&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Then close the laptop for ten minutes.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>hf26challenge</category>
      <category>ai</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
