Skip to content
Agentmart
Submit a tool

osquery-dev

Use when writing, testing, debugging, or verifying osquery SQL queries.

Skill by hurricanehrndz

IndexedMIT
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/hurricanehrndz-osquery-dev

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use when writing, testing, debugging, or verifying osquery SQL queries.

Use cases: backend, testing, writing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/osquery-dev

What's inside

Skill name
osquery-dev
Description
Use when writing, testing, debugging, or verifying osquery SQL queries.
License
MIT
Instructions
68 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# osquery dev

Develop against the same runtime the query ships to, verify piece by piece, and
never read an empty result as a broken join before probing.

## Run the query

```bash
osqueryi -json "SELECT ..."          # exits after the result
osqueryd -S -json "SELECT ..."       # osqueryd needs -S to act as osqueryi
```

Without `-S`, `osqueryd` stays resident and the call hangs until timeout.
Writable `--logger_path`, `--config_path`, and `--extensions_socket` are
required; a missing one exits 78. When the binary is Orbit's:

```text
/opt/orbit/bin/osqueryd/macos-app/stable/osquery.app/Contents/MacOS/osqueryd
```

pass its flags after `--`.

Fleet runs osqueryd as root. Test with `sudo` when you can; otherwise expect
zero rows from root-only paths and read that as a privilege artifact, not a
broken join.

## Empty result != broken query

Decompose the query into one labeled probe per table and run them as separate
statements first. The first empty probe is the answer; the joined query is only
rerun after every probe returns.

```sql
SELECT 'users' AS src, username, uid, directory FROM users WHERE uid >= 501;
SELECT 'file' AS src, path, size, mtime FROM file WHERE path LIKE '/Users/%/...';
SELECT 'apps' AS src, bundle_identifier, last_opened_time
  FROM apps WHERE bundle_identifier = '...';
```

Then mirror each probe in the joined query — JOIN order, LEFT JOINs, and WHERE
clauses that restate probe filters.

## Table traps

- `apps` sees bundles outside standard app dirs, but a launchd-execed bundle
  reports `last_opened_time = -1.0`: EXISTS only, never join on it.
- `processes.start_time` is unix time on macOS but seconds-since-boot on Linux —
  normalize before `datetime()` when a query must run on both.
- `pkg_receipts` does not exist on macOS builds: install time comes from
  `file.mtime` on the bundle, which moves on every update, so read it as
  latest-install, never first-install.
- `users` wraps negative uids to `4294967294` (`nobody`, `/var/empty`), and
  those rows pass `uid >= 501` — filter on `directory LIKE '/Users/%'` too.
- `plist` emits one row per matching path; `IN (...)` across several paths is
  valid, and a missing path just returns no rows.
- Fractional epochs return as strings (`"1788276135.21331"`):
  `CAST(col AS INTEGER)` before mtime arithmetic, `ABS(a - b)` for freshness
  deltas.
- Scalar subqueries with `CASE WHEN EXISTS` stay uncorrelated and evaluate once;
  correlated ones re-run per row.

## Ship it

A query is verified when every probe returns, the joined query returns, and each
threshold heuristic (staleness windows, size floors) cites its observed cadence
or measurement rather than a guess.

From hurricanehrndz/agent-toolkit, MIT.

More from hurricanehrndz/agent-toolkit

Signals

Stars
0
Forks
0
Open issues
0
Last commit (this folder)
Sep 1, 2026 (1 month ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from hurricanehrndz

Cite this page

osquery-dev skill. Agent Mart. https://agentmart.dev/skills/hurricanehrndz-osquery-dev (last updated 2026-10-24)