REA Python pyc notes (unofficial)

Last updated: · By the RepoRead editorial team · Unofficial guide
Quick answer

REA’s inspect-python-pyc path answers “what CPython format is this .pyc, and which code objects does its marshal graph contain?” Prefer python-pyc.md for exact schemas.

Minimal path

rea inspect-python-pyc /absolute/path/to/module.pyc --json

MCP:

{
  "name": "inspect_python_pyc",
  "arguments": { "path": "/artifacts/module.pyc" }
}

What you get (orientation)

  • Artifact path, SHA-256, byte length
  • Header magic, mapped python_version / code_layout, PEP 552 flags, hash or mtime/size identity
  • code_objects list with nested indexes — not a raw dump of every serialized record

Inspect only .pyc files you are authorized to examine. Do not use this path to recover secrets from software you may not reverse.

RepoRead is unofficial. Prefer python-pyc.md.

FAQ

Does this run the bytecode?

No. Upstream states the reader reports format/version from the magic and walks the marshal graph without running bytecode and without requiring a Python installation.

Which Python versions are mapped?

Docs map pinned CPython 3.7–3.13 magics to layouts such as py37, py38 or py311. Some early 3.7/3.11 alpha magics and 12-byte headers are unsupported.

CLI vs MCP paths?

CLI resolves relative paths against the caller working directory. MCP requires an absolute filesystem path and preserves that exact selection.

Is bytecode decompiled?

No. The result summarizes code objects (names, flags, const summaries, bytecode length/SHA-256). Const strings may be truncated in the summary while the walk still consumed original bytes.

npm version checked?

rea-agents 6.7.0 (re-checked 2026-10-24).

Sources