Skip to content

About

Autonomous code improvement agent — register a project, set a goal, wake up to better code

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

Crius

AI-first Linux OS — Claude Code as your shell.

Crius replaces the traditional desktop environment with Claude Code running inside tmux. Boot your machine, and instead of a login screen and file manager, you get an AI that controls your entire system through natural language.

This is not AI running inside an OS. This is AI as the OS interface.

How It Works

Power on → Ubuntu boots → Auto-login → tmux launches → Claude Code starts

Claude Code has access to four MCP (Model Context Protocol) servers that give it direct system control:

MCP Server Purpose
crius-memory Persistent memory across sessions — SQLite with FTS5 search
crius-system Package management, services, disk/memory/CPU monitoring
crius-projects Git repo scanning, project status, context switching
crius-comms Slack integration — read unreads, send messages

On every boot, Claude automatically:

  1. Registers the terminal session
  2. Restores previous context (what you were working on)
  3. Checks Slack for unread messages
  4. Scans projects for dirty repos
  5. Reports system health
  6. Presents a concise briefing

Architecture

┌─────────────────────────────────────────────────┐
│                    tmux session                  │
│  ┌──────────────────────┬──────────────────────┐ │
│  │                      │       btop           │ │
│  │    Claude Code       ├──────────────────────┤ │
│  │    (primary shell)   │   notifications      │ │
│  │                      │       tail           │ │
│  └──────────────────────┴──────────────────────┘ │
│         │                                        │
│    MCP Protocol (stdio)                          │
│         │                                        │
│  ┌──────┴──────────────────────────────────────┐ │
│  │  crius-memory  │  crius-system  │  crius-   │ │
│  │  (SQLite/FTS5) │  (apt,         │  comms    │ │
│  │                │   systemd)     │  (Slack)  │ │
│  │  crius-projects                             │ │
│  │  (git repos)                                │ │
│  └─────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────┘
              Ubuntu Linux / systemd

Project Structure

crius/
├── packages/
│   ├── shared/           # Shared TypeScript types
│   ├── crius-memory/     # Persistent memory daemon (SQLite + WAL + FTS5)
│   ├── crius-system/     # OS control (packages, services, resources)
│   ├── crius-projects/   # Git project awareness
│   └── crius-comms/      # Slack integration
├── system/               # OS configuration files
│   ├── claude.md         # System CLAUDE.md (AI personality + behavior)
│   ├── claude.json       # MCP server configuration
│   ├── tmux.conf         # tmux layout and keybindings
│   ├── crius-launch.sh   # Session launcher
│   ├── crius-fallback.sh # Fallback when API is unavailable
│   ├── zprofile          # Auto-launch on TTY1
│   └── systemd/          # systemd service units
├── scripts/
│   ├── install.sh        # Ubuntu setup script
│   └── deploy.sh         # Build and deploy to target
└── docs/                 # Design spec and implementation plan

Requirements

  • Hardware: x86_64 machine, 4GB+ RAM, 20GB+ disk, network connection
  • OS: Ubuntu 24.04+ (fresh minimal install)
  • Account: Claude Max subscription (for Claude Code)

Installation

1. Provision a server

Any x86_64 machine or VPS with Ubuntu 24.04. Tested on Hetzner Cloud (cx43).

2. Clone and install

git clone https://github.com/orzazade/crius.git /opt/crius
cd /opt/crius
sudo ./scripts/install.sh

This installs system packages (Node.js 20, tmux, zsh, btop), creates the crius user, sets up auto-login on TTY1, and configures scoped sudo access for apt-get and systemctl.

3. Build and deploy

sudo ./scripts/deploy.sh

Builds all MCP servers, copies configs, enables the memory daemon, and sets up tmux.

4. Authenticate Claude Code

su - crius
claude

Log in with your Anthropic account when prompted.

5. Add secrets (optional)

# Slack bot token (for Slack integration)
echo 'xoxb-your-token' | sudo tee /etc/crius/secrets/slack_token

6. Reboot

sudo reboot

Crius boots directly into Claude Code.

Connecting

SSH (recommended)

ssh crius@your-server-ip
tmux attach-session -t crius

Full terminal experience with proper keybindings.

Web console

Use your hosting provider's web console (e.g., Hetzner Console) for direct TTY access.

Development

Built as a pnpm monorepo. Develop on macOS/Linux, deploy to target.

# Install dependencies
pnpm install

# Build all packages
pnpm -r build

# Run all tests
pnpm -r test

# Build specific package
cd packages/crius-memory && pnpm build

Tech Stack

  • Runtime: Node.js 20+, TypeScript
  • Database: SQLite (better-sqlite3) with WAL mode and FTS5
  • Protocol: MCP SDK (@modelcontextprotocol/sdk)
  • Monorepo: pnpm workspaces
  • Testing: Jest + ts-jest

Keybindings

Inside tmux (prefix: Ctrl+a):

Key Action
Prefix + f Toggle fullscreen on current pane
Prefix + b Launch Chromium browser (via Cage)
Prefix + k Kill browser, return to tmux
Prefix + n Open new Claude Code window
Prefix + | Split pane horizontally
Prefix + - Split pane vertically
Ctrl+Alt+F2 Escape hatch — raw zsh on TTY2

Escape Hatch

If the Anthropic API goes down, Crius degrades gracefully:

  • tmux session and MCP servers keep running
  • Switch to TTY2 (Ctrl+Alt+F2) for a raw zsh shell
  • crius-fallback prints a command cheatsheet
  • Memory is preserved in SQLite — nothing is lost
  • On API recovery, new Claude Code session auto-restores context

Roadmap

Version Features
v0.1 (current) Boot → Claude Code + memory + system + Slack + browser
v0.2 Proactive watchdog alerts, smart notification filtering
v0.3 Multi-terminal session sync, context resume
v0.4 Custom TUI dashboard, voice input
v1.0 Local model fallback, offline mode

License

MIT

Author

Orkhan Rzazade

About

Autonomous code improvement agent — register a project, set a goal, wake up to better code

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages