Commit Graph

28 Commits

Author SHA1 Message Date
jmr
6cd165f391 feat: Add /add-telegram skill for Telegram channel support (#83)
Add skill to guide users through adding Telegram as a messaging channel.

- Replace WhatsApp or run alongside it
- Support for private chats and groups
- Built-in /chatid command for easy registration
- Flexible triggering: main chat, respondToAll, @mentions, or trigger pattern
- Grammy library for modern TypeScript-first Telegram integration

No source code changes - skill provides step-by-step implementation guide.
2026-02-09 01:48:47 +02:00
Tom Granot
b2bd141650 Fix orphan container cleanup and update installation steps (#149)
Updated instructions for handling orphaned containers and Zod version conflicts. Added critical cleanup steps for the NanoClaw service.
2026-02-09 01:32:48 +02:00
gavrielc
f26468c9b0 fix: setup skill reliability, requiresTrigger option, agent-browser visibility
Setup skill fixes:
- Run QR auth in foreground with long timeout, not background
- Replace fragile message-based registration with DB group sync lookup
- Personal chats: ask for phone number instead of querying empty DB
- Consolidate trigger word + security model + channel selection into one step
- Remove `timeout` shell command (unavailable on macOS), use Bash tool timeout
- Query 40 groups, display 10 at a time, support name lookup

requiresTrigger support:
- Add requiresTrigger field to RegisteredGroup type and DB schema
- Skip trigger check when requiresTrigger is false (for solo/personal chats)
- Main group still always processes all messages (unchanged)

Agent-browser visibility:
- Append global CLAUDE.md to non-main agent system prompts via SDK
- Add browser tool docs to global and main CLAUDE.md
- Update skill description to be broader (not just "web testing")
- Reference agent-browser.md in root CLAUDE.md key files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 01:39:31 +02:00
Tom Granot
1f8cd26a83 Add voice transcription skill using OpenAI Whisper API (#77)
New skill `/add-voice-transcription` that guides users through adding
automatic voice message transcription to NanoClaw.

Features:
- Uses OpenAI Whisper API for transcription (~$0.006/min)
- Provider-agnostic architecture (supports future Groq/Deepgram/local)
- Secure API key storage in gitignored config file
- Graceful fallback when transcription unavailable
- Voice messages stored as `[Voice: <transcript>]` in database

The skill includes:
- Step-by-step implementation guide
- Database and message handler integration
- Configuration options (enable/disable, fallback message)
- Troubleshooting section
- Security notes and cost management tips
- Removal instructions

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-04 13:03:50 +02:00
BaiJunjie
c9ca34a518 Add X integration skill (#52) 2026-02-04 00:27:04 +02:00
Gavriel Cohen
7ff9a65792 Update setup skill to use claude setup-token for auth
Replace manual credential extraction with the proper CLI command.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 21:03:35 +02:00
Tom Granot
1a32bff6ec Improve setup UX with AskUserQuestion tool and security education (#60)
- Add UX note instructing Claude to use AskUserQuestion tool for better
  interactive experience during setup
- Add new Section 7 explaining the main channel's elevated privileges
  (admin control portal) before registration
- Include interactive security acknowledgment with follow-up for users
  choosing shared groups
- Renumber subsequent sections (7→8, 8→9, 9→10)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-03 17:04:45 +02:00
gavrielc
ff23125800 Add Docker support and integrate /convert-to-docker into setup flow
- Update setup skill to detect platform and offer Docker/Apple Container choice
- On Linux, automatically use Docker via /convert-to-docker skill
- On macOS, ask user preference if Apple Container not installed
- Update README to reflect Docker support and Linux compatibility
- Fix exact line number reference in convert-to-docker skill
- Add thank you to @dotsetgreg for the Docker skill contribution

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 13:35:27 +02:00
gavrielc
849b22400b Fix minor issues in add-parallel skill
- Remove unrelated ASSISTANT_NAME from allowedVars example
- Fix log message reference (remove incorrect [agent-runner] prefix)
- Revert unrelated .gitignore addition (.backups/)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 13:23:28 +02:00
Janni Turunen
1b960c563f Add /add-parallel skill for Parallel AI integration (#28)
Adds a skill to integrate Parallel AI MCP servers for advanced web research.

What it adds:
- Quick Search MCP for fast web lookups (free to use)
- Task MCP for deep research with scheduler-based polling
- Non-blocking design using NanoClaw's scheduler

Usage: Run /add-parallel to add this integration to your fork

Follows NanoClaw philosophy:
- Skills over features - integration is optional via skill
- Keeps base codebase lean
- Users run /add-parallel on their fork for clean code

Co-authored-by: Janni Turunen <janni@Jannis-MacBook-Air.local>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-02 13:16:41 +02:00
Greg King
93e639fdb9 Add /convert-to-docker skill for Docker migration (#23)
* Add /convert-to-docker skill for Docker migration

This skill provides step-by-step instructions for migrating NanoClaw
from Apple Container to Docker, enabling cross-platform support
(macOS and Linux).

The skill covers:
- Updating container-runner.ts mount syntax and spawn command
- Replacing the startup check in index.ts
- Updating build.sh commands
- Updating all documentation references
- Updating setup and debug skills
- Verification and testing steps

Addresses the RFS (Request for Skills) item in README.md.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* Remove Container Runtime from RFS section

The /convert-to-docker skill is now being added in this PR,
so it's no longer a "request" - the skill exists.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 09:16:37 +02:00
gavrielc
05a29d562f Security improvements: per-group session isolation, remove built-in Gmail
- Isolate Claude sessions per-group (data/sessions/{group}/.claude/)
  to prevent cross-group access to conversation history
- Remove Gmail MCP from built-in (now available via /add-gmail skill)
- Add SECURITY.md documenting the security model
- Move docs to docs/ folder (SPEC.md, REQUIREMENTS.md, SECURITY.md)
- Update documentation to reflect changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-02 00:07:59 +02:00
gavrielc
17f7b84420 Add /add-gmail skill for Gmail integration
Skill guides users through adding Gmail to NanoClaw with two modes:
- Tool Mode: Agent can read/send emails when triggered from WhatsApp
- Channel Mode: Emails can trigger the agent and receive replies

Includes step-by-step GCP OAuth setup, code integration instructions,
and troubleshooting guidance.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 23:52:05 +02:00
gavrielc
df52232763 Pre-launch fixes: error handling, cleanup, consistency
- Remove unused claude-agent-sdk from host deps (only used in container)
- Remove dead scheduler MCP config (built into IPC)
- Remove unused eslint script
- Add clear error message when Apple Container fails to start
- Auto-generate launchd plist with real paths in setup skill
- Standardize Node.js version to 20+ everywhere

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 23:01:04 +02:00
gavrielc
48822ff67d Add mount security allowlist for external directory access (#14)
* Add secure mount allowlist validation

Addresses arbitrary host mount vulnerability by validating additional
mounts against an external allowlist stored at ~/.config/nanoclaw/.
This location is never mounted into containers, making it tamper-proof.

Security measures:
- Allowlist cached in memory (edits require process restart)
- Real path resolution (blocks symlink and .. traversal attacks)
- Blocked patterns for sensitive paths (.ssh, .gnupg, .aws, etc.)
- Non-main groups forced to read-only when nonMainReadOnly is true
- Container path validation prevents /workspace/extra escape

https://claude.ai/code/session_01BPqdNy4EAHHJcdtZ27TXkh

* Add mount allowlist setup to /setup skill

Interactive walkthrough that asks users:
- Whether they want agents to access external directories
- Which directories to allow (with paths)
- Read-write vs read-only for each
- Whether non-main groups should be restricted to read-only

Creates ~/.config/nanoclaw/mount-allowlist.json based on answers.

https://claude.ai/code/session_01BPqdNy4EAHHJcdtZ27TXkh

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-01 22:55:08 +02:00
gavrielc
016a1a0e31 Add group metadata sync for easier group activation
- Sync group names from WhatsApp via groupFetchAllParticipating()
- Store group names in chats table (jid -> name mapping)
- Daily sync with 24h cache, on-demand refresh via IPC
- Write available_groups.json snapshot for agent (main group only)
- Agent can request refresh_groups via IPC if group not found
- Update documentation in main CLAUDE.md and debug skill

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 22:25:29 +02:00
Claude
49e7875e67 Fix security: only expose auth vars to containers, not full .env
Previously, the entire .env file was copied and mounted into containers,
exposing all environment variables to the agent. Now only the specific
authentication variables needed by Claude Code (CLAUDE_CODE_OAUTH_TOKEN
and ANTHROPIC_API_KEY) are extracted and mounted.

https://claude.ai/code/session_01Y6Az5oUPkYmJhA1N9MUd67
2026-02-01 17:42:29 +00:00
gavrielc
17e7b469f4 Refactor: delete dead code, extract utils, rename files for clarity
- Delete scheduler-mcp.ts (285 lines of dead code, unused)
- Extract loadJson/saveJson to utils.ts (generic utilities)
- Rename auth.ts → whatsapp-auth.ts (more specific)
- Rename scheduler.ts → task-scheduler.ts (more specific)
- Update all references in docs and imports

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 17:35:03 +02:00
gavrielc
552b26cc95 Add PreCompact hook for conversation archiving, remove /clear command
- Add PreCompact hook in agent-runner that archives conversations before
  compaction, using session summary from sessions-index.json for filename
- Remove /clear command (programmatic compaction not supported by SDK)
- Add /add-clear to RFS for future implementation
- Update CLAUDE.md templates with memory system instructions

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 15:37:13 +02:00
Gavriel
fb4ce8dce9 Update project and agent context files
- CLAUDE.md: Concise dev context, references README/REQUIREMENTS
- groups/CLAUDE.md: Proper agent identity for Andy
- groups/main/CLAUDE.md: Add agent identity, keep admin context
- package.json: Update description
- setup skill: Note to update name in multiple places

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 13:03:51 +02:00
Gavriel
1d4cf51917 Support OAuth token authentication as alternative to API key
- Setup skill now asks subscription vs API key, can auto-grab token
- Debug skill updated for both auth methods
- SPEC.md documents both authentication options

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 12:03:06 +02:00
Gavriel
8ca4c95517 Fix session persistence and auto-start container system
- Fix session mount path: ~/.claude/ now mounts to /home/node/.claude/
  (container runs as 'node' user with HOME=/home/node, not root)
- Fix ~/.gmail-mcp/ mount path similarly
- Use absolute paths for GROUPS_DIR and DATA_DIR (required for container mounts)
- Auto-start Apple Container system on NanoClaw startup
- Update debug skill with session troubleshooting guide
- Update spec.md with startup sequence and troubleshooting

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 11:31:52 +02:00
Gavriel
67e0295d82 Fix container execution and add debug tooling
Container fixes:
- Run as non-root 'node' user (required for --dangerously-skip-permissions)
- Add allowDangerouslySkipPermissions: true to SDK options
- Mount .env file to work around Apple Container -i env var bug
- Use --mount for readonly, -v for read-write (Apple Container quirk)
- Bump SDK to 0.2.29, zod to v4
- Install Claude Code CLI globally in container

Logging improvements:
- Write per-run logs to groups/{folder}/logs/container-*.log
- Add debug-level logging for mounts and container args

Documentation:
- Add /debug skill with comprehensive troubleshooting guide
- Update /setup skill with API key configuration step
- Update SPEC.md with container details, mount syntax, security notes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 10:35:08 +02:00
gavrielc
ef24c45413 Update setup skill for container architecture
- Add Apple Container installation step
- Add container image build step
- Renumber subsequent steps

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 22:57:12 +02:00
gavrielc
423d45c52e Update docs to reflect current architecture
- SPEC.md: Add new source files, update config location, document
  conversation catch-up feature, fix message flow description
- customize/SKILL.md: Fix file references (was Python, now TypeScript),
  update launchd service name

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:36:22 +02:00
gavrielc
fe5ae974a3 Improve setup skill: better Gmail explanation, use placeholders
- Explain Gmail/GCP prerequisites upfront before asking
- Replace hardcoded "Andy" with ASSISTANT_NAME placeholder
- Replace hardcoded timestamp with CURRENT_ISO_TIMESTAMP
- Add step 3 to ask user for their preferred trigger word
- Renumber sections accordingly

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:12:19 +02:00
gavrielc
8a385c7988 Separate WhatsApp auth from daemon into standalone script
- Add src/auth.ts for interactive QR code authentication
- Add `npm run auth` script
- Update setup skill for current Node.js architecture
- Daemon (src/index.ts) now only uses stored credentials

Auth is run during setup; daemon assumes credentials exist and
shows macOS notification if re-auth is needed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 19:06:25 +02:00
gavrielc
c17823a732 Initial commit: NanoClaw - Personal Claude assistant via WhatsApp
A minimal Node.js application that connects Claude Agent SDK to WhatsApp
using baileys. Features per-group memory via CLAUDE.md files, session
continuity, scheduled tasks, and Gmail integration via MCP.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 18:54:24 +02:00