The Focus AI logo

The Focus AI

Subscribe
Archives
March 28, 2025

Supercharge Your AI Coding Assistant with repomix

Hey AI enthusiasts! 👋

Today, I want to share a powerful tool that's become an essential part of my AI development workflow: repomix. If you've ever wished your AI coding assistant had better context about your entire project, this one's for you.

The Context Challenge

One of the biggest limitations when working with AI coding assistants is their limited context window. Sure, they can help with the code right in front of them, but what about understanding the bigger picture of your project?

That's where repomix comes in.

What is repomix?

repomix is a clever tool that creates a comprehensive summary of your entire codebase in a format that's perfect for feeding into LLMs. Think of it as creating a "project snapshot" that your AI assistant can quickly digest.

Getting Started

It's surprisingly simple to use. Just run:

npx repomix

This generates a repomix-output.txt file containing a well-organized overview of your project. You can then:

  1. Copy to clipboard: bash cat repomix-output.txt | pbcopy

  2. Feed it to Claude or GPT-4 Just paste the contents into your favorite AI assistant

  3. Use it with local models: bash cat repomix-output.txt | ollama run gemma3:12b "Tell me what you think about all of this"

Smart Features

repomix isn't just a file concatenator. It provides useful insights about your codebase:

  • Lists top 5 files by character and token count
  • Performs security checks for sensitive information
  • Gives you a total token count (crucial for API costs)
  • Provides a comprehensive project summary

Here's what the output looks like:

📈 Top 5 Files by Character Count and Token Count:
──────────────────────────────────────────────────
1.  warc-viewer.py (19,802 chars, 4,023 tokens)
2.  tests/test_app.py (14,737 chars, 3,165 tokens)
3.  src/warc_viewer/app.py (14,513 chars, 2,859 tokens)
4.  src/warc_viewer/cdx.py (13,997 chars, 2,672 tokens)
5.  tests/test_db.py (13,766 chars, 3,141 tokens)

Pro Tips

1. Customize What's Included

Don't want to include certain files? Use the --ignore flag:

npx repomix --ignore "**/*.json,**/*.ipynb,**/*.mdx"

2. Automate with mise

I've integrated repomix into my workflow using mise tasks:

[tasks.llm-dump]
description = 'Runs repomix'
run = ['repomix --ignore "output*,**/*.log,tmp/,inputs/**/*md,data_integrity/**/*.json"']

This makes it super easy to generate consistent project snapshots across different projects.

Why This Matters

When your AI assistant has full context of your project, you get: - More accurate code suggestions - Better understanding of your architecture - Fewer misunderstandings about dependencies - More relevant recommendations

Getting the Most Out of It

Here are some scenarios where repomix shines:

  1. Onboarding to a New Project: Give your AI assistant the full context before asking questions
  2. Architecture Discussions: Let the AI analyze your entire codebase structure
  3. Refactoring Planning: Get suggestions based on the complete picture
  4. Documentation Generation: Create comprehensive docs that understand all the moving parts

What's Next?

I'm excited to see how tools like repomix evolve to make AI coding assistants even more powerful. The ability to give AI a complete understanding of our projects is a game-changer for development workflows.

Have you tried repomix or similar tools? I'd love to hear about your experiences! Reply to this email and let me know how you're using AI to improve your development process.

Happy coding!


P.S. Want more AI development tips? Check out my other recipes for AI-powered development!

Don't miss what's next. Subscribe to The Focus AI:
GitHub X LinkedIn
This email brought to you by Buttondown, the easiest way to start and grow your newsletter.