<?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: Prajwal Ashok Hulle</title>
    <description>The latest articles on DEV Community by Prajwal Ashok Hulle (@prajwalx25).</description>
    <link>https://dev.to/prajwalx25</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.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3961137%2F94d79442-fb76-49f7-b5fb-6ebaee5b7724.png</url>
      <title>DEV Community: Prajwal Ashok Hulle</title>
      <link>https://dev.to/prajwalx25</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/prajwalx25"/>
    <language>en</language>
    <item>
      <title>I built a time-decaying knowledge graph for my terminal — here's how it works</title>
      <dc:creator>Prajwal Ashok Hulle</dc:creator>
      <pubDate>Sun, 31 May 2026 12:15:25 +0000</pubDate>
      <link>https://dev.to/prajwalx25/i-built-a-time-decaying-knowledge-graph-for-my-terminal-heres-how-it-works-44nk</link>
      <guid>https://dev.to/prajwalx25/i-built-a-time-decaying-knowledge-graph-for-my-terminal-heres-how-it-works-44nk</guid>
      <description>&lt;h1&gt;
  
  
  TerminalPulse — Automatic Context Capture for AI-Assisted Debugging
&lt;/h1&gt;

&lt;p&gt;Every time I used Claude or ChatGPT to fix a bug, I went through the same ritual:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read the traceback&lt;/li&gt;
&lt;li&gt;Copy the error&lt;/li&gt;
&lt;li&gt;Switch to AI chat&lt;/li&gt;
&lt;li&gt;Explain my project, branch, and current file&lt;/li&gt;
&lt;li&gt;Paste relevant code&lt;/li&gt;
&lt;li&gt;Wait for a response&lt;/li&gt;
&lt;li&gt;Switch back to the terminal&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;That's a surprising amount of friction repeated dozens of times per week.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;TerminalPulse&lt;/strong&gt; — a background daemon that continuously captures development context and makes it instantly available when something breaks.&lt;/p&gt;

&lt;p&gt;When a command fails:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pulse fix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The context is already there.&lt;/p&gt;




&lt;h2&gt;
  
  
  Core Idea
&lt;/h2&gt;

&lt;p&gt;TerminalPulse builds a time-decaying context graph from three event streams:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Focus&lt;/strong&gt; — active file in VS Code&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Activity&lt;/strong&gt; — recently modified files&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Distress&lt;/strong&gt; — failed terminal commands&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Each event receives a heat score:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;heat = e^(-λ × age_seconds) × severity
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;where:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;λ = decay constant&lt;/li&gt;
&lt;li&gt;age_seconds = current_time - event_time&lt;/li&gt;
&lt;li&gt;severity = importance weight of the event&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Older events naturally fade away while recent events remain highly ranked.&lt;/p&gt;

&lt;p&gt;The goal is to provide AI tools with the context that is relevant now, rather than a large amount of stale project history.&lt;/p&gt;




&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;VS Code (Windows) → HTTP:7077  ─┐
Terminal errors   → Unix socket ─┼─→ pulsed daemon
File saves        → watchdog   ─┘

pulsed daemon
    ↓
~/.devpulse_state.json
    ↓
pulse fix
    ↓
TerminalMind / AI Provider
    ↓
Suggested Fix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The daemon is implemented as a long-running Python asyncio process containing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Unix socket server for shell-hook events&lt;/li&gt;
&lt;li&gt;HTTP server for editor-focus events&lt;/li&gt;
&lt;li&gt;Filesystem watchdog for file activity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Shell integration is intentionally lightweight.&lt;/p&gt;

&lt;p&gt;A small bash hook runs after failed commands and sends a compact JSON payload to the daemon through a Unix socket without re-executing anything.&lt;/p&gt;




&lt;h2&gt;
  
  
  Windows ↔ WSL Bridge
&lt;/h2&gt;

&lt;p&gt;I primarily develop using Windows 11 + WSL Ubuntu.&lt;/p&gt;

&lt;p&gt;One challenge was transferring editor focus information from Windows into a daemon running inside WSL.&lt;/p&gt;

&lt;p&gt;The solution:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Poll &lt;code&gt;GetForegroundWindow()&lt;/code&gt; on Windows&lt;/li&gt;
&lt;li&gt;Extract the filename from the VS Code title bar&lt;/li&gt;
&lt;li&gt;Send focus updates over HTTP&lt;/li&gt;
&lt;li&gt;Store them as graph events inside the daemon&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This keeps focus tracking independent of VS Code extensions.&lt;/p&gt;




&lt;h2&gt;
  
  
  Example Workflow
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;python3 server.py

&lt;span class="c"&gt;# KeyError: 'user_id'&lt;/span&gt;

⚡ Error detected. Run &lt;span class="s1"&gt;'pulse fix'&lt;/span&gt; to auto-fix.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pulse fix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;can automatically gather:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Project type&lt;/li&gt;
&lt;li&gt;Current git branch&lt;/li&gt;
&lt;li&gt;Recent commits&lt;/li&gt;
&lt;li&gt;Recently modified files&lt;/li&gt;
&lt;li&gt;Relevant source files&lt;/li&gt;
&lt;li&gt;Error traceback&lt;/li&gt;
&lt;li&gt;Active editor context&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;before sending the request to an AI workflow.&lt;/p&gt;




&lt;h2&gt;
  
  
  Pattern Detection
&lt;/h2&gt;

&lt;p&gt;TerminalPulse also keeps historical event statistics.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pulse insights
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Example output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Recurring failure:
python3 server.py

Occurrences: 4
Failure rate: 80%

Suggestion:
Consider adding automated tests around authentication logic.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The goal is to identify repeated development bottlenecks rather than only fixing individual failures.&lt;/p&gt;




&lt;h2&gt;
  
  
  Commands
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pulse watch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Auto-detect project and start monitoring.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pulse fix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Generate context and launch AI-assisted debugging.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pulse context
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy ranked context for ChatGPT, Claude, or Cursor.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pulse insights
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Analyze recurring failure patterns.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pulse report
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Generate an end-of-day development summary.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pulse mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Expose context through an MCP server.&lt;/p&gt;




&lt;h2&gt;
  
  
  Installation
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;terminalpulse
pip &lt;span class="nb"&gt;install &lt;/span&gt;terminalmind

tmind auth
pulse install-deps
pulse init

&lt;span class="nb"&gt;source&lt;/span&gt; ~/.bashrc

&lt;span class="nb"&gt;cd &lt;/span&gt;your-project
pulse watch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Current status:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Python implementation&lt;/li&gt;
&lt;li&gt;Asyncio-based daemon architecture&lt;/li&gt;
&lt;li&gt;Windows + WSL support&lt;/li&gt;
&lt;li&gt;MCP integration&lt;/li&gt;
&lt;li&gt;29 passing unit tests&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;GitHub:&lt;br&gt;
&lt;a href="https://github.com/prajwal-2509/terminalpulse" rel="noopener noreferrer"&gt;https://github.com/prajwal-2509/terminalpulse&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;PyPI:&lt;br&gt;
&lt;a href="https://pypi.org/project/terminalpulse/" rel="noopener noreferrer"&gt;https://pypi.org/project/terminalpulse/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I'd appreciate feedback on the architecture, event-ranking model, and any edge cases or failure modes that come to mind.&lt;/p&gt;

</description>
      <category>python</category>
      <category>opensource</category>
      <category>ai</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
