Skip to main content

Self-maintaining .claude/ runtime — LLM-powered doc review, project map, task queue, auto-fix, and project init

Project description

cmdop-claude

Self-maintaining .claude/ runtime. Turns a static config folder into living project memory — LLM-powered documentation review, project map generation, task queue, auto-fix, and project initialization.

$0.001 per full cycle (scan → review → fix → map) using DeepSeek V3.2 via SDKRouter.

What it does

Feature Description
Review Detects stale docs, contradictions, and gaps in .claude/ files
Fix Generates targeted fixes for review issues (dry-run + apply)
Init Bootstraps CLAUDE.md + rules for bare projects
Map Auto-generates project-map.md with LLM-annotated directory descriptions
Tasks Structured task queue from review items or manual creation

Install

pip install cmdop-claude

# With Streamlit dashboard
pip install cmdop-claude[ui]

# Dev
pip install -e ".[dev]"

Quick Start

MCP Server (11 tools for Claude Code)

pip install cmdop-claude
python -m cmdop_claude.sidecar.hook register    # adds to ~/.claude.json

Registered globally — available to all Claude Code projects. To unregister:

python -m cmdop_claude.sidecar.hook unregister
Tool LLM? Description
sidecar_scan yes Run documentation review
sidecar_review no Read current review
sidecar_status no Last run, pending items, token usage
sidecar_acknowledge no Suppress item for N days
sidecar_map yes Generate/update project map
sidecar_map_view no Read current map
sidecar_tasks no List tasks by status
sidecar_task_update no Update task status
sidecar_task_create no Create manual task
sidecar_fix yes Generate fix for a task (dry-run or apply)
sidecar_init yes Bootstrap .claude/ for bare projects

CLI Hooks

python -m cmdop_claude.sidecar.hook register             # add to ~/.claude.json
python -m cmdop_claude.sidecar.hook unregister           # remove from ~/.claude.json
python -m cmdop_claude.sidecar.hook scan
python -m cmdop_claude.sidecar.hook status
python -m cmdop_claude.sidecar.hook map-update           # debounced
python -m cmdop_claude.sidecar.hook inject-tasks         # for UserPromptSubmit
python -m cmdop_claude.sidecar.hook fix <task_id> [--apply]
python -m cmdop_claude.sidecar.hook init
python -m cmdop_claude.sidecar.hook acknowledge <id> [days]

Integration with Claude Code hooks:

{
  "hooks": {
    "PostToolUse": [{
      "matcher": "Write|Edit",
      "command": "python -m cmdop_claude.sidecar.hook map-update"
    }],
    "UserPromptSubmit": [{
      "command": "python -m cmdop_claude.sidecar.hook inject-tasks"
    }]
  }
}

Python API

from cmdop_claude import Client

client = Client()

# Review → find issues
result = client.sidecar.generate_review()

# Fix a specific task
fix = client.sidecar.fix_task("T-001", apply=True)

# Init bare project
init = client.sidecar.init_project()

# Generate project map
project_map = client.sidecar.generate_map()

Streamlit Dashboard

make run   # http://localhost:8501

Configuration

Variable Default Description
CMDOP_CLAUDE_DIR_PATH .claude Path to .claude directory
SDKROUTER_API_KEY API key for SDKRouter
CLAUDE_CP_SIDECAR_MODEL deepseek/deepseek-v3.2 LLM model for sidecar
CMDOP_DEBUG_MODE false Debug logging

File Layout

.claude/
├── CLAUDE.md                # project instructions
├── project-map.md           # auto-generated structure map
├── rules/*.md               # coding rules
└── .sidecar/                # runtime state (git-ignored)
    ├── review.md            # latest review
    ├── history/*.md         # past reviews
    ├── tasks/T-001.md       # task queue (YAML frontmatter + md)
    ├── map_cache.json       # annotation cache (SHA256)
    ├── usage.json           # daily token tracking
    └── suppressed.json      # acknowledged items

Architecture

src/cmdop_claude/
├── _config.py                  # Pydantic Settings
├── models/
│   ├── sidecar.py              # Review, Fix, Init models
│   ├── project_map.py          # Map models
│   └── task.py                 # Task models
├── services/
│   └── sidecar_service/        # Decomposed into domain mixins
│       ├── _base.py            # State, lock, scan, usage
│       ├── _review.py          # LLM review + review.md
│       ├── _fix.py             # LLM fix for tasks
│       ├── _init.py            # LLM project init
│       ├── _tasks.py           # Task CRUD
│       ├── _mcp.py             # MCP registration
│       └── _status.py          # Status + map access
├── sidecar/
│   ├── server.py               # FastMCP server (11 tools)
│   ├── hook.py                 # CLI (7 commands)
│   ├── scanner.py              # .claude/ filesystem scanner
│   ├── mapper.py               # Project map generator
│   ├── exclusions.py           # Junk filter + .gitignore
│   ├── cache.py                # SHA256 annotation cache
│   ├── tasks.py                # Task queue manager
│   └── prompts.py              # LLM prompt templates
└── ui/app.py                   # Streamlit dashboard

Cost

Operation Tokens Cost
Documentation review ~1800 ~$0.0005
Fix a task ~500 ~$0.0001
Project init ~2300 ~$0.0006
Map generation (7 dirs) ~1400 ~$0.0004
Map incremental (cached) 0 $0.00
Tasks / status / read 0 $0.00

Full cycle: ~$0.001. Daily estimate: ~$0.003/day.

Testing

make test   # 273 tests

Development

make patch          # 0.1.0 → 0.1.1
make minor          # 0.1.0 → 0.2.0
make build          # sdist + wheel
make publish        # upload to PyPI
make publish-test   # upload to TestPyPI

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

cmdop_claude-0.1.2.tar.gz (45.2 kB view details)

Uploaded Source

Built Distribution

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

cmdop_claude-0.1.2-py3-none-any.whl (56.1 kB view details)

Uploaded Python 3

File details

Details for the file cmdop_claude-0.1.2.tar.gz.

File metadata

  • Download URL: cmdop_claude-0.1.2.tar.gz
  • Upload date:
  • Size: 45.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for cmdop_claude-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5b70f6e70506404f63a3115b3e2f9974e7704ef568961fa22ad6be26fbb34a0d
MD5 5a1d1fc3d3aa20f7ab7a412bd875632b
BLAKE2b-256 980e9bdca5e110f0093b4fe1cc1e36c02cd5e7904406ce5b25fceaef7873d3db

See more details on using hashes here.

File details

Details for the file cmdop_claude-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: cmdop_claude-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 56.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for cmdop_claude-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a00631beb020aa6d8d4fae7cb2bae38cc1e4a46d92f473730051e3f5f687a502
MD5 472c3e70cc213f34fdbbb429e0a6f15e
BLAKE2b-256 3448c6258dab5a3d3ae1e7c9f3d0088eb109734c946972fd4ee00dbdad60e947

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