npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ascenda-one/codex-hooks

v0.1.12

Published

OpenAI Codex hooks adapter for Ascenda AI workload telemetry

Readme

Ascenda Codex Hooks

OpenAI Codex hooks adapter for Ascenda AI workload telemetry.

Part of ai-engineer-tools. Event mapping: docs/CODEX_MAPPING.md. Codex hooks reference: developers.openai.com/codex/hooks.

Role in workload detection

Third agent producer after the IDE extensions and Claude Code hooks. Contributes the same AI interaction load signals — prompts, correction loops, tool calls, verification runs, compaction pressure, long agent turns — from Codex sessions, into the shared canonical event catalog.

| Workload input | How this adapter contributes | | --- | --- | | AIInteractionLoad | Prompts, tool calls, correction loops, compaction | | FocusDuration | Session starts, long turns (agent_loop_long, measured locally) | | Workflow friction | Tool failures, context pressure | | Verification load | shell test/lint/build → editor_verification_activity / compile_error |

Identity: Codex rides the canonical cli_agent toolType/source (the backend registry has no codex value yet); events carry metadata.host: "codex" for later disaggregation.

Hook safety contract

Codex awaits command hooks and treats exit code 2 as blocking the user's action. This adapter therefore always exits 0 and caps every HTTP call at 3 s (ASCENDA_HTTP_TIMEOUT_MS to change): telemetry failures surface as a one-line systemMessage or stderr note and never stall or block the engineer.

Install

Prerequisites

1. Run the published CLI

No clone, no build — the package is on npm:

npx @ascenda-one/codex-hooks --help

2. Pair first

npx -y @ascenda-one/claude-code-hooks pair --tool-type cli_agent

It prints a 6-digit code — confirm it in the Ascenda app under Connections → Ingest telemetry — then saves the write token to ~/.ascenda/tokens/ and prints the export line:

export ASCENDA_TOOL_INSTALLATION_ID="cli_agent:<uuid>"   # printed by `pair`

Add it to your shell profile. Without this variable every hook invocation exits with Missing ASCENDA_TOOL_INSTALLATION_ID.

On a Dev backend with no phone:

cd ../ascenda-pairing-sim && npm run build
node dist/cli.js e2e --tool-type cli_agent --name "Codex CLI"

ASCENDA_API_BASE_URL defaults to https://api.ascenda.one; set it to http://localhost:5002 or the Azure Dev host for development.

3. Register hooks in Codex

Merge examples/hooks.json into ~/.codex/hooks.json (machine-wide) or <repo>/.codex/hooks.json (per project). Inline config.toml form works too:

[[hooks.UserPromptSubmit]]
[[hooks.UserPromptSubmit.hooks]]
type = "command"
command = "npx -y @ascenda-one/codex-hooks UserPromptSubmit"
timeout = 10

4. Verify

Run a Codex session and confirm events arrive on the backend — or simply that the hook exits 0, which it always does (see the safety contract above).

Build from source

Not needed to use this — npm ships it prebuilt. It is here so you can verify what runs.

# from the repo root (workspace install + shared packages first)
npm install
npm run build:shared

cd ascenda-codex-hooks
npm run build
npm link                # exposes `ascenda-codex-hook`
which ascenda-codex-hook

npm run test            # unit tests for the mapping
npm run test:sample     # pipes a sample PostToolUse payload through the CLI

A local build exposes the binary as ascenda-codex-hook — substitute it for npx -y @ascenda-one/codex-hooks in the hook config above. If it is not on Codex's PATH, use the absolute path to the binary.

Supported Codex hook events

SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, PreCompact, PostCompact, Stop. (PermissionRequest, SubagentStart, SubagentStop have no catalog counterpart and are skipped.)

Turn duration

Codex's Stop payload has no duration, so the adapter records a turn-start timestamp per session under ~/.ascenda/state/ at UserPromptSubmit and consumes it at Stop; turns of 30+ minutes emit agent_loop_long. State failures degrade silently to "no duration".

Privacy defaults

Metadata-only. Does not send prompts, responses, code, file names, repository names, or terminal output. Correction detection runs locally on prompt text; only the classification is transmitted. consentScope: ide_telemetry, provenance: ai_work_telemetry on every event.