# siddharthm2416/codecheck architecture

> Architecture diagram of the GitHub repository siddharthm2416/codecheck, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/siddharthm2416/codecheck
- Repository: https://github.com/siddharthm2416/codecheck

## Overview

CodeCheck indexes Python, Java, and JavaScript repositories, then lets users scan for untested code or ask grounded codebase questions, draft tests, and generate convention-aware code. The main path runs from the Streamlit UI or CLI through an agent and MCP tools to indexed chunks or source files. Indexing walks files, extracts AST chunks, links likely tests, embeds them, and stores them in ChromaDB. The README documents the broader capabilities; some implementation details are unsampled, so omitted relationships are not inferred.

Main entry points: [`index_repo.py`](https://github.com/siddharthm2416/codecheck/blob/main/index_repo.py) (Index builder), [`walker.py`](https://github.com/siddharthm2416/codecheck/blob/main/walker.py) (File walker), [`app.py`](https://github.com/siddharthm2416/codecheck/blob/main/app.py) (Streamlit UI), [`mcp_server.py`](https://github.com/siddharthm2416/codecheck/blob/main/mcp_server.py) (MCP tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_indexing["Repository indexing"]
  node_walker["File walker<br/>[walker.py]"]
  node_chunkmodel["Chunk model<br/>[base.py]"]
  node_pythonchunks["Python chunker<br/>[python_chunker.py]"]
  node_javachunks["Java chunker<br/>[java_chunker.py]"]
  node_jschunks["JavaScript chunker<br/>[js_chunker.py]"]
  node_testlink["Test linkage<br/>[test_linkage.py]"]
  node_indexer["Index builder<br/>[index_repo.py]"]
  node_embedder["Text embeddings"]
end

subgraph group_query["Retrieval tools"]
  node_chroma[("ChromaDB index")]
  node_retrieval["Retrieval functions<br/>[retrieval.py]"]
  node_mcp["MCP tools<br/>[mcp_server.py]"]
end

subgraph group_agents["Agent runtime"]
  node_provider["Provider adapters<br/>[providers.py]"]
  node_multiagent["Multi-provider agent<br/>[agent_multi.py]"]
  node_claudeagent["Claude agent<br/>[agent.py]"]
end

subgraph group_interface["User interfaces"]
  node_streamlit["Streamlit UI<br/>[app.py]"]
  node_cli["CLI<br/>[agent_multi.py]"]
end

node_user(("User"))
node_repo[("Target repository")]

node_user -->|"uses"| node_streamlit
node_user -->|"runs"| node_cli
node_repo -->|"indexes"| node_indexer
node_indexer -->|"walks files"| node_walker
node_walker -->|"dispatches"| node_pythonchunks
node_walker -->|"dispatches"| node_javachunks
node_walker -->|"dispatches"| node_jschunks
node_pythonchunks -->|"creates chunks"| node_chunkmodel
node_javachunks -->|"creates chunks"| node_chunkmodel
node_jschunks -->|"creates chunks"| node_chunkmodel
node_indexer -->|"links tests"| node_testlink
node_indexer -->|"embeds chunks"| node_embedder
node_indexer -->|"stores vectors"| node_chroma
node_embedder -->|"supplies vectors"| node_chroma
node_mcp -->|"calls tools"| node_retrieval
node_retrieval -->|"queries"| node_chroma
node_retrieval -->|"reads source"| node_repo
node_streamlit -->|"starts indexing"| node_indexer
node_streamlit -->|"checks freshness"| node_walker
node_streamlit -->|"runs agent"| node_multiagent
node_cli -->|"connects tools"| node_mcp
node_multiagent -->|"calls tools"| node_mcp
node_multiagent -->|"uses adapters"| node_provider
node_claudeagent -.->|"uses tools"| node_mcp
node_user -.->|"asks questions"| node_claudeagent

click node_walker "https://github.com/siddharthm2416/codecheck/blob/main/walker.py"
click node_chunkmodel "https://github.com/siddharthm2416/codecheck/blob/main/chunkers/base.py"
click node_pythonchunks "https://github.com/siddharthm2416/codecheck/blob/main/chunkers/python_chunker.py"
click node_javachunks "https://github.com/siddharthm2416/codecheck/blob/main/chunkers/java_chunker.py"
click node_jschunks "https://github.com/siddharthm2416/codecheck/blob/main/chunkers/js_chunker.py"
click node_testlink "https://github.com/siddharthm2416/codecheck/blob/main/test_linkage.py"
click node_indexer "https://github.com/siddharthm2416/codecheck/blob/main/index_repo.py"
click node_retrieval "https://github.com/siddharthm2416/codecheck/blob/main/retrieval.py"
click node_mcp "https://github.com/siddharthm2416/codecheck/blob/main/mcp_server.py"
click node_provider "https://github.com/siddharthm2416/codecheck/blob/main/providers.py"
click node_multiagent "https://github.com/siddharthm2416/codecheck/blob/main/agent_multi.py"
click node_claudeagent "https://github.com/siddharthm2416/codecheck/blob/main/agent.py"
click node_streamlit "https://github.com/siddharthm2416/codecheck/blob/main/app.py"
click node_cli "https://github.com/siddharthm2416/codecheck/blob/main/agent_multi.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_walker,node_chunkmodel,node_pythonchunks,node_javachunks,node_jschunks,node_testlink,node_indexer,node_embedder,node_user toneBlue
class node_chroma,node_retrieval,node_mcp,node_repo toneAmber
class node_provider,node_multiagent,node_claudeagent toneMint
class node_streamlit,node_cli toneRose
```

## Components

### Repository indexing

- [File walker](https://github.com/siddharthm2416/codecheck/blob/main/walker.py): `walker.py`
- [Chunk model](https://github.com/siddharthm2416/codecheck/blob/main/chunkers/base.py): `chunkers/base.py`
- [Python chunker](https://github.com/siddharthm2416/codecheck/blob/main/chunkers/python_chunker.py): `chunkers/python_chunker.py`
- [Java chunker](https://github.com/siddharthm2416/codecheck/blob/main/chunkers/java_chunker.py): `chunkers/java_chunker.py`
- [JavaScript chunker](https://github.com/siddharthm2416/codecheck/blob/main/chunkers/js_chunker.py): `chunkers/js_chunker.py`
- [Test linkage](https://github.com/siddharthm2416/codecheck/blob/main/test_linkage.py): `test_linkage.py`
- [Index builder](https://github.com/siddharthm2416/codecheck/blob/main/index_repo.py): `index_repo.py`
- **Text embeddings**

### Retrieval tools

- **ChromaDB index**
- [Retrieval functions](https://github.com/siddharthm2416/codecheck/blob/main/retrieval.py): `retrieval.py`
- [MCP tools](https://github.com/siddharthm2416/codecheck/blob/main/mcp_server.py): `mcp_server.py`

### Agent runtime

- [Provider adapters](https://github.com/siddharthm2416/codecheck/blob/main/providers.py): `providers.py`
- [Multi-provider agent](https://github.com/siddharthm2416/codecheck/blob/main/agent_multi.py): `agent_multi.py`
- [Claude agent](https://github.com/siddharthm2416/codecheck/blob/main/agent.py): `agent.py`

### User interfaces

- [Streamlit UI](https://github.com/siddharthm2416/codecheck/blob/main/app.py): `app.py`
- [CLI](https://github.com/siddharthm2416/codecheck/blob/main/agent_multi.py): `agent_multi.py`

### Other components

- **User**
- **Target repository**

## Connections

- User → Streamlit UI: uses (evidence: `README.md`)
- User → CLI: runs (evidence: `README.md`)
- Target repository → Index builder: indexes (evidence: `README.md`)
- Index builder → File walker: walks files (evidence: `index_repo.py`)
- File walker → Python chunker: dispatches (evidence: `walker.py`)
- File walker → Java chunker: dispatches (evidence: `walker.py`)
- File walker → JavaScript chunker: dispatches (evidence: `walker.py`)
- Python chunker → Chunk model: creates chunks (evidence: `chunkers/python_chunker.py`)
- Java chunker → Chunk model: creates chunks (evidence: `chunkers/java_chunker.py`)
- JavaScript chunker → Chunk model: creates chunks (evidence: `chunkers/js_chunker.py`)
- Index builder → Test linkage: links tests (evidence: `README.md`)
- Index builder → Text embeddings: embeds chunks (evidence: `README.md`)
- Index builder → ChromaDB index: stores vectors (evidence: `index_repo.py`)
- Text embeddings → ChromaDB index: supplies vectors
- MCP tools → Retrieval functions: calls tools (evidence: `mcp_server.py`)
- Retrieval functions → ChromaDB index: queries (evidence: `retrieval.py`)
- Retrieval functions → Target repository: reads source (evidence: `retrieval.py`)
- Streamlit UI → Index builder: starts indexing (evidence: `app.py`)
- Streamlit UI → File walker: checks freshness (evidence: `app.py`)
- Streamlit UI → Multi-provider agent: runs agent (evidence: `app.py`)
- CLI → MCP tools: connects tools (evidence: `agent_multi.py`)
- Multi-provider agent → MCP tools: calls tools (evidence: `agent_multi.py`)
- Multi-provider agent → Provider adapters: uses adapters (evidence: `agent_multi.py`)
- Claude agent → MCP tools: uses tools (evidence: `README.md`)
- User → Claude agent: asks questions (evidence: `README.md`)
