///|
async fn main {
let wf = @workflow.Workflow(
runner=@spawn.contract_runner(launch=_ => {
@spawn.LaunchSpec(command="moonx", args=[
"moonbitlang/workflow/shim/claude",
"--result-file",
@spawn.ResultFilePlaceholder,
])
}),
max_calls=1,
)
let report = wf.agent(
prompt="Describe the repository's public API in three sentences.",
kind="explore",
max_steps=8,
)
println(report.stringify())
}moonx moonbitlang/workflow/shim/claude --help| Option | Claude mapping |
|---|---|
| --result-file PATH | Required: where the result file goes. |
| --command EXE | CLI executable; default claude. |
| --model NAME | --model NAME; absent leaves model selection to the CLI. |
| --cwd DIR | Working directory of the CLI process. |
| --writable | Enables the write-capable policy below. |
| --schema FILE | Reads the file and passes its text via --json-schema. |
| -- ARGS... | Passed to Claude before the shim's tool list. |
{
"answer": "The repository exposes ...",
"engine": "claude",
"session_id": "example-session",
"num_turns": 1,
"cost_usd": 0.01
}| How the run ended | Result status |
|---|---|
| A successful result line | completed, with the report as output |
| The step ceiling, or Claude's own error_max_turns | max_steps_exhausted |
| Parent stdin EOF | interrupted |
| An error result, a launch failure, an unreadable --schema, or a nonzero exit without a result | failed, with the reason |
| A clean exit without a result | no_report |
moon run shim/claude --target native -- --help
moon test shim/claude --target native
moon test shim/claude --target wasm