Expand description
Shared module for spawning Claude Code (claude -p) subprocesses.
Eliminates duplication between enrich.rs and ingest_claude.rs (G02).
Detects terminal_reason: "max_turns" in the JSON output (G03).
Structs§
- Claude
Output Element - Parsed output element from
claude -p --output-format json. - Claude
Result - Result of a successful Claude invocation.
Functions§
- build_
claude_ command - Builds a
Commandforclaude -pwith least-privilege environment. - parse_
claude_ output - Parses
claude -p --output-format jsonoutput array. - run_
claude - Calls
claude -pwith prompt and schema, waits with timeout, and parses output. - spawn_
with_ memory_ limit - Spawns a command with a virtual memory limit via
setrlimit(RLIMIT_AS). - terminate_
gracefully - Terminates a child process gracefully: SIGTERM first, SIGKILL after grace period.
- validate_
claude_ version - Validates that the Claude binary meets the minimum version requirement.