ALL INTELLIGENCE
Hacker News AIT2·Tools

Stroq Locally Audits Coding Agent Sessions, Tracing Command Origins and Key Leaks

Original title: Show HN: Stroq – a local audit of what your coding agent did and why
62AI Score

Stroq is a local CLI that reads the last 30 days of Claude Code and Codex sessions to count how many commands originated from text the agent read (a prompt-injection exposure surface) and which keys left the machine. It prints key names but never values, caches only under ~/.stroq, and requires no account or telemetry.

Full Report

Contents3 sections

Who is really in charge of your agent?

Stroq reads your own Claude Code and Codex sessions and shows how many commands came from text your agent read, and which keys left your machine.

<picture> <source media="(prefers-color-scheme: dark)" srcset="docs/assets/readme/card-dark.png"> <img src="docs/assets/readme/card.png" alt="The Stroq card in a terminal, on an example machine: Hoo, an orange pixel owl, beside the counts for 30 days of agent sessions (105 commands your agent ran, 1 that came from text it read, 1 key that left the machine, 1 repo that runs code as soon as an agent opens it) and three moments worth a look, each with a stroq show line" width="800"> </picture>

<sub>An example: a made-up machine with made-up sessions, keys and hosts. Hoo is Stroq's owl. Your card shows your own sessions.</sub>

BASH
npx @stroq/cli

It reads your last 30 days of sessions, your key files and the folders your agent worked in; prints key names, never values; writes nothing but a small cache under ~/.stroq; and sends nothing. No account, no telemetry.

TEXT
npx @stroq/cli            a card of your own sessions, like the one above
npx @stroq/cli init       stop it next time: guard your agent
npx @stroq/cli why        why an action was stopped
npx @stroq/cli attack     watch Stroq stop 36 known attacks, in a sandbox
npx @stroq/cli uninstall  remove Stroq

Every moment on the card has a stroq show line that prints the evidence behind it (npx @stroq/cli show 1). stroq help --all lists the other commands. Needs Node.js 22 or newer. Apache-2.0.

Beyond the card

Stroq is a local security platform for AI coding agents: Claude Code, Cursor, Codex CLI and others. Its hooks judge every tool call before it runs. They deny curl | sh and outbound calls that carry a known secret from your machine, and they ask you first when a command repeats text the agent read, naming that text. The console shows which agents actually ask Stroq, and every decision with its reason. Sessions you already had can be checked too, without installing anything.

BASH
npx @stroq/cli console        # the console: a private page on 127.0.0.1
npx @stroq/cli replay --all   # your Claude Code sessions of the last 30 days against the policy; no hooks needed
npx @stroq/cli sent           # did your agent pass your keys on? key names, never values
npx @stroq/cli init           # hook into your agent and guard the next session
<img src="docs/assets/readme/console-live.png" alt="Stroq console, Live screen: the last 8 recorded actions, 4 allowed, 1 asked you, 2 denied, 1 flagged, and a denied action opened into what the agent read, what it did, the decision and the rule" width="900">

<sub>A made-up machine: made-up sessions, keys and hosts. Nothing was executed.</sub>

The console

<table> <tr> <td width="50%"><img src="docs/assets/readme/console-check.png" alt="Check screen: Hoo beside the card for 30 days of agent sessions, with the counts and the moments worth a look, each with its evidence"><br><b>Check</b>: the card of <code>stroq</code>, made by the same code. Each moment opens with its evidence, under it one line for each agent.</td> <td width="50%"><img src="docs/assets/readme/console-live.png" alt="Live screen: the last 8 recorded actions, 4 allowed, 1 asked you, 2 denied, 1 flagged, and a denied action opened into what the agent read, what it did, the decision and the rule"><br><b>Live</b>: recorded decisions as they happen. A row opens into its chain: what the agent read, what it did, the decision, the rule.</td> </tr> <tr> <td width="50%"><img src="docs/assets/readme/console-agents.png" alt="Agents screen: Claude Code, Cursor and Codex CLI, each with Configure and Test hook, and the settings that weaken the agent, such as hooks switched off"><br><b>Agents</b>: add or remove Stroq's hooks, with the exact file change shown first. When Stroq was last asked, and which of an agent's settings weaken it.</td> <td width="50%"><img src="docs/assets/readme/console-skills.png" alt="Skills and MCP screen: every skill and MCP server by agent, where it came from, what the rules matched in it and what changed since you last looked"><br><b>Skills &amp; MCP</b>: every skill and MCP server by agent: where it came from, what the rules matched in it, what changed since you last looked.</td> </tr> </table>

The fifth screen is Rules: try an action without running it, turn rules on with a preview and a test, the history with an undo, and the rules reference. Connected means Stroq's hooks are in the agent's settings, not that the agent calls them: Test hook and Live show that.

<sub>Screens from a build just before 0.30.0, reading a made-up machine: made-up sessions, keys and hosts. Nothing was executed.</sub>

BASH
npx @stroq/cli console                            # a private page on 127.0.0.1
npx @stroq/cli console --workspace /path/to/repo  # the project it should look at

Open the whole link it prints: it carries a key that is new each time the console starts. The console reads what Stroq already records on this machine. It changes an agent's settings or Stroq's policy only after you confirm a preview of that change; checks you run are saved under ~/.stroq.

It listens only on 127.0.0.1, needs no account and has no telemetry. Nothing in it starts your agent: Test hook runs the hook once, offline. Adding hooks from the console needs macOS or Linux; on Windows use stroq init. Details and limits: console guide.

From a source checkout:

BASH
pnpm install --frozen-lockfile
pnpm --dir console install --ignore-workspace --frozen-lockfile
pnpm platform:build
pnpm platform --workspace /path/to/repo

(注:更多技术实现细节与完整 API 文档请查阅原项目 README)