SynapseCode banner
nosleepman1 nosleepman1

SynapseCode

AI community

Description

Ultra-fast Code Graph & AST Pruning MCP Server for LLMs. Reduces context token consumption by 75%-90% in Claude, Cursor & AI Coding Agents.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

SynapseCode

**High-Performance AST Code Graph & Context Optimization Engine for Large Language Models**

SynapseCode reduces context token consumption by 75% to 90% when interacting with LLMs such as Claude 3.5 Sonnet, GPT-4, and autonomous coding agents via the Model Context Protocol (MCP).

![SynapseCode Architecture](assets/synapse_architecture_banner.jpg)

[![Go Version](https://img.shields.io/badge/Go-1.22+-00ADD8?style=flat-square&logo=go)](https://golang.org) [![Protocol](https://img.shields.io/badge/Protocol-Model%20Context%20Protocol-8A2BE2?style=flat-square)](https://modelcontextprotocol.io) [![License](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](LICENSE) [![CI](https://img.shields.io/badge/CI-Passing-brightgreen?style=flat-square)](https://github.com/nosleepman1/SynapseCode/actions)


1. Problem Statement

When using AI code assistants, injecting full raw source files or dumping repository trees consumes tens to hundreds of thousands of tokens per prompt.

This creates three critical engineering bottlenecks:

  1. Financial Cost: High token consumption multiplies API usage bills.
  2. Latency: Time-to-first-token (TTFT) degrades significantly with large prompt payloads.
  3. Context Degradation: Unnecessary implementation details dilute the attention of the model, increasing hallucination rates (Lost in the Middle phenomenon).

2. Technical Solution

SynapseCode continuously analyzes your codebase into an in-memory directed dependency graph:

  • AST Extraction: Extracts symbol declarations, types, interfaces, and signatures without full function bodies.
  • Multi-Edge Dependency Graph: Maps relations including CALLS, IMPORTS, DEFINES, IMPLEMENTS, and EXTENDS.
  • Personalized PageRank (PPR): Calculates centrality and relevance scores seeded by user task terms.
  • Knapsack Token Budgeting: Selects target implementations and direct 1-hop dependency skeletons under a strict token budget (e.g.,