Happier Documentation

repository·dev·Indexed 23 days ago

https://github.com/happier-dev/happier

A cross-device companion client for AI coding agents enabling end-to-end encrypted remote control of local sessions from mobile, web, or desktop interfaces. Includes documentation for the Happier CLI to manage Claude Code and Gemini CLI sessions, as well as the Happier Server, a zero-knowledge backend for synchronizing encrypted conversations.

Tokens
357.1K
Snippets
549
Records
2K
Agent score
79%

What's inside Happier

  1. Overview of Happier for Content Creators

    dev

    Happier is an open-source mobile application that enables developers to control AI coding agents (such as Claude Code, Codex, and Gemini-CLI) directly from a smartphone (iOS, Android) or a web browser.

    Key technical characteristics include:

    • Local Execution: Runs on the user's own hardware (laptop, desktop, server, or Raspberry Pi) rather than expensive cloud servers.
    • Security: Uses end-to-end encrypted connections between devices.
    • Cost Model: Completely free and open source (users only pay their respective AI model providers for usage).
    • Features: Supports parallel agent execution, push notifications for agent prompts or errors, and voice input for hands-free control.
  2. Overview of Happier

    dev
    Happier is an open-source, end-to-end encrypted, cross-device companion app and client for AI coding agents (such as Claude Code, Codex, Gemini, OpenCode, and more). It allows you to run AI coding sessions locally on your computer and continue or control them remotely via a phone, web UI, or desktop app without losing context.
  3. Understand the Happier Backend Architecture

    dev

    The Happier backend (implemented in apps/server) is a Node.js-based system using Fastify for HTTP APIs and Socket.IO for real-time synchronization.

    Core Components:

    • API Layer: Fastify server handling RESTful routes with Zod validation and Bearer token authentication.
    • Realtime Layer: Socket.IO server at /v1/updates using an EventRouter to manage scoped connections (user-scoped, session-scoped, and machine-scoped).
    • Storage Layer:
      • Postgres (via Prisma): Primary relational database for accounts, sessions, machines, and encrypted blobs.
      • Redis: Used for activity caching and potentially pub/sub.
      • S3/MinIO: S3-compatible storage for uploaded assets (e.g., avatars).
    • Security: Uses privacy-kit for token generation and encryption. A HANDY_MASTER_SECRET environment variable is used to derive a KeyTree for encrypting service tokens (like GitHub or AI vendor tokens).
  4. Review the Happier feature matrix

    dev

    The feature matrix provides an overview of user-facing capabilities across different clients (App, Web, CLI, Mobile, Desktop) and runtimes. Capabilities are categorized by their stability status:

    • Stable: Intended for regular use.
    • Experimental: Available but still being hardened.
    • Capability-driven: Functionality depends on specific backend or provider support.

    Key functional areas include session management (sharing, syncing, handoff), developer tools (Git/file manager, embedded terminal, SCM hosting), and advanced interaction modes (voice, pets, local memory search).

  5. Project Components Overview

    dev

    The Happier ecosystem consists of three main components:

    • @happier-dev/cli: The command-line interface used to wrap Claude Code and Codex.
    • @happier-dev/server: The backend server responsible for encrypted synchronization.
    • @happier-dev/app: The mobile client used for remote control and monitoring.
  6. Understand the UI Testkit structure

    dev

    The UI Testkit provides a canonical testing surface for apps/ui. It is organized into several specialized directories to handle different testing concerns:

    • mocks/: Contains canonical module mock factories for repeated UI boundaries.
    • fixtures/: Provides typed app-state and feature fixture builders.
    • render/: Contains shared react-test-renderer render surfaces.
    • hooks/: Includes helpers for hook rendering, deferred execution, and flushing effects.
    • harness/: Provides repeated screen and feature harnesses.
    • cleanup/: Contains shared cleanup registration used by the render and hook helpers.
  7. Understand the Happier Review Report structure

    dev

    The Happier Review Report is a structured document used to evaluate code changes, plans, or releases. It provides a standardized way to communicate the outcome of a review, identify blockers, and assess risk.

    Key sections include:

    • Outcome And Blockers: Summarizes the review result and any issues preventing progress.
    • High-Confidence Findings: Details findings that are certain and actionable.
    • Plan Completeness & QA Coverage: Assesses how thoroughly the proposed changes were planned and tested.
    • Recommended Or Applied Fix Clusters: Groups related fixes that should be addressed.
    • Unexamined Scope And Residual Risk: Identifies areas that were not reviewed and the potential risks they pose.
    • Final Recommendation: Provides the final verdict on whether the item is ready for merge or release.
  8. Understand the Agent Craft working method

    dev

    Agent Craft is a structured working method designed for handling hard, ambiguous, or high-stakes tasks. It provides a framework for reading requests, decomposing problems, allocating verification effort, and communicating results. The method is intended to prevent common failures like shipping solutions to the wrong problems, creating monolithic fixes that are hard to debug, or propagating false premises through reasoning chains.

    Key procedures include:

    • Classifying request modes (Question, Change Order, Exploration, Thinking Aloud).
    • Decomposing problems into independently checkable, falsifiable claims.
    • Allocating effort based on risk (Probability × Cost × Silence).
    • Verifying claims through re-derivation rather than intuition.
    • Labeling uncertainty by separating observed, derived, and assumed information.
  9. What is Happier Server and how does it work?

    dev

    Happier Server is a minimal, zero-knowledge backend designed to synchronize encrypted conversations for Claude Code clients. It acts as a secure relay: clients generate encryption keys locally and end-to-end encrypt (E2EE) messages before they leave the device. The server only stores and syncs encrypted blobs, meaning it cannot read the content of any messages.

    Key characteristics:

    • Zero Knowledge: The server has no ability to decrypt data.
    • Real-time Sync: Uses WebSockets for multi-device synchronization.
    • Cryptographic Auth: Uses public key signatures instead of stored passwords.
  10. What is the pending queue?

    dev

    The pending queue allows you to store messages for a session without sending them to the agent immediately. This is useful when the agent is busy, offline, or not yet ready.

    Key characteristics:

    • Session-wide: Anyone with edit access to a shared session can see and manage these messages.
    • Ordered: You can control the sequence in which messages are processed.
    • Editable: Messages can be edited, removed, or reordered before they are executed.
    • Stored with the session: Pending content uses the same storage mode as the session transcript (encrypted by default, or plaintext depending on your deployment).

    Note: Pending messages do not trigger "unread" indicators; instead, they are indicated by a separate pending count badge.