The first open-source harness builder for AI coding. Make AI coding deterministic and repeatable.
Find a file
Rasmus Widing 7be4d0a35e
feat(paths,workflows): unify ~/.archon/{workflows,commands,scripts} + drop globalSearchPath (closes #1136) (#1315)
* feat(paths,workflows): unify ~/.archon/{workflows,commands,scripts} + drop globalSearchPath

Collapses the awkward `~/.archon/.archon/workflows/` convention to a direct
`~/.archon/workflows/` child (matching `workspaces/`, `archon.db`, etc.), adds
home-scoped commands and scripts with the same loading story, and kills the
opt-in `globalSearchPath` parameter so every call site gets home-scope for free.

Closes #1136 (supersedes @jonasvanderhaegen's tactical fix — the bug was the
primitive itself: an easy-to-forget parameter that five of six call sites on
dev dropped).

Primitive changes:

- Home paths are direct children of `~/.archon/`. New helpers in `@archon/paths`:
  `getHomeWorkflowsPath()`, `getHomeCommandsPath()`, `getHomeScriptsPath()`,
  and `getLegacyHomeWorkflowsPath()` (detection-only for migration).
- `discoverWorkflowsWithConfig(cwd, loadConfig)` reads home-scope internally.
  The old `{ globalSearchPath }` option is removed. Chat command handler, Web
  UI workflow picker, orchestrator resolve path — all inherit home-scope for
  free without maintainer patches at every new site.
- `discoverScriptsForCwd(cwd)` merges home + repo scripts (repo wins on name
  collision). dag-executor and validator use it; the hardcoded
  `resolve(cwd, '.archon', 'scripts')` single-scope path is gone.
- Command resolution is now walked-by-basename in each scope. `loadCommand`
  and `resolveCommand` walk 1 subfolder deep and match by `.md` basename, so
  `.archon/commands/triage/review.md` resolves as `review` — closes the
  latent bug where subfolder commands were listed but unresolvable.
- All three (`workflows/`, `commands/`, `scripts/`) enforce a 1-level
  subfolder cap (matches the existing `defaults/` convention). Deeper
  nesting is silently skipped.
- `WorkflowSource` gains `'global'` alongside `'bundled'` and `'project'`.
  Web UI node palette shows a dedicated "Global (~/.archon/commands/)"
  section; badges updated.

Migration (clean cut — no fallback read):

- First use after upgrade: if `~/.archon/.archon/workflows/` exists, Archon
  logs a one-time WARN per process with the exact `mv` command:
  `mv ~/.archon/.archon/workflows ~/.archon/workflows && rmdir ~/.archon/.archon`
  The legacy path is NOT read — users migrate manually. Rollback caveat
  noted in CHANGELOG.

Tests:

- `@archon/paths/archon-paths.test.ts`: new helper tests (default HOME,
  ARCHON_HOME override, Docker), plus regression guards for the double-`.archon/`
  path.
- `@archon/workflows/loader.test.ts`: home-scoped workflows, precedence,
  subfolder 1-depth cap, legacy-path deprecation warning fires exactly once
  per process.
- `@archon/workflows/validator.test.ts`: home-scoped commands + subfolder
  resolution.
- `@archon/workflows/script-discovery.test.ts`: depth cap + merge semantics
  (repo wins, home-missing tolerance).
- Existing CLI + orchestrator tests updated to drop `globalSearchPath`
  assertions.

E2E smoke (verified locally, before cleanup):

- `.archon/workflows/e2e-home-scope.yaml` + scratch repo at /tmp
- Home-scoped workflow discovered from an unrelated git repo
- Home-scoped script (`~/.archon/scripts/*.ts`) executes inside a script node
- 1-level subfolder workflow (`~/.archon/workflows/triage/*.yaml`) listed
- Legacy path warning fires with actionable `mv` command; workflows there
  are NOT loaded

Docs: `CLAUDE.md`, `docs-web/guides/global-workflows.md` (full rewrite for
three-type scope + subfolder convention + migration), `docs-web/reference/
configuration.md` (directory tree), `docs-web/reference/cli.md`,
`docs-web/guides/authoring-workflows.md`.

