đź§ź CodeCrypt: About the Project

đź’ˇ Inspiration

The inspiration for CodeCrypt came from a painful reality every developer has faced: the digital graveyard of open source.

We've all encountered it—you find the perfect library for your project, only to discover it hasn't been updated in years. The dependencies are ancient, the build fails with cryptic errors, and the community has moved on. Thousands of hours of collective knowledge, just... dead.

But what if we could bring these projects back to life?

The Kiroween hackathon's "Resurrection" theme sparked an idea: what if modernizing legacy code wasn't a tedious chore, but a dramatic, multi-sensory experience? What if we could visualize the code's history as a 3D city, hear its transformation as a musical symphony, and prove its resurrection with time-traveling validation?

Thus, CodeCrypt was born—an AI-powered necromancer for abandoned code.


🛠️ How We Built It

CodeCrypt is the ultimate Frankenstein project—a chimera of technologies stitched together to create something unexpectedly powerful:

The Architecture

  1. VS Code Extension Core

    • Built as a native TypeScript extension using the Kiro framework
    • Leverages Model Context Protocol (MCP) for external integrations
    • Event-driven architecture with hooks and real-time updates
  2. Hybrid Analysis Engine (The Brain)

    • AST Layer: Uses Babel and ts-morph for precise structural analysis
    • LLM Layer: Integrates both Anthropic Claude and Google Gemini for semantic understanding
    • Fusion: Combines deterministic syntax trees with AI-powered intent detection
  3. Resurrection Pipeline (The Heart)

    • Clones repositories and analyzes commit history
    • Intelligently updates dependencies with automated rollback on failure
    • Runs compilation checks and test suites after each transformation
    • Generates detailed resurrection reports with before/after metrics
  4. Multi-Sensory Experience Layer (The Soul)

    • 3D Ghost Tour: Three.js visualization rendering code as an interactive city
    • Live Dashboard: Chart.js metrics showing real-time progress
    • AI Narrator: Web Speech API providing audible commentary
    • Resurrection Symphony: Tone.js translating code quality into music
    • Time Machine: Docker containers validating original vs. modernized code

The Tech Stack

Frontend:  React + TypeScript + Three.js + Chart.js + Tone.js
Backend:   Node.js + Kiro Native Tool + MCP Servers
Analysis:  Babel + ts-morph + Anthropic/Gemini APIs
Validation: Docker + Dockerode
Integration: GitHub API + npm Registry + SSE

📚 What We Learned

1. The Power of Hybrid Approaches

Early on, we realized pure AST analysis was too rigid—it couldn't understand why code was written a certain way. Meanwhile, pure LLM analysis was unreliable for structural transformations. The breakthrough came when we combined them:

$$ \text{CodeUnderstanding} = \alpha \cdot \text{AST}{\text{structure}} + (1-\alpha) \cdot \text{LLM}{\text{semantics}} $$

Where $\alpha$ balances precision (AST) with context (LLM). This hybrid approach gave us the best of both worlds.

2. Legacy Code is a Minefield

We learned this the hard way:

  • Old package-lock.json files cause npm to fetch packages that no longer exist
  • Git dependencies pointing to ancient commits fail with modern Node.js
  • Native modules (like deasync) refuse to compile on new architectures
  • Peer dependency conflicts create cascading failures

Solution: Delete everything (node_modules, lockfiles) and start fresh with --legacy-peer-deps.

3. Real-Time Visualization is Hard

Synchronizing backend events with frontend updates required careful architecture:

  • Server-Sent Events (SSE) for low-latency streaming
  • Event categorization to prevent update storms
  • Debouncing chart updates to maintain 60 FPS
  • Time-series data structures for replay capabilities

4. Docker as a Time Machine

The most satisfying feature was "Time Machine Validation"—spinning up Docker containers with historical Node.js versions to run original code, then comparing it against the modernized version. It's proof-of-resurrection you can see.


đźš§ Challenges We Faced

Challenge #1: The Dependency Hell Paradox

Problem: To analyze dead code, we needed to install its dependencies. But those dependencies were also dead, creating a chicken-and-egg problem.

Solution: We flipped the script. Instead of trying to compile the original code, we:

  1. Classify repositories as "dead" based on commit history alone
  2. Delete all legacy artifacts (node_modules, lockfiles)
  3. Attempt resurrection without running the original code
  4. Use Docker to validate the original environment separately

Challenge #2: Making Code "Visible"

Problem: Code is abstract. How do you make modernization tangible?

Solution: Multi-sensory translation:

  • Code complexity → Building height in 3D city
  • Commit frequency → Hotspot highlighting
  • Test coverage → Musical harmony (higher coverage = more consonant)
  • Vulnerabilities → Dissonant tones
  • Progress → Animated charts

The result: stakeholders could see and hear technical debt disappearing.

Challenge #3: AST + LLM Fusion

Problem: AST analysis is fast but shallow. LLMs are deep but expensive. How do we combine them efficiently?

Solution: Staged analysis:

  1. AST scans the entire codebase (cheap, exhaustive)
  2. Identify "decision points" where semantics matter
  3. Send only those snippets to the LLM with AST context
  4. Merge insights into a unified "code understanding" model

This reduced LLM API costs by ~90% while maintaining semantic awareness.

Challenge #4: Event Orchestration

Problem: With 8+ different subsystems (backend, dashboard, 3D viz, narrator, symphony, Docker), keeping everything synchronized was chaos.

Solution: Event-driven architecture with typed events:

on_transformation_applied → MetricsPipeline
                          → AINarrator
                          → Dashboard
                          → Symphony
                          → GhostTour

Each component subscribes to relevant events, making the system decoupled and testable.


🎯 The Result

CodeCrypt transforms code modernization from a tedious chore into a cinematic experience:

  1. Visual: Watch the 3D city evolve as code is updated
  2. Audible: Hear AI narration explain each step
  3. Musical: Listen to the symphony shift from chaos to harmony
  4. Provable: See side-by-side validation in Docker containers

It's not just a tool—it's a show. And that's what makes CodeCrypt a true Frankenstein project: stitching together incompatible technologies into something unexpectedly powerful and unforgettable.


🏆 Future Work

  • Support for Python, Rust, and Go ecosystems
  • AI-powered automated code fixes beyond dependency updates
  • Community marketplace for resurrection "spells" (transformation templates)
  • Live streaming resurrections as Twitch-style events
  • Integration with CI/CD pipelines for continuous modernization

The dead code graveyard is vast. Let's bring it all back to life. 🧟✨

Built With

Share this project:

Updates