Move the Claude Code internals from --help beside the modules relying on them

This commit is contained in:
2026-09-28 16:52:30 +02:00
parent 1be6ae8187
commit 44cf712dc8
8 changed files with 8 additions and 14 deletions
-13
View File
@@ -32,19 +32,6 @@ interrupt; with both set, nothing is asked.
A change to bin/loop-claude or bin/loop_claude/*.py takes effect at the next cycle boundary, once
loop-claude --help succeeds.
Claude Code internals this rests on, observed on 2.1.282, the model catalog on 2.1.283:
- The transcript is ~/.claude/projects/*/<session-id>.jsonl, one JSON object per line. A <session-id>/
folder and <session-id>.superseded-*/ and .orphaned-*.jsonl siblings belong to the same session.
- Claude Code writes "user" entries of its own into the transcript, and a `claude -p` prompt lands as one
with promptSource "sdk"; UserEntryKind in transcript.py tells a human's from them.
- An "assistant" entry, in the transcript and in --output-format stream-json, carries message.content
parts of type "text" (text) and "tool_use" (name, input); stream-json ends with a "result" event.
- `claude -p --output-format json --json-schema` returns the verdict under "structured_output".
- `claude -p` without --bare loads the project's and ~/.claude's CLAUDE.md, so the judge reads the words.
- ~/.claude.json holds projects.<path>.hasTrustDialogAccepted per checkout.
- ~/.claude/cache/model-catalog/*.json holds catalog.config.models, each with an id and a name; the newest
file has the highest fetchedAt.
"""
import dataclasses
import sys