Co-authored-by: Jonas Vanderhaegen <7755555+jonasvanderhaegen@users.noreply.github.com>

* test(script-discovery): normalize path separators in mocks for Windows

The 4 new tests in `scanScriptDir depth cap` and `discoverScriptsForCwd —
merge repo + home with repo winning` compared incoming mock paths with
hardcoded forward-slash strings (`if (path === '/scripts/triage')`). On
Windows, `path.join('/scripts', 'triage')` produces `\scripts\triage`, so
those branches never matched, readdir returned `[]`, and the tests failed.

Added a `norm()` helper at module scope and wrapped the incoming `path`
argument in every `mockImplementation` before comparing. Stored paths go
through `normalizeSep()` in production code, so the existing equality
assertions on `script.path` remain OS-independent.

Fixes Windows CI job `test (windows-latest)` on PR #1315.

* address review feedback: home-scope error handling, depth cap, and tests

Critical fixes:
- api.ts: add `maxDepth: 1` to all 3 findMarkdownFilesRecursive calls in
  GET /api/commands (bundled/home/project). Without this the UI palette
  surfaced commands from deep subfolders that the executor (capped at 1)
  could not resolve — silent "command not found" at runtime.
- validator.ts: wrap home-scope findMarkdownFilesRecursive and
  resolveCommandInDir calls in try/catch so EACCES/EPERM on
  ~/.archon/commands/ doesn't crash the validator with a raw filesystem
  error. ENOENT still returns [] via the underlying helper.

Error handling fixes:
- workflow-discovery.ts: maybeWarnLegacyHomePath now sets the
  "warned-once" flag eagerly before `await access()`, so concurrent
  discovery calls (server startup with parallel codebase resolution)
  can't double-warn. Non-ENOENT probe errors (EACCES/EPERM) now log at
  WARN instead of DEBUG so permission issues on the legacy dir are
  visible in default operation.
- dag-executor.ts: wrap discoverScriptsForCwd in its own try/catch so
  an EACCES on ~/.archon/scripts/ routes through safeSendMessage /
  logNodeError with a dedicated "failed to discover scripts" message
  instead of being mis-attributed by the outer catch's
  "permission denied (check cwd permissions)" branch.

Tests:
- load-command-prompt.test.ts (new): 6 tests covering the executor's
  command resolution hot path — home-scope resolves when repo misses,
  repo shadows home, 1-level subfolder resolvable by basename, 2-level
  rejected, not-found, empty-file. Runs in its own bun test batch.
- archon-paths.test.ts: add getHomeScriptsPath describe block to match
  the existing getHomeCommandsPath / getHomeWorkflowsPath coverage.

Comment clarity:
- workflow-discovery.ts: MAX_DISCOVERY_DEPTH comment now leads with the
  actual value (1) before describing what 0 would mean.
- script-discovery.ts: copy the "routing ambiguity" rationale from
  MAX_DISCOVERY_DEPTH to MAX_SCRIPT_DISCOVERY_DEPTH.

Cleanup:
- Remove .archon/workflows/e2e-home-scope.yaml — one-off smoke test that
  would ship permanently in every project's workflow list. Equivalent
  coverage exists in loader.test.ts.

Addresses all blocking and important feedback from the multi-agent
review on PR #1315.

---------

