Output schemas
All formats contain a budget-limited path listing and selected source. Source
entries use FULL, SKEL, or SIGS. A TREE selection contributes only to the
path listing, when space allows.
CLI statistics go to stderr. Scores, findings, dependency edges, and token counts are SDK metadata and are not fields in these serialized artifacts.
JSON
Use --format json to produce an object with two arrays:
{
"files": ["main.py", "helper.py"],
"context": [
{
"path": "main.py",
"language": "python",
"tier": "FULL",
"content": "from helper import ready\nprint(ready())\n"
}
]
}
| Field | Type | Meaning |
|---|---|---|
files | Array of strings | Repository-relative paths retained in the listing |
context | Array of objects | Files with selected source beyond TREE |
context[].path | String | Source file path |
context[].language | String or null | Registry language ID, or null when unknown |
context[].tier | String | FULL, SKEL, or SIGS |
context[].content | String | Selected source after secret protection |
The JSON Schema describes these fields. Parse the
JSON rather than relying on whitespace, property order, or matching array indexes.
An empty artifact has empty files and context arrays.
XML
Use --format xml for a context root containing a files element and zero or
more source elements:
<context>
<files>
<file path="main.py"/>
<file path="helper.py"/>
</files>
<source path="main.py" tier="FULL" language="python">from helper import ready print(ready()) </source>
</context>
The example is indented for reading. Generated XML is compact. Each source
has path, tier, and language attributes, with an empty language attribute
when detection is unknown. An XML parser restores escaped source characters,
including line breaks. Source is text content, not CDATA.
Markdown
Markdown starts with # Repository context and a ## Files listing. Each listed
path is a JSON-quoted string. Selected source follows under headings containing
the quoted path and tier:
## "main.py" (FULL)
```python
from helper import ready
print(ready())
```
The code-fence width grows when source contains backticks. Use JSON or XML when consuming artifacts programmatically, rather than parsing Markdown headings.
Paths, protection, and counts
Paths use repository-relative names. Sensitive-file policies can retain a path without source, and protection can redact path or source text. A tight budget can shorten the listing or lower source detail.
Counts apply to the exact generated bytes, including JSON escapes, XML entities, Markdown fences, and paths. Reformatting an artifact can change its token count. See export context for commands and secret protection for policy modes.