willworth.dev
View RSS feed

Trigram Code Atlas

Published on

In the rapidly evolving landscape of AI-assisted development, the ability to bridge our codebases with Large Language Models (LLMs) has become increasingly important. Today, I'm excited to share a tool I've built that does exactly that: Trigram Code Atlas (TCA).

What is Trigram Code Atlas?

TCA is a command-line tool written in Go that indexes codebases using trigrams, making them readily digestible for AI tools like Grok and Claude. The core idea is simple but powerful: analyze your codebase and create a structured, AI-friendly output that can be used for enhanced context and understanding.

Why Trigrams?

Trigram analysis, which breaks text into three-character sequences, provides an efficient way to index and search through code. This approach allows for:

  • Fuzzy matching capabilities
  • Language-agnostic analysis
  • Efficient pattern recognition
  • Compact representation of code structures

Key Features

The tool currently supports:

  • Multi-language source file indexing (Go, JavaScript, TypeScript, and more)
  • Intelligent file filtering (ignoring binaries, .git, node_modules, etc.)
  • Custom exclusion patterns via .tcaignore
  • Concurrent file processing using Go's goroutines
  • JSON atlas generation for easy integration with other tools

The Development Experience

What's particularly exciting about this project is the development velocity enabled by modern AI tools. From initial concept to working prototype to published release, the entire process took just one day. This rapid development cycle was possible thanks to:

  • Go's excellent standard library
  • Clear project scope and requirements
  • AI-assisted development workflow
  • Modern tooling and deployment platforms

Future Directions

While the current version focuses on creating LLM-friendly output, there are several exciting possibilities on the horizon:

  • Integration with the Model Context Protocol (MCP)
  • Enhanced search capabilities
  • Real-time codebase analysis
  • AI agent integration possibilities

Try It Yourself

The project is open-source and available on GitHub.

Installation is straightforward with Go:

go install github.com/willworth/trigram-code-atlas@v0.1.0

Conclusion

The intersection of AI and development tools is creating exciting opportunities for enhanced productivity and understanding. While tools like TCA are just the beginning, they represent a step toward more intelligent, context-aware development environments.

I'm thrilled with what's been achieved so far and excited about the potential for future enhancements. Whether you're interested in AI-assisted development, code analysis tools, or Go development, I encourage you to check out the project and contribute your ideas.