Noddocs

Nod CLI

Open source CLI for running AI coding agents as persistent daemons with mobile control

Overview

The Nod CLI is an open source tool that wraps AI coding agents into persistent, mobile-controlled daemons. It handles background persistence, tool permissions via mobile approval, per-agent isolation, and scheduled tasks.

The CLI currently supports Claude Code as its framework adapter. Support for additional frameworks is planned. See the Claude Code integration guide for details on how the CLI and Channel work together.

What it solves

Running multiple AI coding agents in production is hard without isolation and control. The Nod CLI solves the key challenges:

ChallengeHow Nod CLI solves it
No per-agent isolation — all sessions share the same config, MCPs, and permissionsEach agent gets its own MCP servers, skills, subagents, permissions, memory, and instructions — fully enforced at runtime
Background agents need persistent tool permissionsAsync mobile approval via the Nod app. Permission patterns persist across restarts in per-agent settings files
No structured way to define scoped agent rolesnod connect creates isolated agent profiles with resource scoping — the developer gets GitHub, the assistant gets Gmail
Remote control is limited to basic conversationsFull mobile experience: chat, tool approvals, per-agent activity feed, scheduled tasks, and resource management
Background agents can die or lose session stateOS-level daemons via launchd/systemd with auto-restart, session persistence, and sleep prevention

How it works

Claude Code
AI coding agent
Nod CLI
PreToolUse hooks
Nod Backend
WebSocket + REST
Nod App
Your phone
  • The CLI connects to Nod via WebSocket and stays connected while Claude Code runs.
  • Claude Code's PreToolUse hooks route every tool call through Nod's permission gate. Each call is checked against allow/deny rules before execution.
  • Tools that aren't pre-approved generate a permission card in the Nod app. The user taps Allow, Always Allow, or Deny from their phone.
  • Users can chat with Claude Code from the app — send instructions, ask questions, or provide context.
  • Activity logging tracks what Claude is doing — files read, edits made, commands run.
  • Tasks run in parallel with the main conversation, each in their own isolated session.

Getting started

1

Install the CLI

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

Create an agent in the Nod app

Open the Nod app on your phone. Create a new agent — you'll get an Agent ID and Secret.

3

Open the CLI menu

nod

Running nod without arguments opens the interactive menu. From here you can connect agents, start/stop them, view logs, configure resources, and more — all from one place.

4

Connect an agent

Select connect from the menu. The interactive wizard detects your project's resources (MCP servers, skills, subagents) and lets you configure which resources this agent can access and which tools to auto-approve.

5

Start the agent

Select up from the menu and pick your agent. It starts as a background daemon. Close your terminal — you're now working from your phone.

Per-agent isolation

Every Nod agent is a fully isolated Claude Code environment. During nod connect, you define exactly what each agent can access — like an AGENTS.md but managed through the CLI and enforced at runtime via hooks.

Isolation layerHow it works
MCP serversEach agent only sees its assigned MCPs. The assistant gets Gmail; the developer gets GitHub. Trying to use an unassigned MCP returns a clear error, not a permission prompt.
Skills & subagentsAgents only see skills and subagents enabled for them during setup
Permission rulesPer-agent settings file (settings.nod-<agent>.json) — auto-approve shell commands for the developer, require approval for the assistant
InstructionsCustom system prompt per agent at ~/.nod/agents/<name>/instructions.md
MemoryPersistent memory file per agent at ~/.nod/agents/<name>/memory.md
Context windowEach agent is a separate Claude Code process — no shared token budget
This is the AGENTS.md approach the community has been asking for — but enforced at runtime via hooks, not just instructions that Claude might ignore. Nod writes per-agent settings that Claude Code's native permission system enforces.

Multi-agent setup

Run multiple agents simultaneously, each with its own scoped resources:

# Connect each agent with different resource access
nod connect    # → "assistant" with Gmail, Calendar, Notion
nod connect    # → "developer" with Supabase, GitHub
nod connect    # → "creative" with image generation, web search

# Start them all as background daemons
nod up assistant
nod up developer
nod up creative

# Check status
nod ps
All agents share the same computer but are fully isolated. An agent cannot see or use resources that weren't assigned to it. If the assistant tries to use an image generation MCP, it gets a clear "not available" message — no permission prompt, just a scope block.

Daemon mode

nod up starts the agent as a background daemon managed by the OS. Select up from the nod menu and pick an agent:

FeatureNod CLI daemon
LifetimeRuns indefinitely via launchd (macOS) / systemd (Linux)
Auto-restartKeepAlive (macOS), Restart=always (Linux) — recovers from crashes
Survives rebootYes — RunAtLoad (macOS)
Sleep preventioncaffeinate -i keeps Mac awake while agent runs
Session persistenceSession map saved to disk, resumes on restart
Tool permissionsAsync mobile approval via Nod app, waits indefinitely
Agent isolationEach daemon is a separate process with its own config

Permission system

Every tool call goes through a five-step permission gate:

StepCheckResult
1Deny listBlock immediately if tool matches a deny rule
2Auto-allowAlways allow internal Nod tools (nod-request, nod-activity, etc.)
3Agent scopeBlock if tool uses a resource not enabled for this agent
4Allow listAllow if tool matches a pre-approved pattern (e.g. Bash(npm install *))
5Mobile approvalSend permission card to Nod app and wait for user response

When a user taps Always Allow, the pattern is saved to the agent's settings file. The permission persists across sessions and restarts — no more re-prompting every session.

Scheduled tasks

Tasks are like cron jobs for your agent. Define what to do and when:

# Examples of tasks:
"Check my emails and summarize"         → every weekday at 9am
"Generate a daily news digest"           → every morning at 7am
"Run tests and report failures"          → every 6 hours
"Summarize yesterday's git activity"     → every weekday at 9am

Tasks can be created from the app or proposed by the agent during chat. Each task runs in its own session, in parallel with the main conversation.

Agent tools

ToolPurpose
nod-requestAsk the user for a decision (choice, question, or approval)
nod-activityLog an action to the activity feed
nod-reportSend a structured markdown document (tappable card)
nod-task-createPropose a scheduled or recurring task
nod-task-outputSet the final deliverable for a task run
nod-task-runFetch a previous task run’s output
nod-imageSend an image to the user (inline in chat)
Nod tools are injected via --append-system-prompt-file, so they only exist inside Nod-spawned Claude sessions. Your regular claude sessions in the same project are completely clean.

Commands

Run nod to open the interactive menu, or use commands directly:

CommandDescription
nodOpen the interactive menu (recommended)
nod connectSet up agent credentials, detect resources, configure permissions
nod up <agent>Start agent as a background daemon
nod down <agent>Stop a background agent
nod start <agent>Run agent in the foreground (for debugging)
nod psList all agents with status
nod logs <agent>View agent logs
nod rm <agent>Remove agent
nod config <agent>Interactive config menu
nod doctor [agent]Run diagnostics

Source code

The CLI is fully open source:

FileWhat it does
src/daemon.tsBackground daemon — caffeinate, lifecycle, graceful shutdown
src/core/nod-client.tsWebSocket connection, heartbeat, auto-reconnect
src/core/hook-server.tsHTTP server for PreToolUse hooks and nod-tool scripts
src/core/permission-gate.tsFive-step permission gate with scope enforcement
src/core/claude-adapter.tsClaude Code subprocess management, per-agent settings
src/core/task-scheduler.tsTask polling + real-time WebSocket triggers