Agents
How Claude Code and Codex use InputLayer, what the agent sees and when, and what it may and may not do.
InputLayer is built for the agent. The agent sees the guarantees before it edits covered code, can run a check at any point, gets a counterexample when it breaks something, and fixes the code. It cannot weaken what it is checked against. This page describes the Claude Code plugin, Codex over MCP, and the rules both follow.
Claude Code
Public install is not available yet.
The plugin has three parts: an MCP server with tools, skills that teach Claude when to use them, and hooks that run at fixed points in a session.
What Claude sees, and when
| Moment | What happens | What Claude sees |
|---|---|---|
| Session start | Every guarantee that is not up to date is checked | One line, which you see too: InputLayer is checking 1 guarantee: "Someone removed from a workspace can't see or change anything in it, even work that's already running." Holds. A suggested guarantee shows as InputLayer: 1 guarantee suggested, not active yet: ... with the il accept command |
| Before the first edit to covered code | The plugin finds the guarantees whose checks cover the file | Each guarantee's sentence, bounds and what it leaves out, before the edit runs |
Claude tries to edit .inputlayer/ | Once the project has guarantees, the edit is refused | Why: guarantees and checks are not the agent's to change |
| After an edit to covered code | The guarantee is marked out of date | Which guarantees the edit touched, the steps whose lines changed, and what to do: move a step's anchor if the code still does what the step says, else repair the code, then call recheck. The Quickstart shows it |
Claude calls check or recheck | The check runs on the guarantee's model. A model il derived is not checked after the code it watches changed: il derives it again at the next stop | The verdict in InputLayer's words; a holding result carries its bounds and what it leaves out, an out-of-date one says why |
| Claude tries to finish | Anything out of date is checked. A reproduced break introduced by this task, or a pre-existing one whose path this task edited, blocks the stop | The counterexample, the bounds, and "repair the code, then call recheck" |
| After the third blocked stop | The next stop goes through | The finding goes to you as needs your decision, with your options |
| Task done | The summary is written | Nothing more: you see one line, such as InputLayer checked 1 guarantee: it holds.; each guarantee's verdict, bounds and what it leaves out, and what changed during the task, are in .inputlayer/last-task.md to paste into the PR |
In a session, only a break that replays on the real code blocks. A break that does not reproduce is cannot tell, shown as needs your decision, and Claude is told to say so rather than keep trying. A break that already existed before the task started is listed and does not block. In CI, a break also fails the job when it was never tried on the code: there is no way to replay it, its test could not run, or its trace or replay ran out of time or could not be made (exit 1, cannot tell on the certificate). One that was replayed and did not reproduce does not (with --strict it exits 4).
The plugin compares content hashes, not tool events, so an edit by any route counts: the Edit and Write tools, a shell command, or another program.
Hooks
| Hook | Matcher | What it does |
|---|---|---|
SessionStart | Checks guarantees that are not up to date and prints one line. In a project with no guarantees, says so once and points to the protect skill | |
PreToolUse | Read|Edit|Write|MultiEdit|NotebookEdit|Bash | Shows the guarantees covering a file before the first edit to it. Once the project has guarantees, refuses Claude's direct writes to .inputlayer/ |
PostToolUse | Edit|Write|MultiEdit|NotebookEdit|Bash | Marks guarantees out of date when covered code changed |
Stop | Checks what is out of date, blocks while a guarantee is broken and reproduced (at most 3 times), then writes the summary | |
SessionEnd | Records that the session is no longer open |
The hooks run il hook <event>. If il is missing, the session starts with one line saying nothing is checked, and the other hooks stay out of the way.
MCP tools
The plugin's MCP server is il mcp. Claude sees each tool as mcp__plugin_inputlayer_inputlayer__<tool>.
| Tool | Arguments | What it does |
|---|---|---|
status | Every guarantee with its verdict, open change requests, and what this session checked | |
check | guarantee_id? | Checks one guarantee, or all of them, on the code as it is |
recheck | guarantee_id | Checks a guarantee again after an edit and records the result for the hooks |
trace | guarantee_id | The counterexample of a broken guarantee, step by step |
anchor | guarantee_id, step, path, start, end | Re-ties a check's step to the lines of code it stands for, when that code moved |
review_model | guarantee_id, reason | Marks nothing: gives the person the il protect review command and what to tell them. Only a person, in their terminal, marks a check as wrong; the guarantee is then cannot tell (under review) |
change_request | guarantee_id, belief, kind | Files a change request and stops. kind is guarantee_wrong, conflicts_with_task or repairs_failed |
Skills
| Skill | When Claude uses it |
|---|---|
/inputlayer:check | When to call the tools, and how to read and report a verdict with its bounds |
/inputlayer:protect | Suggesting guarantees: finds two or three risky spots, writes each as a sentence with bounds and what it leaves out, and lets you pick |
/inputlayer:status | Every guarantee with its verdict |
/inputlayer:audit | Auditing a repository or a branch, reporting only breaks that reproduce on the code |
/inputlayer:change-request | Filing a change request instead of working around a guarantee |
Settings
| Variable | Effect |
|---|---|
INPUTLAYER_HINTS=off | Turns off the one-line hint in projects with no guarantees |
IL_BIN | The il binary the plugin runs, instead of the pinned build |
Set them in your shell or in the env block of Claude Code's settings.
Codex
Codex uses InputLayer through MCP, with il mcp as the server. Public install is not available yet.
This needs il on your PATH. Codex gets the same tools as Claude Code. It does not get the plugin's hooks, so nothing refuses its edits to .inputlayer/ and nothing blocks it from finishing on a broken guarantee. Two things make up for that:
- CI is the authority. The PR is checked against the base branch's guarantees whatever the agent did locally. An edit Codex makes to a guarantee file does not apply to its own PR and needs a code owner's approval.
- Instructions. Add this to your
AGENTS.md:
This repository has InputLayer guarantees in .inputlayer/guarantees.yaml.
- Before editing code, call the inputlayer `status` tool and read the guarantees that cover it.
- After editing, call `recheck` for each guarantee your edit touched.
- Do not finish while a guarantee is "broken, reproduced on the real code". Fix the code.
- Never edit anything under .inputlayer/. If a guarantee looks wrong, call `change_request` and stop.
- Report every result with its verdict and its bounds.What the agent may and may not do
The agent owns the code. InputLayer owns the checks and the evidence. You own the guarantees.
The agent may:
- read guarantees, checks, verdicts and counterexamples;
- run
check,recheckandtraceat any point; - change the code to fix a break;
- suggest guarantees, which are written as
status: suggestedand block nothing; - file a change request when it believes a guarantee is wrong, conflicts with the task, or could not be brought back in three repairs.
The agent may not:
- edit a guarantee, a check, an evidence bundle or a change request, by any tool, including shell commands. Once the project has guarantees, the plugin refuses the write, and a change made some other way makes every guarantee
cannot tell(changed_outside_il) until the files are restored; - accept a guarantee, or change its status: when Claude Code is open in the project,
il acceptis not enforced; - close a change request:
il change-request closeis refused without a terminal and inside an agent session; - override a break: only a person with write access can, with a comment on the PR (never give the agent a token with write access);
- call
review_modelon its own, or to get past a blocked stop. The certificate records who marked a check as under review; - report a result without its bounds, or in stronger words than the verdict.
Words the agent uses
The agent reports each result with its verdict and its bounds, in the same words InputLayer uses: holds within bounds, broken, reproduced on the real code, cannot tell with the reason. For example: "removed-member-no-access: holds within bounds (one member, one workspace, one removal during one piece of work; each loop at most twice)". It does not say a change is correct, done, or safe beyond what the checks show, and it says what was not checked.
When repair is not the answer
When the agent believes a guarantee is wrong, that it conflicts with the task, or that it cannot be brought back in three repairs, it files a change request and stops instead of working around it. In the Quickstart, asked to let whoever started a job always read and cancel it, Claude filed one and asked the person to decide. il change-request show removed-member-no-access-1 prints it:
The request changes no verdict, and CI acts on the guarantee as before, until you change the guarantee in a reviewed PR or keep it, and close the request in your terminal. See Guarantees.