Skip to content

reedmayhew18/ClawedBack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿฆ€ ClawedBack ๐Ÿฆ€

Your Personal AI Assistant โ€” Runs in Claude Code

Runs in Claude Code Port of OpenClaw License: AGPL v3

Skills Tool Compat ClawHub Security Scan Install Modes

A clean-room port of OpenClaw that runs inside Claude Code 17 skills ยท 5 agents ยท 3 install modes ยท ClawHub compatible

Multi-channel AI assistant with web chat, file sharing, voice messages, scheduled tasks,
webhook ingestion, approval workflows, and a skill marketplace โ€” all running inside Claude Code.
Clone, setup, chat. ๐Ÿฆ€


๐Ÿฆ€ What Is This?

ClawedBack is a clean-room reimplementation of the OpenClaw personal AI assistant platform, rebuilt from the ground up to run inside Claude Code.

Important: ClawedBack is a port, not a fork. It resembles OpenClaw in spirit and functionality โ€” a multi-channel, self-hosted AI assistant with tool execution, automation, and approval workflows โ€” but is an entirely separate codebase with a different architecture. No OpenClaw code was used. ๐Ÿฆ€

Where OpenClaw is a TypeScript monolith with a WebSocket gateway, ClawedBack flips the script: Claude Code IS the agent runtime. It's Claude Code skills.

๐Ÿฆ€ Setup

Use of this project is subject to Anthropic's Terms of Service.

Prerequisites

  • Python 3.11+
  • tmux (sudo apt install tmux)

Step 1: Install Claude Code

curl -fsSL https://claude.ai/install.sh | bash

Step 2: Clone and enter the project

git clone https://github.com/reedmayhew18/ClawedBack.git
cd ClawedBack

Step 3: Start in tmux

tmux new -s clawedback

Step 4: Choose your install mode and launch Claude

๐Ÿฆ€ Mode A: Portable โ€” User (Recommended)

Best for trying it out, development, or personal use. Safest option.

claude
# then: /oc-setup โ†’ choose Mode A
  • Python venv inside the project folder
  • Runs as your normal user
  • Claude asks permission before risky operations (add --dangerously-skip-permissions to allow autonomous functionality)
๐Ÿฆ€ Mode B: Portable โ€” Root

Best for a dedicated server or VM where the assistant needs elevated access.

sudo -E "$(command -v claude || echo ~/.local/bin/claude)"
# then: /oc-setup โ†’ choose Mode B
  • Python venv inside the project folder (same as A)
  • Runs as root for full system access
  • Commands for the regular user: sudo -u <username> <command>
  • Still asks permission before destructive operations (add --dangerously-skip-permissions for autonomous mode โ€” run the IS_SANDBOX=1 lines from Mode C first if using this flag)
๐Ÿฆ€ Mode C: System Install โ€” Full Root, No Guardrails

Best for sandboxes, VMs, or containers designated for ClawedBack. Not for machines with important data. ๐Ÿฆ€

# Set sandbox flag (both user and root)
echo 'export IS_SANDBOX=1' >> ~/.bashrc && source ~/.bashrc
sudo bash -c 'echo "export IS_SANDBOX=1" >> /root/.bashrc'

# Start Claude as root with no permission prompts
sudo -E "$(command -v claude || echo ~/.local/bin/claude)" --dangerously-skip-permissions
# then: /oc-setup โ†’ choose Mode C
  • System Python directly (--break-system-packages), no venv
  • Root with --dangerously-skip-permissions โ€” Claude can do anything without asking
  • Maximum capability, zero guardrails

WARNING: Only use Mode C on a system that is fully backed up, sandboxed, or designated for this purpose. Claude will have unrestricted root access with no confirmation prompts.

Step 5: Run the setup wizard

/oc-setup

The wizard handles everything: installs dependencies, starts the server, generates your auth token, offers voice (Whisper) setup, and begins polling. Open the URL it gives you, paste the token, and start chatting. ๐Ÿฆ€

To detach tmux (keeps ClawedBack running): Ctrl+B, then D To reattach later: tmux attach -t clawedback

Restarting After a Reboot

If the tmux session died (reboot, crash, etc.), start a new one and resume:

tmux new -s clawedback
cd /path/to/ClawedBack
claude    # (or sudo -E ... for root modes)

Then run:

/start

This ensures the server is up, creates the polling cron job, and runs one poll cycle. Run /start whenever you restart Claude Code. ๐Ÿฆ€

If the config file is missing (deleted or corrupted), use /oc-resume instead โ€” it auto-detects and rebuilds the config.

Updating ClawedBack

To pull the latest updates from GitHub:

/oc-update

This fetches upstream changes, shows what's new, and applies them โ€” preserving your data/, auth token, config, and any custom skills you've installed. If server files changed, it automatically restarts the server. ๐Ÿฆ€


๐Ÿฆ€ Features

