Skip to main content

Codex

Codex gets a skill, five hooks and a permission profile. The profile lets commands in Codex's sandbox write the state and sessions directories and reach only the search hosts, so a search runs without opening the network to anything else.

Install​

Setup finds Codex when codex is on PATH.

jevlin setup # sets up every agent it finds
jevlin setup -with codex # found or not
jevlin agents install -client codex # later, without the rest of setup

Codex can also run the install itself: codex plugin marketplace add jevlinai/jevlin-go, then install the plugin from /plugins. It is a setup skill that installs the client and runs jevlin setup, which writes the skill, hooks and permission profile below.

MCP instead of the skill​

jevlin mcp serves search, fetch and decide (where the router offers it) as MCP tools, for a host that prefers MCP to a shell skill. Setup does not register it. To add it by hand, with jevlin on Codex's PATH (or its full path in its place), add to ~/.codex/config.toml:

[mcp_servers.jevlin]
command = "jevlin"
args = ["mcp"]

It runs only while Codex holds it open. See The MCP server.

Approve the hooks​

Then start codex, or open the app, and approve Jevlin's hooks when Codex asks you to review hooks. Until you do, the hooks do nothing. Searches still run, without a session or a turn, and under codex exec nothing says so. Jevlin never records an approval for you. jevlin agents status says what Codex has on record: an approval for some or all of the hooks, none, or that it cannot tell. A hook whose command changes, after you move the binary or the config, may need approving again; an upgrade in place does not change the commands.

note

Supported Codex is 0.158.0 or newer. Below 0.131 Codex refuses the whole config file with "invalid type: map, expected a boolean" and does not start. Upgrade Codex, or remove the block between its two markers. Versions 0.131 to 0.157 have not been tried.

What is written​

pathwhat
~/.codex/skills/jevlin/The skill, rendered for your OS and shell.
~/.codex/hooks.jsonmacOS and Linux: five hooks, PreToolUse, SessionStart, PreCompact, PostCompact and Stop, each written where any of Jevlin's stood before so no other hook moves.
~/.codex/config.tomlA marked block, created if the file is not there. On macOS and Linux it is a permission profile named jevlin, made the default with default_permissions. On Windows it makes the same directories writable and opens no network.

The block sits before the first table in the file, because default_permissions must, and is added and taken out without a byte of its own, so uninstall gives your file back exactly as it was.

Use it​

Ask Codex anything that needs the web, or be explicit with $jevlin <question>: Codex names a skill with $, where the other agents use /. $jevlin off, $jevlin on, $jevlin status and $jevlin tier <tier> work as /jevlin … does in every other agent with the skill. Codex runs Bash on macOS and Linux, PowerShell on Windows. See Search from your agent.

What to know​

What the profile opens. It extends Codex's :workspace profile, or a profile of your own that you agreed to switch from, with write access to the state and sessions directories, and network access to the search hosts only: the router and the platform's agents API. The block also turns on Codex's network_proxy feature, which is what enforces the host list. The config and key are never writable from the sandbox. A host on this machine's loopback is never listed.

The Switch? question. When your config has a setting of your own that the profile would change, such as your own profile in default_permissions, default_permissions = ":workspace", a bare sandbox_mode = "workspace-write" or network_proxy = false in your [features] table, install asks once and shows every line it would write. -yes does not answer it. Answering no installs nothing for Codex and exits 0; no answer stops the install, exit 2, writing nothing but one line: an open network left in jevlin's own block by an earlier version is closed, and the message says so. Without a terminal (stdin from /dev/null included, since 0.8.3), agents install prints the exact lines to change by hand and the block to add, and exits 2; setup reports Codex as not set up and exits 0.

With a profile of your own. Jevlin's profile extends yours and Codex merges the two. Once Jevlin's turns the network on, every host your profile, or a profile it extends, allows is reachable too, each host decided by the nearest profile that names it, and a wildcard deny (any key holding * or ?) wins over any exact allow. The Switch? question names every such host, and install refuses for Codex when the router's host is denied. A read-only sandbox, or a [sandbox_workspace_write] table of your own, gets nothing for Codex, and install prints the profile to adopt; under danger-full-access only the skill and hooks are written.

Without the block. A search returns results but cannot write its lineage file or its turn mark, and the claim resume it starts cannot write, so the claim is never picked up. Sandboxed commands can read credentials.json and the state directory and leave files in the directories the block makes writable; Jevlin's hooks, which run outside the sandbox, never write through a link left there. If your config puts jevlin.toml, or the folder that holds credentials.json, inside one of those directories, install widens nothing and says why.

Changing hosts. If you change [router] url or [agents] url in your config, run jevlin agents install again. jevlin agents status says when the profile names other hosts than the config does.

Turning the proxy off. codex features disable network_proxy deletes the profile's [features.network_proxy] table, and the profile then lets every command Codex runs reach any host. jevlin agents status says so, and jevlin agents install puts the table back. Do not set network_proxy = false in a project config while Jevlin's profile is your default: status reads only ~/.codex/config.toml and cannot see it.

The trace. With the hooks approved, a search carries its session, turn and call, and a subagent's search names the session that started it. Only the search command the skill shows is given them; it is allowed without a prompt, as is the fetch the skill shows; the search after a cd, in a loop or piped on runs as written with the per-shell identity. A Codex search carries no assistant text.

The turn end. With [search] turn_end = true, the Stop hook reports a turn in which a search was served, read from Codex's own session file: what you asked, what the assistant wrote along the way, its final answer, and each tool call by name and outcome. A subagent's turn sends nothing of its own. See The turn end.

Codex writes into its own file too. Tables at the end, a [features] table from codex features enable, settings from the desktop app. Install and uninstall change only Jevlin's own lines, move a setting Codex wrote inside the markers to just above them and a table to just below them, and name each in the plan. A block that has lost a marker (codex features disable network_proxy deletes the comments above the table it removes) is still recognized, repaired by the next install and removed whole by uninstall. A block that is not valid TOML, or whose profile holds anything Jevlin did not write, is left and reported.

Known limits​

  • Windows gets no hooks and no profile. What runs a Codex hook there has not been seen, and no permission profile has been seen to work in Codex's sandbox. The block makes the directories writable and opens no network, so a search there needs Codex's approval to reach the router.
  • A Codex turn end gives a shell command no duration. The session file Codex 0.160.0 writes holds none that is the command's.
  • An explicit sandbox mode discards the profile. A client of Codex's app server that starts a thread with its own sandbox mode has the network off for that thread. The skill cannot help there.
  • On Linux, each command runs in its own process namespace. A claim resume a search starts ends with the search; a search from another agent or your shell, or jevlin connect, picks the claim up instead. The daily release check is never started from inside the sandbox either.

Remove​

jevlin agents uninstall -client codex

Removes the skill, Jevlin's hooks and its block, and puts back each line of yours it changed, unless you changed it since. When uninstall has to leave Jevlin's block, it names it, lists what to put back, and exits 1. See Removing and coming back.