# ananyajoshi0203-cpu/claude-code-setup architecture

> Architecture diagram of the GitHub repository ananyajoshi0203-cpu/claude-code-setup, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ananyajoshi0203-cpu/claude-code-setup
- Repository: https://github.com/ananyajoshi0203-cpu/claude-code-setup

## Overview

This repository is both a documented Claude Code project setup and an example FastAPI model-serving application. The main API workflow is a client request routed through FastAPI to prediction logic, which returns a label and confidence. Separate documented branches cover Claude context and enforcement, subagents and skills, and the example training workflow. Connections for the Claude configuration are based on README descriptions; the training and prediction implementations are intentionally stubs.

Main entry points: [`src/app/main.py`](https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/src/app/main.py) (FastAPI app), [`.claude/skills`](https://github.com/ananyajoshi0203-cpu/claude-code-setup/tree/main/.claude/skills) (Skills), [`src/app/api/predict.py`](https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/src/app/api/predict.py) (Predict route), [`src/app/training/train.py`](https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/src/app/training/train.py) (Training job)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_serving["Model-serving API"]
  node_app["FastAPI app<br/>[main.py]"]
  node_predict_route["Predict route<br/>[predict.py]"]
  node_prediction["Classification logic<br/>[predict.py]"]
  node_settings["App settings<br/>[config.py]"]
  node_errors["Error handling<br/>[errors.py]"]
end

subgraph group_training["Model training"]
  node_train_job["Training job<br/>[train.py]"]
  node_train_config["Training config<br/>[train.yaml]"]
  node_run_artifacts["Run artifacts"]
end

subgraph group_context["Claude context"]
  node_project_instructions["Project instructions<br/>[CLAUDE.md]"]
  node_architecture_docs["Architecture notes<br/>[architecture.md]"]
  node_rules["Scoped rules<br/>[rules]"]
  node_settings_hooks["Permissions and hooks<br/>[settings.json]"]
  node_mcp_config["MCP configuration<br/>[.mcp.json]"]
end

subgraph group_workflows["Claude workflows"]
  node_agents["Subagents<br/>[agents]"]
  node_skills["Skills<br/>[skills]"]
  node_eval_checklist["Promotion checklist<br/>[checklist.md]"]
  node_endpoint_template["Endpoint template<br/>[template.py]"]
  node_loop_harness["Loop harness<br/>[PROMPT.md]"]
end

node_client(("API client"))
node_claude_user(("Claude Code user"))

node_client -->|"sends request"| node_app
node_app -->|"registers router"| node_predict_route
node_app -->|"reads settings"| node_settings
node_app -->|"registers handler"| node_errors
node_predict_route -->|"classifies text"| node_prediction
node_claude_user -->|"starts session"| node_project_instructions
node_project_instructions -->|"imports notes"| node_architecture_docs
node_claude_user -->|"loads applicable rules"| node_rules
node_claude_user -->|"applies permissions"| node_settings_hooks
node_claude_user -->|"loads tools"| node_mcp_config
node_claude_user -->|"starts subagent"| node_agents
node_claude_user -->|"invokes skill"| node_skills
node_skills -->|"reads checklist"| node_eval_checklist
node_skills -->|"uses template"| node_endpoint_template
node_claude_user -->|"runs loop work"| node_loop_harness
node_train_config -.->|"configures run"| node_train_job
node_train_job -->|"writes artifacts"| node_run_artifacts

click node_app "https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/src/app/main.py"
click node_predict_route "https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/src/app/api/predict.py"
click node_prediction "https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/src/app/services/predict.py"
click node_settings "https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/src/app/config.py"
click node_errors "https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/src/app/errors.py"
click node_train_job "https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/src/app/training/train.py"
click node_train_config "https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/configs/train.yaml"
click node_project_instructions "https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/CLAUDE.md"
click node_architecture_docs "https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/docs/architecture.md"
click node_rules "https://github.com/ananyajoshi0203-cpu/claude-code-setup/tree/main/.claude/rules"
click node_settings_hooks "https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/.claude/settings.json"
click node_mcp_config "https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/.mcp.json"
click node_agents "https://github.com/ananyajoshi0203-cpu/claude-code-setup/tree/main/.claude/agents"
click node_skills "https://github.com/ananyajoshi0203-cpu/claude-code-setup/tree/main/.claude/skills"
click node_eval_checklist "https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/.claude/skills/eval-model/checklist.md"
click node_endpoint_template "https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/.claude/skills/new-endpoint/template.py"
click node_loop_harness "https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/harness/PROMPT.md"

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_app,node_predict_route,node_prediction,node_settings,node_errors,node_client,node_claude_user toneBlue
class node_train_job,node_train_config,node_run_artifacts toneAmber
class node_project_instructions,node_architecture_docs,node_rules,node_settings_hooks,node_mcp_config toneMint
class node_agents,node_skills,node_eval_checklist,node_endpoint_template,node_loop_harness toneRose
```

## Components

### Model-serving API

- [FastAPI app](https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/src/app/main.py): `src/app/main.py`
- [Predict route](https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/src/app/api/predict.py): `src/app/api/predict.py`
- [Classification logic](https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/src/app/services/predict.py): `src/app/services/predict.py`
- [App settings](https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/src/app/config.py): `src/app/config.py`
- [Error handling](https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/src/app/errors.py): `src/app/errors.py`

### Model training

- [Training job](https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/src/app/training/train.py): `src/app/training/train.py`
- [Training config](https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/configs/train.yaml): `configs/train.yaml`
- **Run artifacts**

### Claude context

- [Project instructions](https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/CLAUDE.md): `CLAUDE.md`
- [Architecture notes](https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/docs/architecture.md): `docs/architecture.md`
- [Scoped rules](https://github.com/ananyajoshi0203-cpu/claude-code-setup/tree/main/.claude/rules): `.claude/rules`
- [Permissions and hooks](https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/.claude/settings.json): `.claude/settings.json`
- [MCP configuration](https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/.mcp.json): `.mcp.json`

### Claude workflows

- [Subagents](https://github.com/ananyajoshi0203-cpu/claude-code-setup/tree/main/.claude/agents): `.claude/agents`
- [Skills](https://github.com/ananyajoshi0203-cpu/claude-code-setup/tree/main/.claude/skills): `.claude/skills`
- [Promotion checklist](https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/.claude/skills/eval-model/checklist.md): `.claude/skills/eval-model/checklist.md`
- [Endpoint template](https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/.claude/skills/new-endpoint/template.py): `.claude/skills/new-endpoint/template.py`
- [Loop harness](https://github.com/ananyajoshi0203-cpu/claude-code-setup/blob/main/harness/PROMPT.md): `harness/PROMPT.md`

### Other components

- **API client**
- **Claude Code user**

## Connections

- API client → FastAPI app: sends request (evidence: `README.md`)
- FastAPI app → Predict route: registers router (evidence: `src/app/main.py`)
- FastAPI app → App settings: reads settings (evidence: `src/app/main.py`)
- FastAPI app → Error handling: registers handler (evidence: `src/app/main.py`)
- Predict route → Classification logic: classifies text (evidence: `src/app/api/predict.py`)
- Claude Code user → Project instructions: starts session (evidence: `README.md`)
- Project instructions → Architecture notes: imports notes (evidence: `README.md`)
- Claude Code user → Scoped rules: loads applicable rules (evidence: `README.md`)
- Claude Code user → Permissions and hooks: applies permissions (evidence: `README.md`)
- Claude Code user → MCP configuration: loads tools (evidence: `README.md`)
- Claude Code user → Subagents: starts subagent (evidence: `README.md`)
- Claude Code user → Skills: invokes skill (evidence: `README.md`)
- Skills → Promotion checklist: reads checklist (evidence: `README.md`)
- Skills → Endpoint template: uses template (evidence: `README.md`)
- Claude Code user → Loop harness: runs loop work (evidence: `README.md`)
- Training config → Training job: configures run
- Training job → Run artifacts: writes artifacts (evidence: `src/app/training/train.py`)
