<?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>Forem: Cheolwan Park</title>
    <description>The latest articles on Forem by Cheolwan Park (@codingvillain).</description>
    <link>https://forem.com/codingvillain</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%2F3522135%2F06414c44-6af9-40f1-ad22-088f01c4b165.jpeg</url>
      <title>Forem: Cheolwan Park</title>
      <link>https://forem.com/codingvillain</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/codingvillain"/>
    <language>en</language>
    <item>
      <title>Find Useful Code Snippets in Seconds — For You and Your Coding Agents</title>
      <dc:creator>Cheolwan Park</dc:creator>
      <pubDate>Mon, 22 Sep 2025 14:17:25 +0000</pubDate>
      <link>https://forem.com/codingvillain/snippets-local-ai-powered-code-snippet-search-for-your-repos-1omb</link>
      <guid>https://forem.com/codingvillain/snippets-local-ai-powered-code-snippet-search-for-your-repos-1omb</guid>
      <description>&lt;p&gt;Have you ever wished your AI coding assistant actually &lt;em&gt;read your code&lt;/em&gt; instead of pretending it did?&lt;br&gt;
That was exactly my frustration.&lt;/p&gt;

&lt;p&gt;I often found myself repeating the same things to Claude:&lt;br&gt;
“Here’s that chunk of code I wrote before — please reuse it,”&lt;br&gt;
“This is how I used that library in another project,”&lt;br&gt;
“Follow this coding style, not the default one.”&lt;/p&gt;

&lt;p&gt;Sound familiar? 😅&lt;/p&gt;

&lt;p&gt;That’s why I hacked together something like a &lt;strong&gt;local version of Context7&lt;/strong&gt; — but one that actually digs into your &lt;strong&gt;source code&lt;/strong&gt;. I call it &lt;strong&gt;Snippets&lt;/strong&gt;, and I’d love for you to try it out and give me feedback.&lt;/p&gt;


&lt;h2&gt;
  
  
  🤔 Motivation
&lt;/h2&gt;

&lt;p&gt;Context7 is a neat tool, but I hit some walls with it:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;It mainly focuses on &lt;strong&gt;docs (&lt;code&gt;.md&lt;/code&gt; files)&lt;/strong&gt;, while I often need the &lt;em&gt;actual code&lt;/em&gt;.&lt;/li&gt;
&lt;li&gt;Yes, it supports &lt;strong&gt;private repos&lt;/strong&gt;, but only as a &lt;strong&gt;team feature&lt;/strong&gt;, and your data still gets stored on &lt;strong&gt;external servers&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;I wanted something &lt;strong&gt;local-first&lt;/strong&gt;: no uploads, no external storage, just me and my machine.&lt;/li&gt;
&lt;li&gt;Since Snippets relies on Claude Code itself to extract snippets, I suspect it’s both &lt;strong&gt;cheaper&lt;/strong&gt; and &lt;strong&gt;more accurate&lt;/strong&gt; for real-world usage.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The vision is simple:&lt;br&gt;
👉 Give your AI a &lt;strong&gt;searchable memory of code snippets&lt;/strong&gt; — your repos, your patterns, your style.&lt;/p&gt;


&lt;h2&gt;
  
  
  🔍 Context7 vs Snippets (at a glance)
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Context7&lt;/th&gt;
&lt;th&gt;Snippets (this project)&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Data focus&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Reads docs (&lt;code&gt;.md&lt;/code&gt; files)&lt;/td&gt;
&lt;td&gt;Reads actual source code&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Private repo support&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;✅ Yes, but looks like it may &lt;strong&gt;soon become a paid feature&lt;/strong&gt;
&lt;/td&gt;
&lt;td&gt;✅ Yes, works locally out-of-the-box&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Data storage&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Stored on external servers&lt;/td&gt;
&lt;td&gt;Stays entirely &lt;strong&gt;on your machine&lt;/strong&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Deployment&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Cloud-based&lt;/td&gt;
&lt;td&gt;Local Docker setup&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Opensource?&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Closed Source&lt;/td&gt;
&lt;td&gt;Yes, it is!&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


&lt;h2&gt;
  
  
  💡 What Snippets Can Do
&lt;/h2&gt;

