Hierarchical task planning and autonomous agentic execution for Claude Code
Project description
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, API contracts, 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
Prerequisites
- Python 3.11+
- Claude Code CLI installed and configured (planning)
- Codex CLI installed and configured (optional for execution)
Install from PyPI (Recommended)
Using pipx (recommended for CLI tools):
pipx install sahaidachny
Using uv:
uv tool install sahaidachny
Using pip:
pip install sahaidachny
Install from Source
For development or latest changes:
git clone https://github.com/roman-romanov-o/sahaidachny.git
cd sahaidachny
uv tool install .
Verify Installation
saha version
saha tools
Quick Start
1. Launch Claude Code with Sahaidachny
saha claude
2. Initialize a Task
# In Claude Code:
/saha:init user-authentication --mode=full
3. 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
4. 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
5. 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 API contracts |
/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 claude |
Launch Claude Code with plugin |
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)
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sahaidachny-0.6.2.tar.gz.
File metadata
- Download URL: sahaidachny-0.6.2.tar.gz
- Upload date:
- Size: 114.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4647e6c4635588762dd3f2677f8dc8ebfe8a0ad267be3793f8accda852e1f4aa
|
|
| MD5 |
acd4875c8a602347f8a4f8bd2afd2f3f
|
|
| BLAKE2b-256 |
aa8c6e61da8f1e5db68ca6d4c238d7833a5562ce0a2e033ba58bb0921245cf7c
|
Provenance
The following attestation bundles were made for sahaidachny-0.6.2.tar.gz:
Publisher:
publish.yml on roman-romanov-o/sahaidachny
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sahaidachny-0.6.2.tar.gz -
Subject digest:
4647e6c4635588762dd3f2677f8dc8ebfe8a0ad267be3793f8accda852e1f4aa - Sigstore transparency entry: 944068706
- Sigstore integration time:
-
Permalink:
roman-romanov-o/sahaidachny@54fd886a95e6dbdc9fd3f021c49bd9e71e1f0620 -
Branch / Tag:
refs/tags/v0.6.2 - Owner: https://github.com/roman-romanov-o
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@54fd886a95e6dbdc9fd3f021c49bd9e71e1f0620 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sahaidachny-0.6.2-py3-none-any.whl.
File metadata
- Download URL: sahaidachny-0.6.2-py3-none-any.whl
- Upload date:
- Size: 161.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7628a5d81f72f679a303aba3073e149135318037f1ca5778711ca456387c7d61
|
|
| MD5 |
676cfd01ae0b7e6a89480d7f25233c15
|
|
| BLAKE2b-256 |
0a1a178db62f99f868cfe6aab636f00bf9b31ce45de2ed7d98cb8bec41d9d068
|
Provenance
The following attestation bundles were made for sahaidachny-0.6.2-py3-none-any.whl:
Publisher:
publish.yml on roman-romanov-o/sahaidachny
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sahaidachny-0.6.2-py3-none-any.whl -
Subject digest:
7628a5d81f72f679a303aba3073e149135318037f1ca5778711ca456387c7d61 - Sigstore transparency entry: 944068734
- Sigstore integration time:
-
Permalink:
roman-romanov-o/sahaidachny@54fd886a95e6dbdc9fd3f021c49bd9e71e1f0620 -
Branch / Tag:
refs/tags/v0.6.2 - Owner: https://github.com/roman-romanov-o
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@54fd886a95e6dbdc9fd3f021c49bd9e71e1f0620 -
Trigger Event:
release
-
Statement type: