sounio-native-codegen

sounio-native-codegen is a skill for Claude Code, Codex from Sounio-lang/sounio. It costs 59 tokens per session (1,364 once invoked), scanned A, original, Apache-2.0.

A set of instructions for Sounio's native x86-64 code generator, the compiler part that turns an intermediate program representation into machine code for common 64-bit computers.

In plain words
What is it for?
Editing register allocation, instruction encoding, peephole optimization, stack-frame sizing, ELF output, and the pipeline that compiles intermediate functions.
Why use it?
It gives developers a consistent workflow for changing the backend's many code-generation stages.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Needs its repository: it runs a file that does not travel with it, so clone the repository first. The line is bash scripts/sprint65_peephole_gate.sh # 30/30 — peephole optimizer wiring.

Good fit Editing register allocation, instruction encoding, peephole optimization, stack-frame sizing, ELF output, and the pipeline that compiles intermediate functions.

Compare 6 skills from other repositories ↓
Install

Getting it into your agent

It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.

Clone the repo
git clone --depth 1 https://github.com/Sounio-lang/sounio
agentmods
npx agentmods add skills/sounio-lang/sounio/sounio-native-codegen

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for sounio-native-codegen

README.md
[![agentmods](https://agentmods.dev/badge/skills/sounio-lang/sounio/sounio-native-codegen/github.svg)](https://agentmods.dev/skills/sounio-lang/sounio/sounio-native-codegen)
Your own site
<a href="https://agentmods.dev/skills/sounio-lang/sounio/sounio-native-codegen"><img src="https://agentmods.dev/badge/skills/sounio-lang/sounio/sounio-native-codegen/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for sounio-native-codegen

Your own site · 80×15
<a href="https://agentmods.dev/skills/sounio-lang/sounio/sounio-native-codegen"><img src="https://agentmods.dev/badge/skills/sounio-lang/sounio/sounio-native-codegen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 59 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,364 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00059 $0.01364
Opus 5 $0.00030 $0.00682
Sonnet 5 $0.00012 $0.00273
Haiku 4.5 $0.00006 $0.00136

Measured 8d ago against content hash 386cb71b2b82, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, from the pricing page.

Security

Grade A, and why

sounio-native-codegen scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/sounio-native-codegen/SKILL.md · 90 lines

How it starts

The opening of the file, as written. The whole thing — 90 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Sounio Native Codegen Backend

Overview

The native backend lowers IrFunction to x86-64 ELF machine code in a single-pass pipeline wired inside compile_ir_function() in self-hosted/native/codegen.sio:

IrFunction → regalloc → peephole → lower_ir → disp8 encoding → compact frame → emit prologue → lower instrs → epilogue → patch jumps

All passes live in self-hosted/native/. The pipeline is complete as of Sprint 65 (30/30 gate).

Workflow

1) Understand which pass to touch

Pass File Entry Function Sprint
Linear-scan regalloc (4-preg r12-r15) native/regalloc.sio nc_run_regalloc() 52/62
Peephole optimizer (IR-level) native/peephole.sio ph_run_on_func() 65
Adaptive disp8/disp32 encoding native/lower_ir.sio ir_slot_fits_disp8() 63
Compact frame sizing native/lower_ir.sio nc_min_frame_size() 64
Instruction lowering (IrInstr → x86) native/lower_ir.sio lower_instr() ongoing
Byte emitters native/encode.sio emit_*() ongoing
Prologue/epilogue native/codegen.sio emit_prologue_with_preg_mask() 62
ELF output native/elf.sio emit_elf_header() M3
Relocations native/reloc.sio RelocationTable, add_call_reloc() M3
NativeCompiler state native/frame.sio NativeCompiler struct M3

2) Add a new native optimization pass

  1. Create self-hosted/native/your_pass.sio with module native::your_pass declaration
  2. Import deps: use ir::ir::{IrFunction, IrInstr, ...} as needed
  3. Define entry: fn your_pass_run(func: IrFunction) -> IrFunction with Mut, Panic
  4. In self-hosted/native/codegen.sio:
    • Add use native::your_pass::{your_pass_run} to imports
    • Call effective_func = your_pass_run(effective_func) at the right pipeline point
  5. Add self-tests T(N+1)–T(N+k) in self-hosted/compiler/main.sio — update let total: i64
  6. Write gate script following scripts/sprint65_peephole_gate.sh as template

Read the full file on GitHub · 90 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 90 lines · 59 tokens per session scan A 386cb71b2b82

Subscribe to this mod's changes

sounio-native-codegen is a skill published in the GitHub repository Sounio-lang/sounio (6 stars, last pushed today), licensed Apache-2.0. It adds 59 tokens to every session and 1,364 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

vera-language

Write programs in the Vera programming language. Use when asked to write, edit, debug, or review Vera code (.vera files). Vera is a statically typed, purely functional language with algebraic effects, mandatory contracts, and typed slot references (@T.n) instead of variable names.

aallan/vera · 61 tokens

vera-language

Write programs in the Vera programming language. Use when asked to write, edit, debug, or review Vera code (.vera files). Vera is a statically typed, purely functional language with algebraic effects, mandatory contracts, and typed slot references (@T.n) instead of variable names.

aallan/vera · 61 tokens

migrate-oxfmt

Guide for migrating a project from Prettier or Biome to Oxfmt. Use when asked to migrate, convert, or switch a JavaScript/TypeScript project's formatter from Prettier or Biome to Oxfmt.

oxc-project/oxc · 53 tokens

insta-snapshots

Guide for working with and updating insta snapshot tests in Oxc without terminal interaction.

oxc-project/oxc · 22 tokens

EMILIA Trust Verification

Verify the authenticity of AI-agent authorization receipts and human-device signoffs. Use this whenever a user shares a "trust receipt", an "authorization receipt", a "signoff", or WebAuthn/passkey approval evidence and asks whether it is valid, genuine, or tampered with. Pairs with the public EMILIA Protocol MCP…

emiliaprotocol/emilia-protocol · 94 tokens

dev-self-merge

Merge self-check for a green PR. Reads the PR's required-check status from the checks API (the committed ci-status feed is RETIRED), outputs MERGE (mark task completed, stand down — server-side auto-enqueue enqueues.

loopdive/js2 · 54 tokens