mirror of
https://github.com/humanlayer/humanlayer.git
synced 2025-08-20 19:01:22 +03:00
3.2 KiB
3.2 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Repository Overview
This is a monorepo containing two distinct but interconnected project groups:
Project 1: HumanLayer SDK & Platform - The core product providing human-in-the-loop capabilities for AI agents Project 2: Local Tools Suite - Tools that leverage HumanLayer SDK to provide rich approval experiences
Project 1: HumanLayer SDK & Platform
Components
humanlayer/- Python SDK with decorators for approval flows and human interactionhumanlayer-ts/- TypeScript SDK for Node.js and browser environmentshumanlayer-go/- Minimal Go client for building toolshumanlayer-ts-vercel-ai-sdk/- Specialized integration for Vercel AI SDKexamples/- Integration examples for LangChain, CrewAI, OpenAI, and other frameworksdocs/- Mintlify documentation site
Core Concepts
- Approval Decorators:
@hl.require_approval()wraps functions requiring human oversight - Human as Tool:
hl.human_as_tool()enables AI agents to consult humans - Contact Channels: Slack, Email, CLI, and web interfaces for human interaction
- Multi-language Support: Feature parity across Python, TypeScript, and Go SDKs
Project 2: Local Tools Suite
Components
hld/- Go daemon that coordinates approvals and manages Claude Code sessionshlyr/- TypeScript CLI with MCP (Model Context Protocol) server for Claude integrationhumanlayer-tui/- Terminal UI (Go + Bubble Tea) for managing approvalshumanlayer-wui/- Desktop/Web UI (Tauri + React) for graphical approval managementclaudecode-go/- Go SDK for programmatically launching Claude Code sessions
Architecture Flow
Claude Code → MCP Protocol → hlyr → JSON-RPC → hld → HumanLayer Cloud API
↑ ↑
TUI ─┘ └─ WUI
Development Commands
Quick Actions
make check-test- Run all checks and testsmake check- Run linting and type checkingmake test- Run all test suites
Python Development
- Uses
uvexclusively - never use pip directly - Tests are co-located with source as
*_test.pyfiles - Commands:
uv sync,make check-py,make test-py
TypeScript Development
- Package managers vary - check
package.jsonfor npm or bun - Build/test commands differ - check
package.jsonscripts section - Some use Jest, others Vitest, check
package.jsondevDependencies
Go Development
- Check
go.modfor Go version (varies between 1.21 and 1.24) - Check if directory has a
Makefilefor available commands - Integration tests only in some projects (look for
-tags=integration)
Technical Guidelines
Python
- Strict type hints (mypy strict mode)
- Async/await patterns where established
- Follow existing code style
TypeScript
- Modern ES6+ features
- Strict TypeScript configuration
- Maintain CommonJS/ESM compatibility
Go
- Standard Go idioms
- Context-first API design
- Generate mocks with
make mockswhen needed
Additional Resources
- Check
examples/for integration patterns - Consult
docs/for user-facing documentation