Skip to content

Instantly share code, notes, and snippets.

@vladikk
vladikk / claude-code-modularity-review.md
Created April 1, 2026 11:56
Modularity review of Claude Code CLI source code using the Balanced Coupling model. Analyzes coupling patterns across the CLI, web app, and MCP server components.

Modularity Review

Scope: Entire codebase — CLI (src/), Web App (web/), MCP Server (mcp-server/) Date: 2026-04-01

Executive Summary

Claude Code is a terminal-native AI coding assistant that provides file editing, code search, shell execution, and LLM-powered workflows through a React/Ink CLI, an optional web interface, and an MCP server for tool discovery. The overall modularity status is healthy with targeted concerns. The three deployable units (CLI, web, MCP server) maintain clean physical boundaries with network-based integration. However, within the CLI monolith, several integration points exhibit tight coupling patterns — particularly where tools directly access service internals, where the tool execution service hardcodes tool-specific branching, and where tools implicitly depend on deeply nested AppState structures. These issues are concentrated in the highest-volatility areas (tool execution, permission management, agent or

Modularity Review

Scope: Full codebase — CloudFront redirect function, CRUD Lambdas, KVS Sync Lambda, Pre-Auth Lambda, React Admin UI, CloudFormation infrastructure Date: 2026-03-09

Coupling Overview Table

Integration Strength Distance Volatility Balanced?
functions/redirect.jstemplate.yaml (inline FunctionCode) Functional (duplicated code) Low (same repo, same person) Low No — low strength needed, low distance = low cohesion risk. But the duplication itself is the hazard.
# python3 readfstr.py input.epub output.epub
import argparse
from ebooklib import epub # pip install ebooklib
from bs4 import BeautifulSoup, NavigableString # pip install bs4
def make_half_word_bold(soup, text):
new_elements = []
for word in text.split():
n = len(word)
@vladikk
vladikk / ExecutionResult.cs
Created March 19, 2017 14:57
Command execution result object for CQRS based systems
using System;
namespace Example
{
public abstract class ExecutionResult
{
protected ExecutionResult(Guid aggregateId, Guid commandId, DateTime executedOn)
{
AggregateId = aggregateId;
CommandId = commandId;