Sahaidachny
Autonomous AI agent orchestrator for hierarchical task execution in Claude Code and Codex
Installation • Quick Start • How It Works • Documentation
Named after Petro Sahaidachny, the legendary Ukrainian Cossack hetman known for strategic planning and decisive execution.
What is Sahaidachny?
Sahaidachny solves a fundamental problem in AI-assisted coding: how to reliably implement complex features that span multiple files, require architectural decisions, and need verification.
It's a Claude Code plugin for planning plus a runner-agnostic execution loop that enables:
- Structured Planning — Build hierarchical task specifications with user stories, design decisions, code changes, and test specs
- Autonomous Execution — Run agentic loops across multiple context windows that implement, verify, and iterate
- State Persistence — Maintain learnings and progress between iterations, enabling resume after interruption
Why Not Just Prompt Claude?
| Aspect | Simple Prompting | Sahaidachny |
|---|---|---|
| Task structure | Single prompt | Hierarchical artifacts |
| Planning | Ad-hoc | Guided workflow |
| Implementation | One-shot | Iterative with feedback |
| Verification | Manual | Automated DoD checks |
| Code quality | Hope for the best | Ruff, ty, complexity checks |
| State | Lost on context switch | Persisted to disk |
Installation
Complete Installation Guide (From Scratch)
Don't have Python or any tools installed? No problem! Follow these steps:
Step 1: Install Python 3.11+
macOS:
# Using Homebrew (recommended)
brew install python@3.11
Linux (Ubuntu/Debian):
sudo apt update
sudo apt install python3.11 python3.11-venv python3-pip
Windows: Download from python.org (version 3.11 or higher)
Step 2: Install uv (Fast Python Package Manager)
# macOS/Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
# Windows (PowerShell)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
Restart your terminal after installation.
Step 3: Install Sahaidachny
uv tool install sahaidachny
Alternative options:
Using pipx (recommended for CLI tools):
pipx install sahaidachny
Using pip:
pip install sahaidachny
Step 4: Install a CLI for Planning
Claude Code is recommended for /saha:* slash-command planning:
# macOS/Linux
curl -fsSL https://install.claude.ai | sh
# Verify installation
claude --version
For Windows or detailed instructions, see: https://docs.anthropic.com/en/docs/claude-code
Optional CLIs:
# Codex CLI
codex --version
# Gemini CLI
gemini --version
Step 5: Verify Everything Works
# Check Sahaidachny
saha version
saha tools
# Check Claude Code
claude --version
You should see version information for both tools. You're ready to go! 🚀
Optional: Install Quality Tools
For the execution loop to run code quality checks, install these tools:
uv tool install ruff # Linting and formatting
uv tool install ty # Type checking
uv tool install complexipy # Complexity analysis
uv pip install pytest # Testing
Install from Source (For Development)
git clone https://github.com/roman-romanov-o/sahaidachny.git
cd sahaidachny
uv tool install .
Quick Start
1. Sync Artifacts to Local CLI Directories
# Sync .claude, .codex, and .gemini in current project
saha sync --target all
2. Launch Your Preferred Planning CLI
saha claude
# or
saha codex
# or
saha gemini
/saha:* slash commands are Claude Code features. For Codex/Gemini, use synced artifacts in .codex/ or .gemini/ as local planning resources.
3. Initialize a Task
# In Claude Code:
/saha:init user-authentication --mode=full
4. Plan the Task
/saha:research # Explore codebase (for existing projects)
/saha:task # Define what to build
/saha:stories # Generate user stories
/saha:verify # Approve artifacts
/saha:plan # Create implementation phases
5. Execute Autonomously
# Back in terminal:
saha run task-01
To run execution agents with Codex instead of Claude Code, set:
export SAHA_AGENTS__DEFAULT_RUNNER=codex
Or run a single task with Codex:
saha run task-01 --runner codex
6. Monitor Progress
saha status task-01 --verbose
How It Works
Sahaidachny operates in two phases:
Phase 1: Planning (Interactive)
You work with Claude Code using slash commands to create structured task artifacts:
/saha:init → /saha:research → /saha:task → /saha:stories → /saha:plan
This produces a task folder with:
task-01/
├── task-description.md # What to build
├── user-stories/ # Requirements with acceptance criteria
├── design-decisions/ # Architecture decisions
├── implementation-plan/ # Phased execution steps
└── test-specs/ # Test specifications
Phase 2: Execution (Autonomous)
The agentic loop runs without intervention:
┌─────────────────┐
│ Implementation │ ← Write code according to plan
└────────┬────────┘
▼
┌─────────────────┐
│ QA │ ← Verify acceptance criteria
└────────┬────────┘
│
DoD achieved? ──No──┐
│ │
Yes │
▼ │
┌─────────────────┐ │
│ Code Quality │ │
└────────┬────────┘ │
│ │
Quality passed? ─No──┤
│ │
Yes │
▼ ▼
┌─────────────────┐ ┌──────────┐
│ Manager │ │ fix_info │
└────────┬────────┘ └────┬─────┘
▼ │
┌─────────────────┐ │
│ DoD Check │ │
└────────┬────────┘ │
│ │
Task complete? ──No────┘
│
Yes
▼
DONE
Each iteration learns from previous failures via fix_info, enabling targeted fixes.
Planning Commands
| Command | Purpose |
|---|---|
/saha:init |
Create task folder structure |
/saha:research |
Explore codebase patterns |
/saha:task |
Define task description |
/saha:stories |
Generate user stories |
/saha:decide |
Record design decisions |
/saha:contracts |
Define code changes |
/saha:test-specs |
Write test specifications |
/saha:plan |
Create implementation phases |
/saha:verify |
Approve artifacts |
/saha:status |
Show planning progress |
Execution Commands
| Command | Purpose |
|---|---|
saha run <task-id> |
Execute task autonomously |
saha resume <task-id> |
Resume interrupted execution |
saha status [task-id] |
Check execution status |
saha tools |
List available quality tools |
saha clean [task-id] |
Remove execution state |
saha sync [--target ...] |
Sync local CLI artifacts |
saha claude |
Launch Claude Code with plugin |
saha codex |
Launch Codex CLI with synced artifacts |
saha gemini |
Launch Gemini CLI with synced artifacts |
To stop a running loop, press Ctrl+C. Sahaidachny will stop the current agent, run the Manager to update task artifacts, and mark the task as stopped so you can resume later.
Code Quality Tools
The execution loop integrates with:
- Ruff — Fast Python linter
- ty — Fast Python type checker
- complexipy — Cognitive complexity analyzer
- pytest — Test runner
Configuration
Configure via environment variables (prefix: SAHA_) or .env file:
SAHA_MAX_ITERATIONS=15
SAHA_RUNNER=claude
SAHA_TOOL_COMPLEXITY_THRESHOLD=20
SAHA_HOOK_NTFY_ENABLED=true
# Use Codex for execution agents
# SAHA_AGENTS__DEFAULT_RUNNER=codex
# SAHA_CODEX_MODEL=o3
# SAHA_CODEX_DANGEROUSLY_BYPASS_SANDBOX=false
# SAHA_CLAUDE_DANGEROUSLY_SKIP_PERMISSIONS=false
Documentation
- User Guide — Complete usage guide
- Architecture — Developer reference
Status
Alpha — Actively developed. API may change.
License
Built for Claude Code planning and multi-runner execution (Claude Code, Codex, Gemini)
Metadata
Release files for sahaidachny 0.11.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 | Provenance | Actions |
|---|---|---|---|---|
| sahaidachny-0.11.0.tar.gz | 180.0 kB | With provenance | Details for sahaidachny-0.11.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sahaidachny-0.11.0-py3-none-any.whl | Python 3 | none | any | Details for sahaidachny-0.11.0-py3-none-any.whl |
Total release size: 418.2 kB
Release files / sahaidachny-0.11.0.tar.gz
| Download URL | sahaidachny-0.11.0.tar.gz |
|---|---|
| Size | 180.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a177c7f7452b2e5250c65be967a6f20a44a5ae0360134e53da54cb0e0e619102
|
|
BLAKE2b-256 checksum How to use checksums |
02594ba986b749574075cc0cc0275946f02d9342cefafcf2dd21f14331c1d298
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.
Transparency logRelease files / sahaidachny-0.11.0-py3-none-any.whl
| Download URL | sahaidachny-0.11.0-py3-none-any.whl |
|---|---|
| Size | 238.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
61c98aabd7a9e18dca3991b598d49728c7da0f0545cc2ce245fb965f90fb46b5
|
|
BLAKE2b-256 checksum How to use checksums |
ea550f5013e408008e88dcb4ed44784cc0092b6917f8dd3e752de4d2cac1894d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.
Transparency logSecurity for sahaidachny 0.11.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for sahaidachny-0.11.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 22, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.