Skip to main content

Autonomous development automation with Claude Code and Notion

Project description

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 clotion from the cloned repository directory. Configuration is loaded from .env in the current working directory.

How It Works

  1. Move card from Backlog → Todo — Clotion picks it up
  2. Automatic implementation — Creates isolated git worktree, runs Claude Code
  3. Progress updates — Updates "Current Status" property as it works
  4. Blocked? — Sets "Blocked" checkbox, posts a comment asking for help
  5. Complete — Pushes code, creates PR, moves to "In Review"
  6. 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

  1. Go to Notion Integrations
  2. Click New integration
  3. Name it "Clotion" and select your workspace
  4. Copy the Internal Integration Token (starts with secret_)
  5. Add this token to your .env as NOTION_API_KEY

2. Share Your Database with the Integration

  1. Open your Notion database/kanban board
  2. Click Share in the top right
  3. Click Invite and select your "Clotion" integration
  4. 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

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_ID is correct (32 chars, no dashes)
  • Ensure Status property values match exactly

Claude not starting

  • Run claude manually to verify CLI is installed and authenticated
  • Check REPO_PATH exists 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clotion-0.1.0.tar.gz (30.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clotion-0.1.0-py3-none-any.whl (38.6 kB view details)

Uploaded Python 3

File details

Details for the file clotion-0.1.0.tar.gz.

File metadata

  • Download URL: clotion-0.1.0.tar.gz
  • Upload date:
  • Size: 30.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for clotion-0.1.0.tar.gz
Algorithm Hash digest
SHA256 996a071a1e4f27bc8e04b6bd23fa33c6cdb98ae228fde09d74f7b049edb88bc3
MD5 974f7cd612ed166435274eeb52b1c35b
BLAKE2b-256 0eca2abfd4d137665fc15c1bdfa5690f27d8d3978ea3b06392e0131c68c000e7

See more details on using hashes here.

File details

Details for the file clotion-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: clotion-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 38.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for clotion-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 138ce421311542e8a5e8759beebbf4847b186164c37ea0a05e7c52135b26154f
MD5 f93150da3ab012eb1018297b678de7f2
BLAKE2b-256 597fae782c255584c8f18c101dfdd6e4b9dd92f495087ac7807312646807ec69

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page