codex

An installation guide for connecting HM-Arch to Codex. HM-Arch is installed through Python or npm, then adds Codex hooks and configuration for recalling, recording, and consolidating project information.

In plain words
What is it for?
Use it to install HM-Arch for one project or globally, enable its Codex lifecycle hooks, verify the setup, or uninstall it.
Why use it?
It provides repeatable setup, status checks, smoke tests, and removal instructions. This makes it easier to add or undo HM-Arch’s Codex integration without API keys.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/zhhjluka/hm-arch/codex
Clone the repo
git clone --depth 1 https://github.com/zhhjluka/hm-arch
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,070 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. Scan, not verified.
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 $0.00000 $0.01070
Opus 5 $0.00000 $0.00535
Sonnet 5 $0.00000 $0.00214
Haiku 4.5 $0.00000 $0.00107

Measured 2d ago against content hash 2c37c2a15d88, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

codex scanned grade C with 1 finding 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 2d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf .codex
docs/agents/codex.md · 152 lines

How it starts

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

Codex setup (HM-Arch)

Install HM-Arch, wire Codex lifecycle hooks, smoke-test, and uninstall. All steps are offline and do not require API keys.

Install HM-Arch

From a GitHub Release wheel (current v2.0.4):

python3.12 -m venv .venv && source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install /path/to/hm_arch-2.0.4-py3-none-any.whl

From PyPI:

pip install hm-arch
# or isolated CLI on PATH:
pipx install hm-arch

From npm:

npm install -g @hm-arch/installer
hm-arch-install install codex

Confirm the CLI:

hm-arch --help
# or, after npm install:
hm-arch-install --help

Connect Codex (project scope)

Run from your project root (where you want .codex/):

cd /path/to/your/project
hm-arch install codex

This creates or updates:

  • .codex/hooks.json — three HM-Arch hooks (recall, record, consolidate) invoking hm-arch codex recall|record|consolidate
  • .codex/config.toml — enables [features] hooks = true when needed

Global installation

hm-arch install codex --global
hm-arch status codex --global
hm-arch uninstall codex --global

Smoke test

cd /path/to/your/project
hm-arch status codex
hm-arch doctor codex

Expected when installed:

  • status reports installed and lists roles recall, record, consolidate
  • doctor exits 0 when hooks and Codex hook feature flags are valid
  • Hooks use hm-arch codex … when hm-arch is on PATH

Verify the HM-Arch bridge

Use the bridge commands first. They do not require a Codex model call and make it clear whether HM-Arch can record and recall memory:

cd /path/to/your/project
printf '%s' '{"prompt":"Codex-HM-Arch-local-check","last_assistant_message":"Stored through HM-Arch."}' \
  | hm-arch codex record

printf '%s' '{"hook_event_name":"UserPromptSubmit","prompt":"Codex-HM-Arch-local-check"}' \
  | hm-arch codex recall

The recall output should be JSON with:

Read the full file on GitHub · 152 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. 2d ago First seen · 152 lines · 0 tokens per session scan C 2c37c2a15d88

Subscribe to this mod's changes

codex is an agent published in the GitHub repository zhhjluka/hm-arch (18 stars, last pushed 2mo ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 1,070 tokens. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other agents, from other repositories

api-designer

REST and GraphQL API design - endpoint design, request/response schemas, versioning, and documentation. Use for designing new APIs or evolving existing ones.

AgentWorkforce/relay · 35 tokens

Agent Prompt: Dream memory consolidation

Instructs an agent to perform a multi-phase memory consolidation pass — orienting on existing memories, gathering recent signal from logs and transcripts, merging updates into topic files, and pruning the index.

openonion/connectonion · 45 tokens

contact-lookup-agent

Look up contact phone numbers with fixed demo data.

trpc-group/trpc-agent-go · 15 tokens

external-system-integration-expert

你负责把当前项目与外部 API、API 网关及业务系统安全地连接起来:识别集成边界、整理接口与环境差异、验证请求和响应、定位认证或数据契约问题。.

agents-universe/agents-universe · 33 tokens

integration-testing-orchestrator

Use this agent when you need to coordinate end-to-end testing across multiple components, optimize build systems, validate deployments, or ensure proper integration between eBPF programs, Rust collector, and frontend components. Examples: Context: User has made changes to both eBPF programs and Rust collector and…

eunomia-bpf/agentsight · 239 tokens

Audit

Deep security + performance audit of a specific diff. Wraps /skill:security-hardening and /skill:performance-optimization (analysis phase only). Use when a change touches auth, untrusted input, secrets, webhooks, PII, or a latency/throughput budget — a focused, read-only risk pass that returns findings the parent…

BlackBeltTechnology/pi-agent-dashboard · 98 tokens