agentleFS
sskarzsskarz/nanoclawbster/CLAUDE.md

nanoclawbster

CLAUDE.md2 starsChanged 8 months agoMITView on GitHub

Personal Claude assistant. See README.md for philosophy and setup. See docs/REQUIREMENTS.md for architecture decisions. Single Node.js process that connects to Discord, routes messages to Claude Agent SDK running in containers (Linux VMs). Each group has isolated filesystem and memory. Run commands directly—don't tell the user to run them. Service management: Each registered group has a requires_trigger flag in the DB (registered_groups.requires_trigger): Important: requiresTrigger: true is respected even for the main group folder. This matters when the main group is a…

The file

We split this CLAUDE.md into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run commands directly—don't tell the user to run them.

    line 39

≈ “Common” is an estimate: at least 1 in 5 of the 27,641 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
CLAUDE.md

NanoClawbster

Personal Claude assistant. See README.md for philosophy and setup. See docs/REQUIREMENTS.md for architecture decisions.

Quick Context

Single Node.js process that connects to Discord, routes messages to Claude Agent SDK running in containers (Linux VMs). Each group has isolated filesystem and memory.

Key Files

FilePurpose
src/index.tsOrchestrator: state, message loop, agent invocation
src/channels/discord.tsDiscord connection, mentions, send/receive
src/ipc.tsIPC watcher and task processing
src/router.tsMessage formatting and outbound routing
src/config.tsTrigger pattern, paths, intervals
src/container-runner.tsSpawns agent containers with mounts
src/task-scheduler.tsRuns scheduled tasks
src/webhook-server.tsComposio + RetellAI webhook receiver
src/db.tsSQLite operations
groups/{name}/CLAUDE.mdPer-group memory (isolated)
container/skills/agent-browser.mdBrowser automation tool (available to all agents via Bash)

Skills

SkillWhen to Use
/setupFirst-time installation, authentication, service configuration
/customizeAdding channels, integrations, changing behavior
/debugContainer issues, logs, troubleshooting
/updatePull upstream NanoClawbster changes, merge with customizations, run migrations
/qodo-pr-resolverFetch and fix Qodo PR review issues interactively or in batch
/get-qodo-rulesLoad org- and repo-level coding rules from Qodo before code tasks
/self-improveWrite features, fix bugs, create PRs for the NanoClawbster codebase

Development

Run commands directly—don't tell the user to run them.

npm run dev          # Run with hot reload
npm run build        # Compile TypeScript
./container/build.sh # Rebuild agent container

Service management:

# macOS (launchd)
launchctl load ~/Library/LaunchAgents/com.nanoclawbster.plist
launchctl unload ~/Library/LaunchAgents/com.nanoclawbster.plist
launchctl kickstart -k gui/$(id -u)/com.nanoclawbster  # restart

# Linux (systemd)
systemctl --user start nanoclawbster
systemctl --user stop nanoclawbster
systemctl --user restart nanoclawbster

Trigger Gating (requiresTrigger)

Each registered group has a requires_trigger flag in the DB (registered_groups.requires_trigger):

  • 1 (true) — agent only runs when a message matches TRIGGER_PATTERN (e.g. @Nano). No container spawned, no typing indicator for other messages.
  • 0 (false) — agent runs on every message (e.g. a private self-chat).
  • null — defaults to true for non-main groups, false for the main group.

Important: requiresTrigger: true is respected even for the main group folder. This matters when the main group is a public channel (e.g. Discord #general) where the bot should only respond to @mentions, not every message.

To update via Node:

db.prepare("UPDATE registered_groups SET requires_trigger = 1 WHERE jid LIKE 'dc:%'").run();

Admin Privileges & Agent Tools

Each registered group has an is_admin flag in the DB (registered_groups.is_admin). This controls both tool visibility and IPC authorization.

Admin-only tools (only visible to admin agents via MCP):

  • register_group — register new groups
  • get_stats — usage/system statistics
  • restart_self — restart the host service
  • pull_and_deploy — pull from GitHub, build, optionally rebuild Docker, restart
  • delegate_task — delegate a task to a clean-context coding agent (no conversation history)

All-agent tools (available to every group):

  • send_message, schedule_task, list_tasks, pause_task, resume_task, cancel_task

How it works:

  1. Agent-side gating (container/agent-runner/src/ipc-mcp-stdio.ts): Admin tools are only registered when NANOCLAWBSTER_IS_ADMIN=1 env var is set. Non-admin agents never see them in the tool list.
  2. Host-side enforcement (src/ipc.ts): IPC handler checks isAdminGroupFolder(sourceGroup) against the DB. Admin-only IPC types are rejected if the source group isn't admin.

Security: No agent can modify the is_admin flag. The DB (store/messages.db) is not writable from any container — admin agents get the project root read-only, and the dev workspace is a git clone (store/ is gitignored). The only way to change admin is from the host machine directly:

const Database = require('better-sqlite3');
const db = new Database('store/messages.db');
db.prepare('UPDATE registered_groups SET is_admin = 1 WHERE folder = ?').run('your-folder');
db.prepare('UPDATE registered_groups SET is_admin = 0 WHERE folder = ?').run('old-folder');

Container Build Cache

The container buildkit caches the build context aggressively. --no-cache alone does NOT invalidate COPY steps — the builder's volume retains stale files. To force a truly clean rebuild, prune the builder then re-run ./container/build.sh.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.