SlopCop in your coding agent
Your agent checks its own change with SlopCop, reads what it found, and fixes it before it hands the work back. Two things make that work without a human in the loop:
- The skill. A set of instructions, bundled in the
slopcopbinary, that tells an agent how to run a check, how to read the report, which exit codes mean what, and what to do about each.slopcop initinstalls it where your agents look for skills. See The agent skill. - The Stop hook. For Claude Code and Codex, a hook that runs a check when the agent stops after writing files, and hands new findings in those files back to the agent to fix. See The Stop hook.
The CLI itself is built for this: it never prompts, sends one request, and answers with a closed exit-code contract. Any agent that can run a shell command can run it.
Set up
Section titled “Set up”Once per machine:
slopcop init # skill into every agent found here, plus the hookslopcop login # approve the code in your browserslopcop # check from any repositoryslopcop init names what it did. A skill that is already there is left alone,
so running it again is safe. See the Quickstart.
How a check works
Section titled “How a check works”- Your agent runs
slopcop, because the skill tells it to, because you asked, or because the Stop hook fired. - The CLI builds one git patch from the merge base with your upstream branch to the working tree: unpushed commits, unstaged edits, and untracked files. Git-ignored files stay out.
- The service applies the patch at that base commit in its own clone and runs Bifrost over the files the change writes. Your code is read, never run, and never sent to a language model.
- The report comes back. New findings, on lines the change added or touched, fail the check. Findings already in the code are counted, never failed.
- The agent fixes the new findings and checks again, until none are left. A
false positive it ignores with
slopcop ignore <id>, and later checks leave it out.
The exit codes an agent acts on
Section titled “The exit codes an agent acts on”| Exit | Meaning | What the agent does |
|---|---|---|
0 | Clean. The check completed and the change added no finding. | Carries on. |
1 | Findings. The change added at least one. | Fixes them and checks again. |
2 | Incomplete, or the CLI or service failed. No new finding crossed the threshold, but some rule could not finish. | Reports which rules did not complete. Never reads it as all clear. |
3 | Still running when --timeout ran out. | Runs the same check again; it picks up the same analysis. |
4 | The service refused the check and only a person can clear it: sign in, credits, access, or a repository to confirm. | Stops and tells you the code and remedy. |
Exit codes has the full table, including interrupts.
Which models wrote what
Section titled “Which models wrote what”Run by Claude Code or Codex, a check also sends which models wrote each changed
file, read from the session’s own record, so a finding can be traced to the
model that wrote its line. The CLI reads only the model, effort, and file of
each edit, never the conversation, a tool’s input, or a file’s contents. Run
outside an agent, a check sends none of it. slopcop --verbose prints what it
would send. See What leaves your machine.
Per agent
Section titled “Per agent”- Claude Code: personal skills,
/slopcop, the Stop hook insettings.json, and the line forCLAUDE.md. - Codex:
~/.agents/skillsand$CODEX_HOME/skills,$slopcop, trusting the hook with/hooks, and the line forAGENTS.md. - Other agents: opencode, and anything with a shell.