&lt;p&gt;Here are a few practical ways I’m already using Snippets:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;AI memory for your projects&lt;/strong&gt;&lt;br&gt;
When Claude struggles with a task, feed it snippets from your past repos to give it context.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Dealing with bad documentation&lt;/strong&gt;&lt;br&gt;
Context7 can read .md docs, but when docs are missing or messy, Snippets lets you just add an example repo and search real code instead.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Style transfer&lt;/strong&gt;&lt;br&gt;
Index your repos and tell Claude: &lt;em&gt;“follow this coding style.”&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reusable snippet library&lt;/strong&gt;&lt;br&gt;
Collect helpers, utilities, and boilerplate patterns into a semantic, searchable database.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Expanding AI’s reach&lt;/strong&gt;&lt;br&gt;
Feed in &lt;strong&gt;Rust code, private company libraries, or niche frameworks&lt;/strong&gt; — things your AI doesn’t natively know well — and make it smarter.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  ⚡ Quick Start
&lt;/h2&gt;

&lt;p&gt;Getting Snippets running locally is straightforward.&lt;/p&gt;
&lt;h3&gt;
  
  
  1. Clone &amp;amp; Setup
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/cheolwanpark/snippets
&lt;span class="nb"&gt;cd &lt;/span&gt;snippets
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  2. Configure Environment
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cp &lt;/span&gt;docker/.env.example docker/.env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Add your &lt;strong&gt;Claude OAuth Token&lt;/strong&gt; and &lt;strong&gt;Gemini API key&lt;/strong&gt; in &lt;code&gt;docker/.env&lt;/code&gt;.&lt;br&gt;
&lt;strong&gt;Claude OAuth Token:&lt;/strong&gt; You can get one from &lt;code&gt;claude setup-token&lt;/code&gt; command!&lt;br&gt;
&lt;strong&gt;Gemini API key:&lt;/strong&gt; It is for Embedding. You can get one from &lt;a href="https://aistudio.google.com/app/apikey" rel="noopener noreferrer"&gt;Google AI Studio&lt;/a&gt;!&lt;/p&gt;
&lt;h3&gt;
  
  
  3. Launch with Docker
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd &lt;/span&gt;docker
docker-compose up &lt;span class="nt"&gt;-d&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;This spins up:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend&lt;/strong&gt; → &lt;a href="http://localhost:3000" rel="noopener noreferrer"&gt;http://localhost:3000&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API &amp;amp; MCP Server&lt;/strong&gt; → &lt;a href="http://localhost:8000" rel="noopener noreferrer"&gt;http://localhost:8000&lt;/a&gt; / &lt;a href="http://localhost:8080/mcp" rel="noopener noreferrer"&gt;http://localhost:8080/mcp&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Qdrant &amp;amp; Redis&lt;/strong&gt; → 6333 and 6379&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  4. Add Your First Repo
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Open &lt;code&gt;http://localhost:3000&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Paste a GitHub repo URL&lt;/li&gt;
&lt;li&gt;Hit &lt;strong&gt;Embed&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Once processing completes, you can search snippets in plain English!&lt;/li&gt;
&lt;/ul&gt;


&lt;h2&gt;
  
  
  🔗 Claude MCP Integration
&lt;/h2&gt;

&lt;p&gt;Hook it up to Claude Code via MCP:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;claude mcp add &lt;span class="nt"&gt;--transport&lt;/span&gt; http snippets http://localhost:8080/mcp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now you can literally ask Claude things like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;search error handling patterns in Python. use snippets.
search JWT authentication middleware. use snippets.
search async database queries in Rust. use snippets.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Instead of vague memory, Claude pulls real snippets directly from your repos.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧭 Why Bother?
&lt;/h2&gt;

&lt;p&gt;At the end of the day, here’s what I want:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Not just &lt;code&gt;.md&lt;/code&gt; docs, but &lt;strong&gt;real code&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Not just cloud tools, but &lt;strong&gt;local-first and private by design&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Not just “AI magic,” but &lt;strong&gt;a searchable library of my own snippets&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Snippets is still early, but it’s a step toward “AI that actually understands your context.”&lt;/p&gt;




&lt;h2&gt;
  
  
  🙌 Feedback Wanted
&lt;/h2&gt;

&lt;p&gt;I’d love your thoughts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Does this help in your workflow?&lt;/li&gt;
&lt;li&gt;What features would you like to see added?&lt;/li&gt;
&lt;li&gt;Any setup/usage pain points?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;👉 &lt;a href="https://github.com/cheolwanpark/snippets" rel="noopener noreferrer"&gt;Check out the repo here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let’s make our coding assistants a little smarter — together.&lt;/p&gt;

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