Language: English | 简体中文
This repository is not just a source-map recovery archive. It is a working multi-project workspace built around a restored Claude Code tree, a Tauri desktop shell, and a self-hosted remote session backend. The workspace currently centers on
Claude-Code-mainandturin-remote/backend: the first provides the CLI, multi-agent orchestration, assistant flows, and desktop app; the second provides the remote sessions, environments, work queue, and WebSocket backend.
Warning
This is still an unofficial research-oriented repository. The Claude-Code-main codebase is based on source-map reconstruction from the published @anthropic-ai/claude-code package. Original Claude Code rights belong to Anthropic.
🔎 Best for: Claude Code research, self-hosted remote session experiments, multi-agent orchestration work, and desktop integration testing
🧩 Stack: Bun + TypeScript + Tauri + Elysia + PostgreSQL
🧭 Quick Links: Workspace · Feature Status · Quick Start · CLI Capabilities · Remote Backend · Desktop
This root directory is a workspace, not a single Bun package.
| Path | Role |
|---|---|
Claude-Code-main/ |
Restored Claude Code core with Buddy, KAIROS, Coordinator, Bridge-related work, and desktop integration |
Claude-Code-main/apps/desktop/ |
Tauri desktop shell with Remote Hub, sidebar session management, settings UI, and desktop pet window |
Claude-Code-main/apps/session-backend-reference/ |
Reference session backend for local protocol testing without PostgreSQL |
turin-remote/backend/ |
Elysia + PostgreSQL remote session backend for environments, sessions, work polling, and WebSocket streaming |
| root docs | Operations, remote-control setup, coordinator notes, testing guides, and feature-gate analysis |
The original "hidden features" list should now be interpreted based on the actual state of this workspace:
| ID | Capability | Status | Notes |
|---|---|---|---|
| 1 | Buddy | ✅ Implemented |
/buddy hatch, /buddy card, /buddy pet, plus desktop pet identity reuse |
| 2 | KAIROS | ✅ Implemented |
assistant, daemon, tasks, proactive, and autodream paths are wired up |
| 3 | Ultraplan | ⏳ Not implemented |
source traces still exist, but this workspace does not present it as a working feature |
| 4 | Coordinator | ✅ Implemented |
extended beyond the base feature with scratchpad, ledger, phases, file locks, limits, checkpointing, tracing, and auto-retry |
| 5 | Hidden commands and gates | 🟡 Partial |
/assistant, /proactive, /buddy, --coordinator, daemon, and related flows are usable; strict internal-only upstream paths remain gated |
| 6 | Bridge / Remote Control | ✅ Implemented |
assistant attach, remote-control workers, self-hosted session backend support, and desktop Remote Hub are connected |
| 7 | Feature-gate analysis | 📌 Preserved |
compile-time gates, USER_TYPE, and GrowthBook analysis remain documented |
The old root README mainly described recovered source. This workspace now includes real runnable and testable integrations:
Claude-Code-mainis no longer just a restored tree. It now exposes working Buddy, KAIROS, Proactive, Coordinator, assistant, and remote session flows.- Coordinator mode was extended with:
- shared scratchpad state
- coordinator ledger
- phase state machine
- file write locks and ownership checks
- worker resource limits
- checkpoints
- trace timeline output
- automatic retry orchestration
- The desktop app is no longer a placeholder:
- Tauri host
- CLI transcript-backed sidebar session model
- Remote Hub
- Windows idle pet window
- settings pages for session, safety, context, and integrations
- MCP draft/runtime views
- browser/computer-use management panels
- Remote collaboration is no longer tied only to claude.ai:
apps/session-backend-referencefor local smoke testingturin-remote/backendfor a real PostgreSQL-backed deployment
- Bun
>= 1.3.5 - Node.js
>= 24
- Rust toolchain
- Tauri 2.x prerequisites
- Windows is the current primary target for the desktop pet flow
- PostgreSQL
>= 14
The repository root does not contain one shared
package.json. Install and run dependencies per subproject.
Examples below assume PowerShell from the repository root.
bun install --cwd .\Claude-Code-main
bun install --cwd .\Claude-Code-main\apps\desktop
bun install --cwd .\turin-remote\backendbun run --cwd .\Claude-Code-main version
bun run --cwd .\Claude-Code-main devUseful entry points:
bun run --cwd .\Claude-Code-main dev:cli --help
bun run --cwd .\Claude-Code-main dev:cli daemon --helpIf you want to test assistant or remote-control flows without PostgreSQL first:
$env:SESSION_BACKEND_URL='http://127.0.0.1:8787'
$env:SESSION_BACKEND_TOKEN='local-dev-session-token'
$env:SESSION_BACKEND_ORG_ID='local-dev-org'
bun run --cwd .\Claude-Code-main session-backend:refBuilt-in checks:
bun run --cwd .\Claude-Code-main session-backend:ref:test
bun run --cwd .\Claude-Code-main session-backend:ref:e2ebun run --cwd .\Claude-Code-main\apps\desktop tauri:devCopy-Item .\turin-remote\backend\.env.example .\turin-remote\backend\.envThen configure turin-remote/backend/.env and run:
bun run --cwd .\turin-remote\backend db:migrate
bun run --cwd .\turin-remote\backend db:seed
bun run --cwd .\turin-remote\backend devCommands:
/buddy hatch
/buddy card
/buddy pet
/buddy mute
/buddy unmute
In this workspace, Buddy is not only a CLI gimmick:
- the buddy identity is generated by the CLI core
- the desktop app reads the same identity via
apps/desktop/scripts/readBuddyIdentity.ts - the Tauri pet window reuses the same pet instead of creating a second desktop-only pet profile
Current entry points include:
bun run --cwd .\Claude-Code-main dev:cli --assistantbun run --cwd .\Claude-Code-main dev:cli assistant/assistant status/assistant run <goal>/assistant stop <taskId|latest>/assistant resume <taskId|latest>/assistant tasks
Typical assistant daemon startup:
$env:SESSION_BACKEND_URL='http://127.0.0.1:8787'
$env:SESSION_BACKEND_TOKEN='local-dev-session-token'
$env:SESSION_BACKEND_ORG_ID='local-dev-org'
bun run --cwd .\Claude-Code-main dev:cli daemon start --worker assistant --dir D:\Project\TypeProject\Claude-Code-main\Claude-Code-mainStatus and task inspection:
bun run --cwd .\Claude-Code-main dev:cli daemon status --worker assistant --dir D:\Project\TypeProject\Claude-Code-main\Claude-Code-main
bun run --cwd .\Claude-Code-main dev:cli -p "/assistant status --all"
bun run --cwd .\Claude-Code-main dev:cli -p "/assistant tasks --all --json"The assistant path currently covers:
- daemon supervisor
- task lifecycle tracking
- attach and discovery
- automatic backgrounding of long-running commands
- persistent assistant work
Proactive mode is wired up:
$env:CLAUDE_CODE_ENABLE_PROACTIVE='1'
bun run --cwd .\Claude-Code-main devInside REPL:
/proactive on
/proactive off
/proactive pause
/proactive resume
/proactive status
AutoDream is also connected to the long-running assistant flow and memory consolidation path.
This is the area that has been most explicitly extended in this workspace.
Enable it with:
$env:CLAUDE_CODE_ENABLE_COORDINATOR='1'
$env:CLAUDE_CODE_COORDINATOR_MODE='1'
$env:CLAUDE_CODE_ENABLE_SCRATCHPAD='1'
$env:CLAUDE_CODE_ENABLE_COORDINATOR_AUTO_RETRY='1'
bun run --cwd .\Claude-Code-main devOr directly through the CLI wrapper:
bun run --cwd .\Claude-Code-main dev:cli --coordinatorImplemented coordinator extensions:
- worker-only coordinator orchestration
- shared scratchpad JSON state
- coordinator ledger
- phase state machine
- file lock manager
- write guard
- retry policy plus auto-retry orchestrator
- worker checkpoints
- coordinator trace
- resource limit profiles
Common limit overrides:
$env:CLAUDE_CODE_WORKER_MAX_TURNS='25'
$env:CLAUDE_CODE_WORKER_MAX_TOKENS='100000'
$env:CLAUDE_CODE_WORKER_MAX_DURATION_MS='300000'
$env:CLAUDE_CODE_WORKER_MAX_TOOL_CALLS='50'
$env:CLAUDE_CODE_WORKER_LIMIT_POLICY='stop'The recommended remote flow in this workspace is to connect Claude-Code-main to either the reference backend or turin-remote/backend, not to rely only on upstream claude.ai infrastructure.
Local smoke path:
$env:SESSION_BACKEND_URL='http://127.0.0.1:8787'
$env:SESSION_BACKEND_TOKEN='local-dev-session-token'
$env:SESSION_BACKEND_ORG_ID='local-dev-org'
bun run --cwd .\Claude-Code-main dev:cli remote-controlLong-running worker path:
$env:SESSION_BACKEND_URL='http://127.0.0.1:3000'
$env:SESSION_BACKEND_TOKEN='<your-backend-token>'
$env:SESSION_BACKEND_ORG_ID='<your-org-id>'
bun run --cwd .\Claude-Code-main dev:cli daemon start --worker remoteControl --dir D:\Project\TypeProject\Claude-Code-main\Claude-Code-mainThe desktop app already exposes a Remote Hub for assistant sessions and remote-control sessions.
turin-remote/backend is the real remote session backend in this workspace, built on Elysia and PostgreSQL.
| Module | Current Capability |
|---|---|
| Health | /health and /ready, including protocol version, capabilities, and counts |
| Auth | /v1/auth/context with token source, org binding, and security warnings |
| Sessions | create, query, update, archive, append events, paginate events, summaries, WebSocket subscribe |
| Environments | register and deregister bridge environments, reconnect sessions |
| Work Queue | poll, ack, heartbeat, and stop with session ingress token support |
| Token tooling | tokens:create, tokens:list, tokens:revoke |
| DB scripts | db:migrate, db:seed |
| Tests | bun test and integration coverage in test/integration/session-backend.test.ts |
Copy-Item .\turin-remote\backend\.env.example .\turin-remote\backend\.envAt minimum, configure:
DATABASE_URLSESSION_BACKEND_ORG_IDSESSION_INGRESS_SIGNING_SECRETSECRET_HASH_PEPPER
Then run:
bun run --cwd .\turin-remote\backend db:migrate
bun run --cwd .\turin-remote\backend db:seed
bun run --cwd .\turin-remote\backend tokens:create -- --label "local-dev-machine"
bun run --cwd .\turin-remote\backend devHealth check:
Invoke-RestMethod http://127.0.0.1:3000/healthTo connect the CLI or desktop app to this backend, set:
$env:SESSION_BACKEND_URL='http://127.0.0.1:3000'
$env:SESSION_BACKEND_TOKEN='<plain-text-token>'
$env:SESSION_BACKEND_ORG_ID='<org-id>'Claude-Code-main/apps/desktop is already a functional desktop shell, not just a placeholder directory.
Current pieces include:
- Tauri host plus React UI
- CLI transcript-backed sidebar session model
- desktop overlay index at
~/.turin/desktop/sidebar-index.json - session rename, pin, hide, and restore
- Remote Hub
- live remote session storage and view
- Windows idle pet window
- buddy identity bridge
- settings shell
- MCP management panels
- browser/computer-use panels
Relationship with CLI state:
- CLI transcripts are the source of truth for real sessions
- desktop stores only UI overlays and drafts
- rename writes back to CLI transcript metadata
- pin and hide are desktop-local overlay state
Related docs:
Recommended reading order:
- Operations Guide
- Remote Control Setup Guide
- KAIROS / Bridge / Coordinator / AutoDream / Proactive Test Guide
- Coordinator Implementation Checklist
- Desktop Buddy Pet Execution Checklist
- Feature Gates Analysis
Ultraplanis intentionally not described here as a working capability.- Some upstream paths still remain behind original entitlement gates, especially flows that depend on Anthropic internal access, claude.ai OAuth, or GrowthBook rollout conditions.
voice, someant-only commands, and some official remote-bridge behavior should not be treated as fully replaced by the self-hosted backend in this repository.- This README describes the features that are actually wired up and testable in this workspace, not every source artifact that still exists in the restored tree.
Claude-Code-mainis reconstructed from publicly published package artifacts and is kept here for research and learning purposes.- Original Claude Code rights belong to Anthropic.
turin-remote/backend, the desktop wiring, and the operational documentation reflect additional work in this workspace.- If there are copyright or compliance concerns, remove or adjust the affected material accordingly.