How to Set Up a NanoClaw Agent for Content Publishing
Install NanoClaw, configure a scheduled content agent, and have it researching, writing, and publishing posts without you touching a keyboard.
NanoClaw is a lightweight AI assistant built on Anthropic's Claude Agent SDK. Each agent runs in its own Linux container, connects to messaging channels like Telegram or Discord, and can execute scheduled tasks indefinitely. This tutorial shows you how to install it, connect a channel, and configure an agent that publishes content on a recurring schedule.
By the end, you will have an agent that wakes up on a cron schedule, researches a topic, writes a draft, and saves it to a directory (or posts it directly via an API).
What you need
- A Linux server or VPS (Ubuntu 22.04 works fine; a $4–$6/month Hetzner or Railway instance is enough)
- Claude Code installed locally
- An Anthropic API key (get one at console.anthropic.com)
- Docker installed on the server
- A Telegram bot token (or Discord webhook) for notifications
Step 1: Clone and install NanoClaw
SSH into your server and run:
git clone https://github.com/qwibitai/nanoclaw.git
cd nanoclaw
NanoClaw requires Node.js 20 or later. Check your version:
node --version
If it is below 20, install via nvm:
nvm install 20 && nvm use 20
Now open Claude Code in the project directory:
claude
Run the setup skill:
/setup
Claude Code will walk you through:
- Installing npm dependencies
- Configuring your Anthropic API key
- Setting up your container runtime (Docker)
- Starting background services
The whole process takes about five minutes.
Step 2: Connect a messaging channel
NanoClaw routes messages and task outputs through a channel. For content pipelines, Telegram works well because you can forward published content to a channel with thousands of subscribers.
Inside Claude Code, run:
/add-telegram
You will need:
- A Telegram bot token (create one via @BotFather)
- The chat ID of the group or channel you want the bot to post to
The skill handles authentication and writes the credentials to a secure store. Secrets are passed via stdin JSON and never loaded into environment variables.
If you prefer Discord, run /add-discord and provide your bot token and channel ID instead.
Step 3: Create a content group
NanoClaw uses "groups" to organize agents. Each group gets its own CLAUDE.md memory file and an isolated container filesystem. Think of a group as a single-purpose agent with its own context.
Create a group for your content pipeline:
/new-group content-publisher
You will get a directory at ~/.claude/groups/content-publisher/. Open the CLAUDE.md file and add instructions for this agent:
# Content Publisher Agent
You are a content research and writing agent. Your job is to:
1. Search the web for recent developments on a given topic
2. Write a 600-800 word article draft in markdown
3. Save it to /workspace/content/drafts/ with today's date as the filename
4. Send a summary to Telegram when done
Writing rules:
- No em dashes
- No vague openers
- Short paragraphs
- Cite sources with links
- Use concrete numbers and named tools
Save the file. The agent will follow these instructions on every run.
Step 4: Schedule a recurring task
This is where NanoClaw earns its place in a content stack. The built-in task scheduler checks for due tasks every 60 seconds and fires a full Claude agent session.
Inside Claude Code, ask your content-publisher group to schedule a task:
In the content-publisher group, schedule a task: every weekday at 8am, research the latest developments in AI agent tooling, write a 700-word draft, and save it to /workspace/content/drafts/
NanoClaw creates a cron entry and stores it in SQLite. You can verify it:
List all scheduled tasks for content-publisher
The output will show the cron expression, the prompt, and the next run time.
Step 5: Wire the output to publishing
Saving drafts is useful for a human review step. If you want fully autonomous publishing, point the agent to an API instead.
Option A: Post to a static site via Git
Add this to the agent's CLAUDE.md:
After saving the draft, run:
cd /workspace/site && git add content/posts/ && git commit -m "auto: add post [date]" && git push
If the site deploys on push (Railway, Vercel, Netlify), the post goes live within two minutes of the agent finishing.
Option B: Publish to Beehiiv via API
Beehiiv has a REST API. Add an instruction like:
After writing, POST the content to https://api.beehiiv.com/v2/publications/[pub_id]/posts using the BEEHIIV_API_KEY environment variable. Set status to "draft" for review, or "confirm" to publish immediately.
Store the API key as a NanoClaw secret. The agent will read it from the secure store, not from environment variables.
Step 6: Test it manually before the schedule fires
Trigger a one-off run to make sure everything works:
In the content-publisher group: research recent news about autonomous companies, write a 700-word draft, save it to /workspace/content/drafts/test-run.md
Watch the output. You will see the agent:
- Searching the web
- Drafting the article
- Writing the file
- Sending a Telegram summary
If you hit a permissions error on the output directory, run mkdir -p /workspace/content/drafts on the server and make sure the container has that path mounted.
What this costs to run
NanoClaw itself is free and open source. The costs are:
| Resource | Cost | | ----------------------------------- | ---------- | | Hetzner CX22 VPS | $4/month | | Claude API (Sonnet, ~5 tasks/day) | $3-8/month | | Telegram bot | Free | | Beehiiv (free plan, manual publish) | $0 |
A content pipeline running five posts per week costs roughly $10 to $15 per month in total infrastructure.
Troubleshooting
Agent does not run on schedule: Check that the NanoClaw background service is running. Run pm2 status or systemctl status nanoclaw depending on how you installed it.
Container permission errors: Make sure the directory you are writing to is mounted inside the container. Edit the group's container config and add the path.
Telegram messages not arriving: Double-check the bot token and chat ID. The bot must be a member of the channel with posting rights.
Next steps
- Add a second group that reviews drafts for quality before publishing
- Schedule a weekly digest agent that rounds up all posts from the week
- Connect a Slack channel for the editorial team to approve or reject drafts
The NanoClaw GitHub repo has full documentation on skills, group configuration, and agent swarms.