The Problem

Large codebases require automated AI assistants to surface patterns, locate code, and propose fixes. Existing tools scatter logic across many scripts, making it hard for a single engineer to understand or extend the workflow. HumanLayer bundles the AI‑agent orchestration, a daemon API, and a React UI into one repository, reducing the surface area for troubleshooting and accelerating iteration.

What This Does

HumanLayer presents a daemon (apps/daemon/src/index.ts) that runs a lightweight HTTP server (router/server.ts). The server exposes endpoints that the React UI (apps/react/src/App.tsx) calls to launch AI‑agent commands defined in the .claude/commands directory. The .claude folder contains Markdown command templates such as create_plan.md and implement_plan.md. Those templates are parsed at runtime to generate prompts for the AI backend, which is wrapped by the Go library in claudecode-go. A Docker image can be built from docker-compose.yml, allowing the daemon and UI to run as a single service stack.

How It Is Wired

Entry Point: apps/daemon/src/index.ts imports router/server.ts, which creates an Express app.

  • index.ts → router/index.ts → server.ts
  • server.ts registers routes like /api/plan and /api/implement.
  • Each route handler calls a helper in router/handlers.ts that reads the corresponding Markdown template from .claude/commands.
  • The handler forwards the rendered prompt to claudecode-go, a Go package that communicates with the AI backend via HTTP.
  • Responses are streamed back to the React front‑end.

The React UI (apps/react/src/App.tsx) renders a form that posts to /api/plan. The UI file imports utils/api.ts which uses fetch to hit the daemon.

External Touches:

  • Database: none.
  • Network: HTTP on localhost:3000 (daemon) and localhost:8080 (React).
  • Filesystem: reads Markdown command templates from .claude/commands.

Hub / Cycle: The daemon’s router is the single hub; all HTTP traffic flows through it, which simplifies security reviews but makes the daemon a potential single point of failure.

How To Use It

# Clone with the provided URL
git clone https://github.com/moses-y/humanlayer

# Build and start in Docker
docker compose up --build

The docker-compose.yml pulls the image built from the Makefile. If running locally without Docker:

# Install dependencies
cd apps/daemon
npm install

# Start the daemon
npm run dev   # watches TS source

# In another terminal, start the React UI
cd apps/react
npm install
npm start

No additional environment variables are required; configuration lives in apps/daemon/.env if needed (currently empty).

Real‑World Use

A dev team can launch the daemon, then from the UI ask the AI to “find all TODO comments in the hld directory.” The UI sends /api/plan → the daemon renders find_todos.md → Go backend calls the AI model → result is streamed back and displayed in the React component.

Code Health & Issues

  • Tests: 106 test files, CI runs via .github/workflows/main.yml.
  • CI/CD: GitHub Actions present, linting via .pre-commit-config.yaml.
  • License: MIT (LICENSE).
  • Missing: No explicit type definitions for the Go‑TS boundary; the Go client uses any.
  • Complexity: The router (router/server.ts) has 42 internal calls, a moderate blast radius for change.

The Bottom Line

HumanLayer offers a cohesive stack for AI‑driven code assistance, with a clear separation between the daemon API, AI prompt templates, and a lightweight UI. Its Docker integration simplifies deployment, and the test coverage gives confidence for incremental changes. However, the lack of a database and the single‑hub router may limit scalability for larger teams. It is best suited for small to medium projects that need quick AI integration without a full‑blown microservice architecture.