Clotion
Autonomous development automation with Claude Code and Notion.
Move a Notion card from Backlog to "Todo" and Clotion takes over — it creates an isolated git worktree, runs Claude Code to implement the work, posts progress updates, and opens a PR when done. Move to "Done" and the PR auto-merges.
Installation
# 1. Clone the repository
git clone https://github.com/ianborders/clotion.git
cd clotion
# 2. Install the clotion command
pip install clotion
# 3. Create your config
cp .env.example .env
Edit .env with your API keys (see Configuration below).
Updating
pip install -U clotion
Quick Start
Start Clotion from the cloned directory:
cd clotion
clotion
Important: Always run
clotionfrom the cloned repository directory. Configuration is loaded from.envin the current working directory.
How It Works
- Move card from Backlog → Todo — Clotion picks it up
- Automatic implementation — Creates isolated git worktree, runs Claude Code
- Progress updates — Updates "Current Status" property as it works
- Blocked? — Sets "Blocked" checkbox, posts a comment asking for help
- Complete — Pushes code, creates PR, moves to "In Review"
- Move to "Done" — PR auto-merges, worktree cleaned up
Prerequisites
- Python 3.10+
- Claude Code CLI installed and authenticated
- GitHub CLI (
gh) installed and authenticated - Notion workspace with a database/kanban board
- Notion integration with access to your database
Configuration
Create a .env file:
# Notion Integration
NOTION_API_KEY=secret_xxx # Your Notion integration token
NOTION_DATABASE_ID=xxx # ID of your kanban database
# Notion Status Values (must match your Status property options)
NOTION_STATUS_BACKLOG=Backlog
NOTION_STATUS_TODO=Todo
NOTION_STATUS_IN_PROGRESS=In Progress
NOTION_STATUS_IN_REVIEW=In Review
NOTION_STATUS_DONE=Done
# Repository
REPO_PATH=/path/to/your/repo # The repo Clotion will work on
# Polling
POLL_INTERVAL=5 # Seconds between checking for changes
Setup
1. Create a Notion Integration
- Go to Notion Integrations
- Click New integration
- Name it "Clotion" and select your workspace
- Copy the Internal Integration Token (starts with
secret_) - Add this token to your
.envasNOTION_API_KEY
2. Share Your Database with the Integration
- Open your Notion database/kanban board
- Click Share in the top right
- Click Invite and select your "Clotion" integration
- Copy the Database ID from the URL:
- URL format:
notion.so/{workspace}/{database_id}?v=... - The database ID is the 32-character string after your workspace name
- URL format:
3. Create the Status Property
Your database needs a Status property (Select type) with these options:
- Backlog
- Todo
- In Progress
- In Review
- Done
Clotion will auto-create these additional properties on first run:
- Blocked (Checkbox) — Red indicator when Claude needs help
- Current Status (Text) — Real-time activity updates
- Clotion ID (Text) — Unique task identifier (CLO-001, etc.)
- Branch (Text) — Git branch name
- PR URL (URL) — Link to GitHub PR
4. Run
clotion
Clotion starts polling your Notion database for changes.
Usage
| Action | Result |
|---|---|
| Move card Backlog → Todo | Clotion starts working |
| Claude gets stuck | "Blocked" checkbox set, comment posted |
| Reply to comment | Clotion resumes |
| Task complete | PR created, card → "In Review" |
| Move card → Done | PR merges, worktree cleaned up |
Troubleshooting
Clotion not detecting changes
- Verify the database is shared with your integration
- Check
NOTION_DATABASE_IDis correct (32 chars, no dashes) - Ensure Status property values match exactly
Claude not starting
- Run
claudemanually to verify CLI is installed and authenticated - Check
REPO_PATHexists and is a git repository
Tasks stuck with "Blocked" checkbox
- Check Notion page comments for Claude's question
- Reply to unblock (detected on next poll)
How It Uses Claude Code
Clotion runs Claude Code CLI in headless mode using your Claude Code subscription (not API credits). It's the same Claude you use interactively, just automated.
License
MIT
Metadata
Release files for clotion 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| clotion-0.1.0.tar.gz | 30.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| clotion-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 69.2 kB
Release files / clotion-0.1.0.tar.gz
| Download URL | clotion-0.1.0.tar.gz |
|---|---|
| Size | 30.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
996a071a1e4f27bc8e04b6bd23fa33c6cdb98ae228fde09d74f7b049edb88bc3
|
|
BLAKE2b-256 checksum How to use checksums |
0eca2abfd4d137665fc15c1bdfa5690f27d8d3978ea3b06392e0131c68c000e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / clotion-0.1.0-py3-none-any.whl
| Download URL | clotion-0.1.0-py3-none-any.whl |
|---|---|
| Size | 38.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
138ce421311542e8a5e8759beebbf4847b186164c37ea0a05e7c52135b26154f
|
|
BLAKE2b-256 checksum How to use checksums |
597fae782c255584c8f18c101dfdd6e4b9dd92f495087ac7807312646807ec69
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|