โœ… Implemented

  • ๐ŸŒ Web chat interface โ€” dark theme, mobile-responsive, full markdown rendering
  • ๐Ÿ“Ž File uploads โ€” drag-and-drop, analyze any file type
  • ๐Ÿ“ Organized file system โ€” date-based storage with temporary share links
  • ๐ŸŽค Voice messages โ€” recorded in-browser, transcribed with Whisper (CPU or GPU)
  • ๐Ÿ” Token auth โ€” auto-generated or custom, single-user security
  • ๐Ÿ—„๏ธ Message queue โ€” SQLite with WAL mode, CLI interface for skills
  • ๐Ÿ“ก SSE streaming โ€” fetch-based with auth header, cross-device sync
  • โœ… Read receipts โ€” green checkmark when Claude reads your message
  • ๐Ÿ”’ SSL/HTTPS โ€” --ssl flag, custom cert paths, or free Let's Encrypt via /oc-ssl
  • ๐Ÿค– 17 custom skills โ€” routing, sessions, approvals, automation, webhooks, file sharing, updates
  • โฐ Scheduled tasks โ€” reminders, recurring jobs, cron expressions
  • ๐Ÿ”— Webhook ingestion โ€” receive events from GitHub, CI, custom services
  • โœ‹ Approval gates โ€” single gates and multi-step workflow chains with crash recovery
  • ๐Ÿงฉ Skill marketplace โ€” browse ClawHub, import with security scanning
  • ๐Ÿ” Security scanning โ€” mandatory audit of imported skills (subagent-isolated, 5-category scan)
  • ๐Ÿ“บ Channel registry โ€” extensible adapter system for future platforms
  • ๐Ÿ”„ Self-updating โ€” /oc-update pulls latest while preserving config/data
  • ๐Ÿฉบ Self-healing resume โ€” /oc-resume auto-detects setup if config is missing
  • ๐Ÿ–ฅ๏ธ Three install modes โ€” user, root, or full root with no guardrails

๐Ÿ”ฎ Planned

  • ๐Ÿฆ€ Browser automation (Playwright)
  • ๐Ÿฆ€ Device nodes (remote command execution)
  • ๐Ÿฆ€ TTS voice responses

๐Ÿฆ€ Tool Compatibility (19/23 Matched)

OpenClaw has 23 built-in tools. Claude Code matches 19 of them out of the box โ€” and the 4 missing are all API wrappers that can be built as skills. Full mapping in .claude/skills/oc-hub/references/tool-mapping.md. ๐Ÿฆ€

Status Count Tools
โœ… Direct match 13 execโ†’Bash, readโ†’Read, writeโ†’Write, editโ†’Edit, apply_patchโ†’Edit, web_searchโ†’WebSearch, web_fetchโ†’WebFetch, cronโ†’CronCreate, subagentsโ†’Agent, agents_listโ†’TaskList, image analyzeโ†’Read, +Grep, +Glob
๐Ÿ”ง Close match 6 code_executionโ†’Bash+venv, browserโ†’Playwright, messageโ†’oc-respond, agent sendโ†’Agent+claude -p, session_statusโ†’TaskGet, ttsโ†’edge-tts
โŒ Missing 4 x_search (needs xAI API), image_generate (needs DALL-E), video_generate (niche), canvas (OpenClaw-specific)

Claude Code actually has tools OpenClaw doesn't: dedicated Grep (ripgrep-powered), Glob (fast pattern matching), multimodal Read (images, PDFs, notebooks), and typed sub-agents with model selection. ๐Ÿฆ€


๐Ÿฆ€ How It Works

๐ŸŒ Web UI  โ†’  ๐Ÿ FastAPI Server  โ†’  ๐Ÿ—„๏ธ SQLite Queue  โ†’  ๐Ÿฆ€ Claude Code  โ†’  ๐Ÿ’ฌ Response
  1. You chat through a web interface (text, files, or voice ๐ŸŽค)
  2. Python catches it โ€” FastAPI server queues your message in SQLite
  3. Claude Code polls โ€” hybrid polling checks the queue (1min idle / 10s active)
  4. Claude thinks โ€” full Claude Code capabilities: tools, web search, code execution, file ops
  5. Response flows back โ€” through the queue, via SSE, into your browser

๐Ÿฆ€ Hybrid Polling (The Clever Bit)

Instead of burning tokens polling an empty queue every 10 seconds, ClawedBack uses a two-speed approach:

State Method Interval Cost
๐Ÿ˜ด Idle CronCreate 1 minute Minimal
๐Ÿ’ฌ Active /loop 10 seconds Higher, but responsive

When you send a message, polling escalates to 10s. After 5 minutes of silence, it de-escalates back to 1min. This keeps resource and token usage minimal while maintaining responsive functionality. ๐Ÿฆ€

๐Ÿฆ€ Architecture

Skills-First Design

Everything that involves reasoning is a Claude Code skill. Python handles only persistent I/O.

Layer What Why Not a Skill?
๐Ÿ Python Web server, SQLite queue, Whisper Needs persistent sockets/processes
๐Ÿฆ€ Skills Routing, sessions, tools, approvals, automation Claude does this natively
๐Ÿค– Agents Code review, debugging, research Specialized subagent delegation

Custom Skills

