# itayinbarr/little-coder architecture

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

- Interactive diagram: https://gitdiagram.com/itayinbarr/little-coder
- Repository: https://github.com/itayinbarr/little-coder

## Overview

little-coder is a pi-based coding agent adapted for small local models. A user launches it in a project directory; the launcher selects a model and explicitly loads the bundled extensions before starting pi. The agent then researches, plans, or edits through pi’s tools, with extensions adding orchestration, safety, and workflow features. README capabilities guide which extension branches are shown; most extension internals were not sampled, so uncertain internal calls are omitted.

Main entry points: [`bin/little-coder.mjs`](https://github.com/itayinbarr/little-coder/blob/main/bin/little-coder.mjs) (Launcher), [`bin/default-model.mjs`](https://github.com/itayinbarr/little-coder/blob/main/bin/default-model.mjs) (Default selection), [`.pi/extensions/phase-model/index.ts`](https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/phase-model/index.ts) (Per-phase models), [`.pi/extensions/llama-cpp-provider/index.ts`](https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/llama-cpp-provider/index.ts) (llama.cpp provider)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_launch["Launch and models"]
  node_launcher["Launcher<br/>[little-coder.mjs]"]
  node_model_config["Model config<br/>[models.json]"]
  node_default_model["Default selection<br/>[default-model.mjs]"]
  node_phase_model["Per-phase models<br/>[index.ts]"]
  node_llama_provider["llama.cpp provider<br/>[index.ts]"]
end

subgraph group_agent["Agent workflows"]
  node_plan["Plan mode<br/>[index.ts]"]
  node_research["Deep research<br/>[index.ts]"]
  node_subagent["Sub-coders<br/>[index.ts]"]
  node_browser["Browser<br/>[index.ts]"]
end

subgraph group_tools["Tools and safety"]
  node_permissions["Permission gate<br/>[index.ts]"]
  node_read_guard["Read-before-edit<br/>[index.ts]"]
  node_shell["Background shell<br/>[index.ts]"]
  node_evidence["Evidence handling<br/>[index.ts]"]
  node_quality["Quality monitor<br/>[index.ts]"]
end

subgraph group_context["Context and sessions"]
  node_skills["Skill cards"]
  node_tool_skills["Tool skill selection<br/>[index.ts]"]
  node_project_context["Project context<br/>[index.ts]"]
  node_prompt_history["Prompt history<br/>[index.ts]"]
end

subgraph group_external["Runtime environment"]
  node_pi["Pi runtime"]
  node_project["Project files"]
  node_local_model["Model provider"]
  node_sessions[("Pi sessions")]
end

node_user(("User"))

node_user -->|"starts"| node_launcher
node_launcher -->|"reads defaults"| node_model_config
node_launcher -->|"resolves model"| node_default_model
node_launcher -->|"starts with extensions"| node_pi
node_default_model -->|"selects model"| node_pi
node_pi -->|"requests inference"| node_local_model
node_pi -->|"reads and writes"| node_sessions
node_pi -->|"uses tools on"| node_project
node_pi -->|"dispatches"| node_plan
node_pi -->|"dispatches"| node_research
node_pi -->|"dispatches"| node_browser
node_pi -->|"checks actions"| node_permissions
node_pi -->|"checks edits"| node_read_guard
node_pi -->|"dispatches"| node_shell
node_pi -->|"selects skills"| node_tool_skills
node_tool_skills -->|"injects cards"| node_skills
node_pi -->|"loads context"| node_project_context
node_pi -->|"recalls prompts"| node_prompt_history
node_pi -->|"selects by phase"| node_phase_model
node_phase_model -->|"routes inference"| node_local_model
node_pi -->|"uses provider"| node_llama_provider
node_llama_provider -->|"probes context"| node_local_model
node_pi -->|"dispatches"| node_evidence
node_pi -->|"dispatches"| node_quality
node_research -.->|"fans out research"| node_subagent

click node_launcher "https://github.com/itayinbarr/little-coder/blob/main/bin/little-coder.mjs"
click node_model_config "https://github.com/itayinbarr/little-coder/blob/main/models.json"
click node_default_model "https://github.com/itayinbarr/little-coder/blob/main/bin/default-model.mjs"
click node_skills "https://github.com/itayinbarr/little-coder/tree/main/skills"
click node_plan "https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/plan-mode/index.ts"
click node_research "https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/deep-research/index.ts"
click node_subagent "https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/subagent/index.ts"
click node_browser "https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/browser/index.ts"
click node_permissions "https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/permission-gate/index.ts"
click node_read_guard "https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/read-guard/index.ts"
click node_shell "https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/bg-shell/index.ts"
click node_tool_skills "https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/skill-inject/index.ts"
click node_project_context "https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/project-context/index.ts"
click node_prompt_history "https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/prompt-history/index.ts"
click node_phase_model "https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/phase-model/index.ts"
click node_llama_provider "https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/llama-cpp-provider/index.ts"
click node_evidence "https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/evidence/index.ts"
click node_quality "https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/quality-monitor/index.ts"

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_launcher,node_model_config,node_default_model,node_phase_model,node_llama_provider,node_user toneBlue
class node_plan,node_research,node_subagent,node_browser toneAmber
class node_permissions,node_read_guard,node_shell,node_evidence,node_quality toneMint
class node_skills,node_tool_skills,node_project_context,node_prompt_history toneRose
class node_pi,node_project,node_local_model,node_sessions toneIndigo
```

## Components

### Launch and models

- [Launcher](https://github.com/itayinbarr/little-coder/blob/main/bin/little-coder.mjs): `bin/little-coder.mjs`
- [Model config](https://github.com/itayinbarr/little-coder/blob/main/models.json): `models.json`
- [Default selection](https://github.com/itayinbarr/little-coder/blob/main/bin/default-model.mjs): `bin/default-model.mjs`
- [Per-phase models](https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/phase-model/index.ts): `.pi/extensions/phase-model/index.ts`
- [llama.cpp provider](https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/llama-cpp-provider/index.ts): `.pi/extensions/llama-cpp-provider/index.ts`

### Agent workflows

- [Plan mode](https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/plan-mode/index.ts): `.pi/extensions/plan-mode/index.ts`
- [Deep research](https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/deep-research/index.ts): `.pi/extensions/deep-research/index.ts`
- [Sub-coders](https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/subagent/index.ts): `.pi/extensions/subagent/index.ts`
- [Browser](https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/browser/index.ts): `.pi/extensions/browser/index.ts`

### Tools and safety

- [Permission gate](https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/permission-gate/index.ts): `.pi/extensions/permission-gate/index.ts`
- [Read-before-edit](https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/read-guard/index.ts): `.pi/extensions/read-guard/index.ts`
- [Background shell](https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/bg-shell/index.ts): `.pi/extensions/bg-shell/index.ts`
- [Evidence handling](https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/evidence/index.ts): `.pi/extensions/evidence/index.ts`
- [Quality monitor](https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/quality-monitor/index.ts): `.pi/extensions/quality-monitor/index.ts`

### Context and sessions

- [Skill cards](https://github.com/itayinbarr/little-coder/tree/main/skills): `skills`
- [Tool skill selection](https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/skill-inject/index.ts): `.pi/extensions/skill-inject/index.ts`
- [Project context](https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/project-context/index.ts): `.pi/extensions/project-context/index.ts`
- [Prompt history](https://github.com/itayinbarr/little-coder/blob/main/.pi/extensions/prompt-history/index.ts): `.pi/extensions/prompt-history/index.ts`

### Runtime environment

- **Pi runtime**
- **Project files**
- **Model provider**
- **Pi sessions**

### Other components

- **User**

## Connections

- User → Launcher: starts
- Launcher → Model config: reads defaults
- Launcher → Default selection: resolves model
- Launcher → Pi runtime: starts with extensions
- Default selection → Pi runtime: selects model
- Pi runtime → Model provider: requests inference
- Pi runtime → Pi sessions: reads and writes
- Pi runtime → Project files: uses tools on
- Pi runtime → Plan mode: dispatches
- Pi runtime → Deep research: dispatches
- Pi runtime → Browser: dispatches
- Pi runtime → Permission gate: checks actions
- Pi runtime → Read-before-edit: checks edits
- Pi runtime → Background shell: dispatches
- Pi runtime → Tool skill selection: selects skills
- Tool skill selection → Skill cards: injects cards
- Pi runtime → Project context: loads context
- Pi runtime → Prompt history: recalls prompts
- Pi runtime → Per-phase models: selects by phase
- Per-phase models → Model provider: routes inference
- Pi runtime → llama.cpp provider: uses provider
- llama.cpp provider → Model provider: probes context
- Pi runtime → Evidence handling: dispatches
- Pi runtime → Quality monitor: dispatches
- Deep research → Sub-coders: fans out research
