per.hr for AI · Codex · Beta
One command adds per.hr's hooks to Codex. You approve them once in Codex, then work the way you already do. Each session arrives in Review with your time, Codex's working time, tokens and a summary.
In beta, part of Pro and Team, with a 14-day trial on Free. Request access and start right away while per.hr Customer Support reviews it. Everything agents share is on per.hr for AI.
Setup
Run npx perhr setup in a terminal on the computer where you run Codex. It signs the computer in, asks about Codex, and adds per.hr's hooks.
npx perhr setup
Approve the code QMRP-XTKD at per.hr/device
Signed in.
Codex
Setup adds per.hr's hooks to Codex's hooks.json. Add them? y
per.hr's hooks are added to Codex.
The next time you start Codex, it shows Hooks need review.
Your Call
The next time Codex starts, it shows per.hr's new hooks for review. Look over what each one runs, then press t to approve them. per.hr records from that point on.
Hooks need review
New hooks were added. Review them before they run.
node "~/.perhr/codex/hook.mjs"
SessionStart · UserPromptSubmit · Stop · SessionEnd and more
t approve all
Approved. per.hr is recording this repo.
Day to Day
Ask Codex to work on a Plan item by its reference, and the session attaches to it. Codex ends each reply with a short per.hr note, which becomes the session's summary.
Work on HAL-21: group the sales export by region
The export now groups orders by region, with a subtotal for each. Tests pass.
per.hr note: The weekly sales export groups orders by region, with a subtotal for each.
Northline Outfitters › Reporting
HAL-21: Sales export by region
The weekly sales export groups orders by region, with a subtotal for each.
Your time 0.55 h · Codex 1.20 h · 1 commit
What's Sent
per.hr receives when a session and each turn started and ended, the repo and branch, the model and token counts, and the per.hr note lines. Everything else stays on your computer.
Agents working now
4
On 2 projects
Leverage today
2.9×
Agent time per hands-on hour
You today
1:27
Since midnight
Agents today
4:13
Since midnight
Cost
Every model request reports its tokens. per.hr totals them for the session, shows an estimate at API rates, and works out the session's share of the plan you pay for.
Your hours
30.0
This month
Agent hours
102.0
This month
Compute
$214.60
At API rates
Items done
14
With agent sessions
Your hours and agent hours stay in separate columns and are never added together.
Shows whether Codex has run per.hr's hooks, and checks the connection.
Model and tokens for every request, subagents included, with an estimate at OpenAI's published API rates.
Tell per.hr your ChatGPT plan, and each session shows its share of what you really pay. Only you see it.
Commits and pull requests attach to the session and show whether they merged.
Confirmed the wrong session? Send it back to Review while its time is unbilled.
Times, counts and the note line. Your prompts and code stay on your computer.
per.hr for AI is in beta. Request access with your per.hr account and start right away: per.hr Customer Support reviews each request, and you can set up and record while you wait. On Free, a 14-day trial starts with your first recorded session. Then run npx perhr setup in a terminal on the computer where you run Codex, and say yes when it asks about Codex.
Hooks: one small command that Codex runs at points in a session, such as when it starts, when you send a prompt and when a reply finishes. Setup adds them to Codex's hooks file and keeps a copy of the file as it was. Codex shows them to you for approval before they ever run.
Your prompts, code and files stay on your computer, and so do Codex's replies. per.hr receives session and turn times, the repo and branch, the model and token counts, and the short per.hr note line at the end of a reply, which becomes the session's summary. Rates are typed at your own keyboard and never pass through an agent.
per.hr shows an estimate at OpenAI's published API rates from the session's token counts. On a ChatGPT plan you pay a flat price, so tell per.hr which plan you're on, and each session shows its share of what you really pay. Only you see that figure.
Yes. Setup can add both, and their sessions record side by side on the same clients, projects and Plan items. Each session is labeled with the agent that ran it, and your Billing Profile can show both.
The per.hr CLI and its Codex hook run on macOS, Linux and Windows, with Node 18.17 or later. Codex recording has been run on Windows so far. If something looks off on a Mac or on Linux, tell us through per.hr/contact and we'll fix it.
Run perhr setup --step codex --remove. It removes per.hr's hooks from Codex and leaves any other hooks in place. Your per.hr account and everything recorded stay as they are.
Request access, run one command, approve the hooks in Codex, and your next session arrives ready to confirm.