Files

2.5 KiB

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Git

Always stage newly created files that permanently belong to the project with git add <file>.

Commands

./gradlew run           # Run the app
./gradlew compileKotlin # Compile only
./gradlew packageDmg    # Build macOS DMG

Architecture

AnyTask is a Kotlin/Compose desktop app that runs in the background and shows a task creation window via a global hotkey (Ctrl+Shift+Space). AnyType is a private, offline-first digital workspace and collaboration tool that gives users full ownership of their data through local encryption and peer-to-peer sync — with no servers or gatekeepers involved. Everything in Anytype is built around Objects — the universal unit for any piece of content — each assigned a Type (e.g. Note, Task, Book) that defines its structure, and connected via Relations (typed properties like due date, assignee, or tags) that link objects together into a queryable, graph-like knowledge model. API the Anytype API is documented here.

Components

  • Main.kt — Entry point. Sets apple.awt.UIElement=true (no dock icon), starts the Compose application {}, sets up system tray and HotkeyManager.
  • hotkey/HotkeyManager.kt — JNativeHook wrapper. Registers Ctrl+Shift+Space as a system-wide hotkey and dispatches the callback on the AWT EDT.
  • ui/TaskWindow.kt — Compose UI with a form (title, details). Escape closes, ⌘↵ creates.
  • api/AnyTypeApi.kt — Ktor HTTP client for the local AnyType API (localhost:31009). Currently a skeleton — API details still need to be verified.

Stack

  • Kotlin 2.1.0 / Compose Multiplatform 1.7.1
  • JNativeHook 2.2.2 (global hotkeys)
  • Ktor 3.0.0 + kotlinx.serialization (AnyType API)
  • Gradle 9.2.1

Code Style

  • One class per file — file name matches the class name.
  • No wildcard imports (import foo.*).
  • Code, comments, and documentation in English.
  • Exceptions: always handle or at least log them (with full stacktrace).

macOS Notes

  • Accessibility permission for JNativeHook: System Settings → Privacy & Security → Accessibility → add the app. Without this permission the global hotkey will not work.
  • The tray icon appears in the menu bar (no dock icon, since apple.awt.UIElement=true).

AnyType API

The local AnyType API runs via anytype-heart on http://localhost:31007. apiKey and spaceId are configured via anytask.yaml.