Skill Purpose
oc-poll ๐Ÿฆ€ Hybrid polling controller (the heartbeat)
oc-router ๐Ÿฆ€ Message routing and intent dispatch
oc-session ๐Ÿฆ€ Conversation state management
oc-respond ๐Ÿฆ€ Response formatting and queue delivery
oc-approve ๐Ÿฆ€ Approval gate for dangerous operations
oc-tools ๐Ÿฆ€ Tool execution coordinator
oc-voice ๐Ÿฆ€ Voice message processing
oc-automate ๐Ÿฆ€ Scheduled tasks and reminders
oc-webhook ๐Ÿฆ€ Incoming webhook handler
oc-channel ๐Ÿฆ€ Channel adapter registry
oc-hub ๐Ÿฆ€ Skill marketplace with security scanning
oc-files ๐Ÿฆ€ File storage and temporary share links
oc-setup ๐Ÿฆ€ First-run setup wizard
oc-resume ๐Ÿฆ€ Self-healing restart
oc-update ๐Ÿฆ€ Safe upstream updates
oc-ssl ๐Ÿฆ€ Let's Encrypt certificate setup
oc-token ๐Ÿฆ€ Auth token management

OpenClaw โ†’ ClawedBack Mapping

OpenClaw Concept ClawedBack Equivalent
Gateway (WebSocket) FastAPI + SQLite queue
Agent Runtime (Pi) Claude Code itself
Channels (23+) Channel adapter skills (web first)
ClawHub (marketplace) oc-hub skill
Tools system Claude Code native tools
Approval workflows oc-approve skill
Cron/automation CronCreate + oc-automate
Sessions oc-session skill + JSON files
Voice I/O Whisper + browser MediaRecorder
Device nodes Planned (via SSH skills)

๐Ÿฆ€ How Is This Different From OpenClaw?

OpenClaw ClawedBack
Architecture TypeScript monolith Claude Code skills โ€” minimal footprint
Runtime Custom Pi agent + WebSocket daemon Claude Code itself โ€” no separate runtime
Resource usage Always-on process, persistent connections Idle polling at 1min, escalates only when active
Dependencies Node.js, npm, 23+ channel adapters Python (lightweight I/O only), everything else is skills
Skills ClawHub Claude Code skills (ClawHub-compatible)
Setup npm install + config files claude โ†’ /oc-setup

In short: OpenClaw is a full platform you deploy and run. ClawedBack is a set of Claude Code skills with lightweight I/O โ€” minimal resources, no background daemons, scales down to near-zero when idle. ๐Ÿฆ€

๐Ÿฆ€ ClawHub Skill Compatibility

OpenClaw and Claude Code skills share the same base format. Both use the AgentSkills spec โ€” Markdown with YAML frontmatter in a SKILL.md file. You can import skills from ClawHub directly into ClawedBack. ๐Ÿฆ€

/oc-hub import <clawhub-skill-slug-or-url>

All imports undergo a mandatory security scan (isolated subagent, 5-category audit) before installation. ~25% of ClawHub skills contain call-home behavior โ€” ClawedBack catches and optionally remediates these before they touch your system.

Field Action
name, description Kept as-is
user-invocable, disable-model-invocation Kept as-is
Markdown body (instructions) Kept as-is โ€” it's the same format
metadata.openclaw (OS gating, binary reqs, installers) Stripped (not applicable in Claude Code)
command-dispatch, command-tool Stripped (OpenClaw-specific dispatch)
allowed-tools Added โ€” inferred from the skill's instructions

๐Ÿฆ€ Project Structure

clawed-back/
โ”œโ”€โ”€ ๐Ÿฆ€ .claude/skills/         # The brain
โ”‚   โ”œโ”€โ”€ oc-*/                  # OpenClaw-style functions
โ”‚   โ””โ”€โ”€ (toolkit skills)       # wizard, tdd, code-review, etc.
โ”‚
โ”œโ”€โ”€ ๐Ÿค– .claude/agents/         # Specialist subagents
โ”œโ”€โ”€ ๐Ÿ“‹ CLAUDE.md               # Project config
โ””โ”€โ”€ ๐Ÿ“‹ post_install.md         # First-run guide

๐Ÿฆ€ Contributing

If you want to help:

  1. Try it out and report issues
  2. Build a channel adapter (Telegram, Discord, Slack)
  3. Create skills for the marketplace
  4. Improve the web UI

๐Ÿฆ€ Disclaimer

All interactions with Claude Code are human-initiated. Recurring tasks use Claude Code's built-in scheduling features (CronCreate, /loop). This project is not affiliated with, endorsed by, or sponsored by Anthropic.

๐Ÿฆ€ Credits

  • OpenClaw โ€” the original inspiration
  • Whisper โ€” voice transcription

๐Ÿฆ€ License

AGPL-3.0


Powered by crabs. ๐Ÿฆ€๐Ÿฆ€๐Ÿฆ€

For questions or concerns, please contact rm28-legal@pm.me

About

๐Ÿฆ€ A port of OpenClaw to Claude Code โ€” personal AI assistant built with skills + minimal Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors