CPython Runtime Introspection
SkillWeb & browsingLets your agent inspect a running Python process from the inside, capturing code, frames, and variables live.
Available today. Use it from your connected AI after setup.
No other account needed.
Add ahel to your AI once: Claude, ChatGPT, Cursor, Claude Code or Codex. Then ask it to use this.
Then ask your AI: use the CPython Runtime Introspection skill
About this skill
Inspect embedded or packaged CPython processes at runtime by tracing child processes, acquiring the GIL, injecting Python, replacing builtins.input, walking frame.f_back, exporting frame code objects, locals, globals, and disassembly, and hooking PyEval or marshal boundaries. Use when static extract
What this skill tells your AI
The instructions your AI receives, as published by manyuegong33/r0crawl_skills in skills/cpython-runtime-introspection/SKILL.md and read by ahel’s review.
Prove the process and runtime
- Handle one-file parent and child processes separately.
- Record module bases and the exact Python version.
- Capture an input or output stack and confirm it enters CPython.
- Match injector and target architecture.
Prefer semantic injection
Inject Python-level code instead of reverse engineering the evaluator first:
- Acquire the GIL with
PyGILState_Ensure. - Execute a small payload with
PyRun_SimpleStringFlagsor a compatible API. - Release the GIL.
- Install
scripts/frame_probe.pybefore the interestinginput()or verifier executes.
See references/injection-boundaries.md for native API sequencing.
Walk caller frames
At a semantic choke point such as builtins.input:
- start at
sys._getframe(1) - walk
frame.f_back - record
co_filename,co_name,f_lineno,co_names, andco_consts - safely serialize local/global values
- write
marshal.dumps(frame.f_code)using the target runtime - disassemble in the same Python version
Do not rely on native stacks alone; they usually stop at generic evaluator functions.
Fallback boundaries
If Python-level injection is unavailable, instrument in this order:
PyEval_EvalCodeor version-specific evaluator boundaryPyMarshal_ReadObjectFromStringPyImport_ExecCodeModule*- input or comparison builtins
Quality gates
- Preserve the original input function and restore it after capture.
- Limit repr length and handle repr exceptions.
- Export code objects before modifying locals.
- Confirm dumped marshal objects load under the exact Python version.
- Validate the recovered verifier independently against live behavior.
Signals
- GitHub stars
- 285
- Forks
- 100
- Last commit
- Sep 2026
Advanced
- Catalog kind
- skill
- Key
cpython-runtime-introspection- Source
- github.com/manyuegong33/r0crawl_skills