Mergy: A Quick Tool for Claude Projects

Mergy: A Quick Tool for Claude Projects

Hey folks! I wanted to share a project I put together for the Build with Claude contest in June 2024. Anthropic challenged developers to create something using their API in just two weeks, with a chance to win $10k in API credits.

What is Mergy?

Mergy is a browser extension that combines and optimizes GitHub repository contents into a single text file. It's designed to work with Claude, an AI assistant. Here's what it does:

  1. When you visit a GitHub repository, Mergy can fetch all the files.
  2. It combines these files into one text document.
  3. The extension optimizes the content to use fewer tokens, which is important for AI processing.
  4. You can then upload this combined file to Claude Projects.

This tool helps developers quickly give Claude context about an entire codebase, making it easier to work with AI on programming tasks.

The Problem

While working on a .NET SDK for Claude, I kept running into a common issue. Whenever you start a new project or use a new library, Claude doesn't know your codebase. Claude Projects lets you upload code for context, but there were a few annoyances:

  1. Some files are unnecessarily large.
  2. Empty spaces waste valuable tokens.
  3. Manually selecting and optimizing files is tedious.

The Solution

I decided to create Mergy to solve this problem. The idea was to scan a folder, collect relevant files, filter them based on rules, and create a single optimized file for Claude Projects. With Claude's help, I put together a basic console application in about half a day.

Making It More Accessible

The console app worked, but it wasn't very user-friendly. Users would need to clone a project and download an app just to use it. So, I decided to turn Mergy into a browser extension instead. This would make it easier for people to use, regardless of their operating system.

Design and Development

For the extension's look, I tried to match Claude AI's style. I used Midjourney to create some simple icons for settings, sync, and download, with a bit of tweaking in Photoshop. They're not professional-grade, but they do the job.

One interesting aspect of this project was how much I built with Claude's assistance. Almost all of the code was written with Claude's help. I only had to code manually when I hit Claude's usage limit. It felt a bit like going back to the "old school" way of programming.

Creating a Client App: Mergy in Action

I decided to take Mergy a step further by creating a client app. This would allow people to use the knowledge via API instead of just through Claude Projects. And this is where things got really interesting.

Here's the cool part: I used Mergy itself to download knowledge about its own source code, as well as the Betalgo Ranul Anthropic .NET SDK. Then, I asked Claude to create a .NET client app for me based on this knowledge. And you know what? It worked surprisingly well!

This was a real-world test for Mergy, and it held up nicely. It was pretty satisfying to see the tool I built being used to create something new. The fact that Claude could understand the codebase well enough to generate a functional client app was a good indication of the potential of this approach.

I think this was a neat demonstration of Mergy's capabilities. It wasn't just a theoretical tool anymore - I actually needed to use the extension in a real-world scenario, and it delivered. This experience helped validate the concept behind Mergy and showed its practical value in AI-assisted development.

What's Next?

Mergy is now available on GitHub, free and open-source. It's a small project, but it might save you some time when preparing code for Claude Projects or, as I've discovered, for other AI-assisted coding tasks.

This project was an interesting way to explore AI-assisted development. It's far from perfect, but it was a good challenge to work on. If nothing else, it shows how AI tools like Claude can help even in the process of building tools for AI integration.

If you're working with Claude Projects or looking to leverage AI in your development process, give Mergy a try. It might make your workflow a bit smoother. And if you see room for improvement, contributions are always welcome!

Who knows? You might end up using it to build something interesting, just like I did with the client app. The possibilities are pretty exciting.

Wrapping Up

After getting the main functionality working, I made a quick demo video and wrote this blog post.



Github Mergy: betalgo/Mergy (github.com)

Github Mergy Client: betalgo/MergyClient: (github.com)