Melian

Claude Code

Overview

Melian can invoke Claude Code to analyze her own codebase, make commits, and create pull requests. This is a central part of the self-healing system: when the nightly error review agent identifies a fixable issue, it uses Claude Code to implement and propose the fix. Claude Code is also available as a general-purpose tool in conversations for any codebase work.

How It Works

The integration spawns the Claude Code CLI as a subprocess and captures its output. The self-healing pipeline runs it with --dangerously-skip-permissions so automated fixes can proceed without interactive prompts. For interactive use initiated by a conversation, permissions are applied normally.

Self-healing pipeline
  └── error review agent identifies fixable issue
  └── spawn: claude --dangerously-skip-permissions -p "<fix instructions>"
  └── Claude Code: reads code, edits files, runs tests, commits
  └── opens pull request → human review

Conversation use
  └── claude_code tool called
  └── spawn: claude -p "<task>"
  └── output returned to conversation

Tools

Tool Parameters Description
claude_code prompt: string, mode: string Invoke Claude Code CLI with a prompt in the specified mode; returns stdout
project_create slug: string, spec: string, public?: boolean Scaffold a new repository with standard structure

claude_code Parameter Details

Parameter Type Required Notes
prompt string yes Task description passed to the Claude Code CLI
mode string yes One of "analyze", "commit", or "pr"

project_create Parameter Details

Parameter Type Required Notes
slug string yes Repository slug (used as directory and repo name)
spec string yes Project specification, used to scaffold initial structure
public boolean no Whether the repository should be public (default false)

Self-Healing Integration

The nightly integration tests run at 2am. At 2:30am the auto-fix agent reviews any failures, and for issues classified as auto-fixable, it calls claude_code to implement the fix. The result is committed to a branch and a pull request is opened for human review before merge. See the self-healing architecture page for the full pipeline.