Co-authored-by: Jonas Vanderhaegen <7755555+jonasvanderhaegen@users.noreply.github.com>
2026-04-20 21:45:32 +03:00
.archon feat(workflows): add repo-triage — periodic maintenance via inline Haiku sub-agents (#1293) 2026-04-20 11:34:38 +03:00
.claude feat(providers/pi): interactive flag binds UIContext for extensions (#1299) 2026-04-20 07:37:40 -05:00
.github fix(bundled-defaults): auto-generate import list, emit inline strings (#1263) 2026-04-16 21:27:51 +02:00
.husky chore: Add pre-commit hook to prevent formatting drift (#226) (#229) 2026-01-14 13:54:20 +02:00
assets docs: add Archon logo and polish README header 2026-04-07 13:01:25 -05:00
auth-service feat(web): make workflow builder Node Library panel resizable (#837) 2026-03-27 00:14:37 +02:00
deploy fix(setup): align PORT default on 3090 across .env.example, wizard, and JSDoc (#1152) (#1271) 2026-04-17 14:15:37 +02:00
homebrew chore: update Homebrew formula for v0.3.6 2026-04-12 09:19:27 +00:00
migrations fix(env): detect and refuse target-repo .env with sensitive keys (#1036) 2026-04-08 09:43:47 +03:00
packages feat(paths,workflows): unify ~/.archon/{workflows,commands,scripts} + drop globalSearchPath (closes #1136) (#1315) 2026-04-20 21:45:32 +03:00
scripts fix(ci): normalize line endings in bundled-defaults generator 2026-04-16 17:55:24 -05:00
.dockerignore feat(config): add user-extensible Docker customization templates 2026-04-06 15:26:43 +03:00
.env.example fix(setup): align PORT default on 3090 across .env.example, wizard, and JSDoc (#1152) (#1271) 2026-04-17 14:15:37 +02:00
.gitattributes fix(docker): CRLF entrypoint + Windows Docker Desktop docs 2026-04-06 15:21:03 +03:00
.gitignore chore(gitignore): ignore .claude/scheduled_tasks.lock 2026-04-20 13:39:44 +03:00
.lintstagedrc.json feat: Runtime loading of default commands/workflows (#324) 2026-01-21 23:08:23 +02:00
.prettierignore fix(bundled-defaults): auto-generate import list, emit inline strings (#1263) 2026-04-16 21:27:51 +02:00
.prettierrc Unit test fixing for Windows and updated validate-2 command 2026-01-03 16:28:35 -06:00
bun.lock feat(providers): add Pi community provider (@mariozechner/pi-coding-agent) (#1270) 2026-04-17 13:52:03 +02:00
bunfig.toml feat: Phase 1 - Monorepo structure with @archon/core and @archon/server packages (#311) 2026-01-20 19:08:38 +02:00
Caddyfile.example feat(docker): complete Docker deployment setup (#756) 2026-03-26 15:02:04 +02:00
CHANGELOG.md feat(paths,workflows): unify ~/.archon/{workflows,commands,scripts} + drop globalSearchPath (closes #1136) (#1315) 2026-04-20 21:45:32 +03:00
CLAUDE.md feat(paths,workflows): unify ~/.archon/{workflows,commands,scripts} + drop globalSearchPath (closes #1136) (#1315) 2026-04-20 21:45:32 +03:00
CONTRIBUTING.md fix(bundled-defaults): auto-generate import list, emit inline strings (#1263) 2026-04-16 21:27:51 +02:00
docker-compose.override.example.yml fix(config): address review findings for Docker customization templates 2026-04-06 15:26:43 +03:00
docker-compose.yml chore: fix remaining references and update README for open-source launch 2026-04-07 08:03:13 -05:00
docker-entrypoint.sh fix(docker): create /.archon subdirs in entrypoint for bind mounts (#1260) 2026-04-17 12:40:13 +02:00
Dockerfile fix(providers): replace Claude SDK embed with explicit binary-path resolver (#1217) 2026-04-14 17:56:37 +03:00
Dockerfile.user.example chore: fix remaining references and update README for open-source launch 2026-04-07 08:03:13 -05:00
eslint.config.mjs fix(bundled-defaults): auto-generate import list, emit inline strings (#1263) 2026-04-16 21:27:51 +02:00
LICENSE feat: prepare for open-source migration to coleam00/Archon 2026-04-04 10:47:22 -05:00
package-lock.json Fix: Status command displays isolation_env_id (#88) (#89) 2025-12-17 12:12:31 +02:00
package.json fix(bundled-defaults): auto-generate import list, emit inline strings (#1263) 2026-04-16 21:27:51 +02:00
README.md Add Star History Chart to README.md (#1229) 2026-04-20 19:43:52 +03:00
SECURITY.md feat: prepare for open-source migration to coleam00/Archon 2026-04-04 10:47:22 -05:00
tsconfig.json feat: Phase 5 - CLI binary distribution (#325) 2026-01-21 23:51:51 +02:00

Archon

Archon

The first open-source harness builder for AI coding. Make AI coding deterministic and repeatable.

coleam00%2FArchon | Trendshift

License: MIT CI Docs


Archon is a workflow engine for AI coding agents. Define your development processes as YAML workflows - planning, implementation, validation, code review, PR creation - and run them reliably across all your projects.

Like what Dockerfiles did for infrastructure and GitHub Actions did for CI/CD - Archon does for AI coding workflows. Think n8n, but for software development.

Why Archon?

When you ask an AI agent to "fix this bug", what happens depends on the model's mood. It might skip planning. It might forget to run tests. It might write a PR description that ignores your template. Every run is different.

Archon fixes this. Encode your development process as a workflow. The workflow defines the phases, validation gates, and artifacts. The AI fills in the intelligence at each step, but the structure is deterministic and owned by you.

  • Repeatable - Same workflow, same sequence, every time. Plan, implement, validate, review, PR.
  • Isolated - Every workflow run gets its own git worktree. Run 5 fixes in parallel with no conflicts.
  • Fire and forget - Kick off a workflow, go do other work. Come back to a finished PR with review comments.
  • Composable - Mix deterministic nodes (bash scripts, tests, git ops) with AI nodes (planning, code generation, review). The AI only runs where it adds value.
  • Portable - Define workflows once in .archon/workflows/, commit them to your repo. They work the same from CLI, Web UI, Slack, Telegram, or GitHub.

What It Looks Like

Here's an example of an Archon workflow that plans, implements in a loop until tests pass, gets your approval, then creates the PR:

# .archon/workflows/build-feature.yaml
nodes:
  - id: plan
    prompt: "Explore the codebase and create an implementation plan"

  - id: implement
    depends_on: [plan]
    loop:                                      # AI loop - iterate until done
      prompt: "Read the plan. Implement the next task. Run validation."
      until: ALL_TASKS_COMPLETE
      fresh_context: true                      # Fresh session each iteration

  - id: run-tests
    depends_on: [implement]
    bash: "bun run validate"                   # Deterministic - no AI

  - id: review
    depends_on: [run-tests]
    prompt: "Review all changes against the plan. Fix any issues."

  - id: approve
    depends_on: [review]
    loop:                                      # Human approval gate
      prompt: "Present the changes for review. Address any feedback."
      until: APPROVED
      interactive: true                        # Pauses and waits for human input

  - id: create-pr
    depends_on: [approve]
    prompt: "Push changes and create a pull request"

Tell your coding agent what you want, and Archon handles the rest:

You: Use archon to add dark mode to the settings page

Agent: I'll run the archon-idea-to-pr workflow for this.
       → Creating isolated worktree on branch archon/task-dark-mode...
       → Planning...
       → Implementing (task 1/4)...
       → Implementing (task 2/4)...
       → Tests failing - iterating...
       → Tests passing after 2 iterations
       → Code review complete - 0 issues
       → PR ready: https://github.com/you/project/pull/47

Previous Version

Looking for the original Python-based Archon (task management + RAG)? It's fully preserved on the archive/v1-task-management-rag branch.

Getting Started

Most users should start with the Full Setup - it walks you through credentials, installs the Archon skill into your projects, and gives you the web dashboard.

Already have Claude Code and just want the CLI? Jump to the Quick Install.

Full Setup (5 minutes)

Clone the repo and use the guided setup wizard. This configures credentials, platform integrations, and copies the Archon skill into your target projects.

Prerequisites - Bun, Claude Code, and the GitHub CLI

Bun - bun.sh

# macOS/Linux
curl -fsSL https://bun.sh/install | bash

# Windows (PowerShell)
irm bun.sh/install.ps1 | iex

GitHub CLI - cli.github.com

# macOS
brew install gh

# Windows (via winget)
winget install GitHub.cli

# Linux (Debian/Ubuntu)
sudo apt install gh

Claude Code - claude.ai/code

# macOS/Linux/WSL
curl -fsSL https://claude.ai/install.sh | bash

# Windows (PowerShell)
irm https://claude.ai/install.ps1 | iex
git clone https://github.com/coleam00/Archon
cd Archon
bun install
claude

Then say: "Set up Archon"

The setup wizard walks you through everything: CLI installation, authentication, platform selection, and copies the Archon skill to your target repo.

Quick Install (30 seconds)

Already have Claude Code set up? Install the standalone CLI binary and skip the wizard.

macOS / Linux

curl -fsSL https://archon.diy/install | bash

Windows (PowerShell)

irm https://archon.diy/install.ps1 | iex

Homebrew

brew install coleam00/archon/archon

Compiled binaries need a CLAUDE_BIN_PATH. The quick-install binaries don't bundle Claude Code. Install it separately, then point Archon at it:

# macOS / Linux / WSL
curl -fsSL https://claude.ai/install.sh | bash
export CLAUDE_BIN_PATH="$HOME/.local/bin/claude"

# Windows (PowerShell)
irm https://claude.ai/install.ps1 | iex
$env:CLAUDE_BIN_PATH = "$env:USERPROFILE\.local\bin\claude.exe"

Or set assistants.claude.claudeBinaryPath in ~/.archon/config.yaml. The Docker image ships Claude Code pre-installed. See AI Assistants → Binary path configuration for details.

Start Using Archon

Once you've completed either setup path, go to your project and start working:

cd /path/to/your/project
claude
Use archon to fix issue #42
What archon workflows do I have? When would I use each one?

The coding agent handles workflow selection, branch naming, and worktree isolation for you. Projects are registered automatically the first time they're used.

Important: Always run Claude Code from your target repo, not from the Archon repo. The setup wizard copies the Archon skill into your project so it works from there.

Web UI

Archon includes a web dashboard for chatting with your coding agent, running workflows, and monitoring activity. Binary installs: run archon serve to download and start the web UI in one step. From source: ask your coding agent to run the frontend from the Archon repo, or run bun run dev from the repo root yourself.

Register a project by clicking + next to "Project" in the chat sidebar - enter a GitHub URL or local path. Then start a conversation, invoke workflows, and watch progress in real time.

Key pages:

  • Chat - Conversation interface with real-time streaming and tool call visualization
  • Dashboard - Mission Control for monitoring running workflows, with filterable history by project, status, and date
  • Workflow Builder - Visual drag-and-drop editor for creating DAG workflows with loop nodes
  • Workflow Execution - Step-by-step progress view for any running or completed workflow

Monitoring hub: The sidebar shows conversations from all platforms - not just the web. Workflows kicked off from the CLI, messages from Slack or Telegram, GitHub issue interactions - everything appears in one place.

See the Web UI Guide for full documentation.

What Can You Automate?

Archon ships with workflows for common development tasks:

Workflow What it does
archon-assist General Q&A, debugging, exploration - full Claude Code agent with all tools
archon-fix-github-issue Classify issue → investigate/plan → implement → validate → PR → smart review → self-fix
archon-idea-to-pr Feature idea → plan → implement → validate → PR → 5 parallel reviews → self-fix
archon-plan-to-pr Execute existing plan → implement → validate → PR → review → self-fix
archon-issue-review-full Comprehensive fix + full multi-agent review pipeline for GitHub issues
archon-smart-pr-review Classify PR complexity → run targeted review agents → synthesize findings
archon-comprehensive-pr-review Multi-agent PR review (5 parallel reviewers) with automatic fixes
archon-create-issue Classify problem → gather context → investigate → create GitHub issue
archon-validate-pr Thorough PR validation testing both main and feature branches
archon-resolve-conflicts Detect merge conflicts → analyze both sides → resolve → validate → commit
archon-feature-development Implement feature from plan → validate → create PR
archon-architect Architectural sweep, complexity reduction, codebase health improvement
archon-refactor-safely Safe refactoring with type-check hooks and behavior verification
archon-ralph-dag PRD implementation loop - iterate through stories until done
archon-remotion-generate Generate or modify Remotion video compositions with AI
archon-test-loop-dag Loop node test workflow - iterative counter until completion
archon-piv-loop Guided Plan-Implement-Validate loop with human review between iterations

Archon ships 17 default workflows - run archon workflow list or describe what you want and the router picks the right one.

Or define your own. Default workflows are great starting points - copy one from .archon/workflows/defaults/ and customize it. Workflows are YAML files in .archon/workflows/, commands are markdown files in .archon/commands/. Same-named files in your repo override the bundled defaults. Commit them - your whole team runs the same process.

See Authoring Workflows and Authoring Commands.

Add a Platform

The Web UI and CLI work out of the box. Optionally connect a chat platform for remote access:

Platform Setup time Guide
Telegram 5 min Telegram Guide
Slack 15 min Slack Guide
GitHub Webhooks 15 min GitHub Guide
Discord 5 min Discord Guide

Architecture

┌─────────────────────────────────────────────────────────┐
│  Platform Adapters (Web UI, CLI, Telegram, Slack,       │
│                    Discord, GitHub)                     │
└──────────────────────────┬──────────────────────────────┘
                           │
                           ▼
┌─────────────────────────────────────────────────────────┐
│                     Orchestrator                        │
│          (Message Routing & Context Management)         │
└─────────────┬───────────────────────────┬───────────────┘
              │                           │
      ┌───────┴────────┐          ┌───────┴────────┐
      │                │          │                │
      ▼                ▼          ▼                ▼
┌───────────┐  ┌────────────┐  ┌──────────────────────────┐
│  Command  │  │  Workflow  │  │    AI Assistant Clients  │
│  Handler  │  │  Executor  │  │   (Claude / Codex / Pi)  │
│  (Slash)  │  │  (YAML)    │  │                          │
└───────────┘  └────────────┘  └──────────────────────────┘
      │              │                      │
      └──────────────┴──────────────────────┘
                           │
                           ▼
┌─────────────────────────────────────────────────────────┐
│              SQLite / PostgreSQL (7 Tables)             │
│   Codebases • Conversations • Sessions • Workflow Runs  │
│    Isolation Environments • Messages • Workflow Events  │
└─────────────────────────────────────────────────────────┘

Documentation

Full documentation is available at archon.diy.

Topic Description
Getting Started Setup guide (Web UI or CLI)
The Book of Archon 10-chapter narrative tutorial
CLI Reference Full CLI reference
Authoring Workflows Create custom YAML workflows
Authoring Commands Create reusable AI commands
Configuration All config options, env vars, YAML settings
AI Assistants Claude, Codex, and Pi setup details
Deployment Docker, VPS, production setup
Architecture System design and internals
Troubleshooting Common issues and fixes

Telemetry

Archon sends a single anonymous event — workflow_invoked — each time a workflow starts, so maintainers can see which workflows get real usage and prioritize accordingly. No PII, ever.

What's collected: the workflow name, the workflow description (both authored by you in YAML), the platform that triggered it (cli, web, slack, etc.), the Archon version, and a random install UUID stored at ~/.archon/telemetry-id. Nothing else.

What's not collected: your code, prompts, messages, git remotes, file paths, usernames, tokens, AI output, workflow node details — none of it.

Opt out: set any of these in your environment:

ARCHON_TELEMETRY_DISABLED=1
DO_NOT_TRACK=1        # de facto standard honored by Astro, Bun, Prisma, Nuxt, etc.

Self-host PostHog or use a different project by setting POSTHOG_API_KEY and POSTHOG_HOST.

Contributing

Contributions welcome! See the open issues for things to work on.

Please read CONTRIBUTING.md before submitting a pull request.

Star History

Star History Chart

License

MIT