Agent skill

Osquery Query Helper

by tsale in tsale/awesome-dfir-skills

Help users write, validate, and troubleshoot osquery SQL queries using provided osquery table schemas as the authoritative source.

Apache-2.0Auto-check passedDatabases

Install Osquery Query Helper

skills CLI
$ npx skills add tsale/awesome-dfir-skills --skill osquery-query-helper -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install tsale/awesome-dfir-skills osquery-query-helper --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/tsale/awesome-dfir-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/hunting/osquery-helper .claude/skills/osquery-query-helper && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
osquery-query-helper
GitHub stars
323
Token cost
~1.5k tokens
SKILL.md length
632 words
Files
4 (incl. scripts)
Skills in repo
5
Repo updated
First seen
Licence
Apache-2.0

At a glance

Help users write, validate, and troubleshoot osquery SQL queries using provided osquery table schemas as the authoritative source.

  • Works in 8 steps: Search for Relevant Tables → Extract Full Table Definition → Verify Before Using → …
  • Tasks that involve SQL
  • SKILL.md covers What This Skill Does, When to Use, Schema File Format and Schema Lookup Procedure, plus 2 more sections
  • Runs Shell scripts from its folder; calls bash

What it does

Osquery Query Helper is an agent skill from tsale/awesome-dfir-skills. Help users write, validate, and troubleshoot osquery SQL queries using provided osquery table schemas as the authoritative source.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 5 other files, including scripts (for example `scripts/detect-format.sh` and `scripts/extract-table.sh`).

It sits in Databases, covering SQL. It works with SQL, Linux and macOS. The repository describes itself as: A curated collection of DFIR skills and workflows for InfoSec practitioners. The licence is Apache-2.0.

When your agent uses it

  • Tasks that involve SQL

Example prompts

  • “/osquery-query-helper”

Requirements

  • A Bash shell

Workflow steps

8 steps, taken from the step headings in SKILL.md.

  1. Search for Relevant Tables
  2. Extract Full Table Definition
  3. Verify Before Using
  4. Identify EDR Platform
  5. Understand the Request
  6. Search and Extract Schema
  7. Write, Validate, or Fix
  8. Deliver Response

What it can do on your machine

Read from SKILL.md and the folder at commit 6e52942. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 2 files in scripts/ (Shell), which the agent can run.

    Shell commands in SKILL.md call:

    • bash

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Osquery Query Helper loads about 1.5k tokens when it runs. Until then it costs about 38 tokens; SKILL.md has 632 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~38
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from tsale/awesome-dfir-skills at commit 6e52942, republished under its Apache-2.0 licence (© tsale). 632 words, ~1,493 tokens.

Download SKILL.mdSave it as .claude/skills/osquery-query-helper/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
osquery-query-helper
description
Help users write, validate, and troubleshoot osquery SQL queries using provided osquery table schemas as the authoritative source.

Osquery Query Helper

What This Skill Does

Help users with all aspects of osquery query work:

  • Write queries from scratch based on investigation goals
  • Validate queries the user has written against the schema
  • Troubleshoot queries that aren't working as expected
  • Suggest improvements for performance and accuracy

All work is grounded in the tables and columns defined in the provided schema files for the specified EDR platform.

When to Use

  • User needs a query written for incident response or threat hunting
  • User wants to validate an existing query against the correct schema
  • User has a query that's failing and needs help troubleshooting
  • User wants suggestions to improve query performance

Schema File Format

Schema files are located in resources/ and named by EDR platform: <platform>_osquery_schema.spec

  • standard_osquery_schema.spec — Baseline vanilla osquery (default when no platform specified)
  • EDR-specific examples: bitdefender_, kolide_, crowdstrike_, sentinelone_, carbonblack_

To discover available platforms:

bash
ls resources/*_osquery_schema.spec 2>/dev/null || ls resources/*.spec
Platform Notation Formats

Schema files use one of two formats to indicate OS compatibility:

Format 1: Explicit platforms([...]) field
table_name("<table_name>")
description("Brief description.")
schema([
    Column("column_name", TYPE, "Column description")
])
implementation("<table_name>@genTable")
platforms(["darwin", "linux", "windows"])
Format 2: #platform marker before table definitions

A platform marker on its own line applies to all tables until the next marker:

#darwin
table_name("<mac_only_table>")
...

#linwin
table_name("<linux_windows_table>")
...
Platform Marker Reference
MarkerPlatforms
#darwinmacOS only
#linuxLinux only
#windowsWindows only
#linwinLinux and Windows
#macwinmacOS and Windows
#posixmacOS, Linux, FreeBSD
#sleuthkitmacOS, Linux (requires The Sleuth Kit)
#utilityCross-platform utility tables
#cross-platformAll supported platforms

Schema Lookup Procedure

The schema files are large. Always follow the workflow below to extract table definitions.

Helper scripts are provided in scripts/ to simplify complex operations:

  • scripts/detect-format.sh - Determines schema format
  • scripts/extract-table.sh - Extracts complete table definitions
1. Search for Relevant Tables
bash
# Search by table name keyword
grep -i 'table_name(".*<keyword>' "$SCHEMA_FILE"

# Search descriptions for concepts
grep -i 'description(".*<concept>' "$SCHEMA_FILE"
2. Extract Full Table Definition

Use the extraction script to get the complete table definition:

bash
bash scripts/extract-table.sh <schema_file> <table_name>

Example:

bash
bash scripts/extract-table.sh resources/standard_osquery_schema.spec processes

The script automatically:

  • Detects the schema format (platforms array vs platform markers)
  • Extracts the complete table definition including all columns and platform info
  • Includes the #platform marker for Format 2 schemas

If you need to check the format manually:

bash
bash scripts/detect-format.sh <schema_file>
# Returns: "platforms_array" or "platform_markers"
3. Verify Before Using
  • Confirm columns exist: Only use columns explicitly listed in the schema([...]) block
  • Check OS compatibility: Via platforms([...]) field or preceding #platform marker
  • If unsupported: Inform the user and suggest alternatives

Guidelines

Show full SKILL.md (276 more words)Show less
When Writing Queries
  1. Schema is law: Only use tables/columns confirmed via grep from the correct platform schema
  2. Platform awareness: Verify OS support for each table
  3. Performance first: Always include WHERE clauses, use LIMIT for exploration, avoid SELECT *, minimize JOINs
  4. Use placeholders: '<path_to_file>', '<username>', '<timestamp>', '<ip_address>'
  5. Be upfront about gaps: If a table/column doesn't exist, say so and suggest alternatives
When Validating User Queries
  1. Verify each table exists in the platform schema
  2. Confirm all referenced columns exist
  3. Check OS compatibility
  4. Flag performance issues (missing WHERE, SELECT *, expensive JOINs)
  5. Offer corrected queries, not just problems
When Troubleshooting
  1. Start with schema—most failures are mismatches
  2. Check basics: table exists, columns spelled correctly, OS supported
  3. Consider EDR differences—query may be from a different platform
  4. Explain why something failed, not just how to fix it
Safety and Privacy
  • Redact sensitive data in examples
  • Query only necessary data
  • Prefer hashes over file content dumps
  • Use time constraints to limit data volume

Workflow

0. Identify EDR Platform

Ask user or check context. Default to standard_osquery_schema.spec if unspecified.

1. Understand the Request

Writing new query? Validating? Troubleshooting? What data is needed?

2. Search and Extract Schema

Use grep to find tables, then bash scripts/extract-table.sh to get full definitions. Verify columns and OS compatibility from the extracted output.

3. Write, Validate, or Fix

Use only verified tables/columns. Add WHERE clauses and LIMIT for performance.

4. Deliver Response

Include:

  • EDR platform/schema used
  • Schema lookups performed (show grep commands)
  • The query with syntax highlighting
  • Explanation of what it does or what was wrong
  • Assumptions (platform, OS, environment)
  • Limitations (missing tables/columns, OS restrictions, performance concerns)

© tsale, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts) in skills/hunting/osquery-helper of tsale/awesome-dfir-skills.

  • SKILL.md
  • resources/standard_osquery_schema.spec
  • scripts/detect-format.sh
  • scripts/extract-table.sh

Open the folder on GitHubat commit 6e52942

Compare with similar skills

Osquery Query Helper next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Osquery Query Helper compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Osquery Query Helper this skilltsale/awesome-dfir-skills323—~1.5kAutomated safety check: PassApache-2.0
Grdbjohnrogers/claude-swift-engineering231—~719Automated safety check: PassMIT
RevopsAvdLee/RocketSimApp8046 repos~3.7kAutomated safety check: PassCustom licence
Forensics OsqueryAgentSecOps/SecOpsAgentKit2201 repos~4.9kAutomated safety check: NotesCustom licence
Evolving The Data ModelTriliumNext/Trilium38k—~2.1kAutomated safety check: PassAGPL-3.0
Safe SQL Executionsupabase/supabase111k—~4.2kAutomated safety check: PassApache-2.0

Similar skills

  • Grdb

    johnrogers/claude-swift-engineering

    A skill your agent uses when writing raw SQL with GRDB, complex joins across 4+ tables, window functions, ValueObservation for reactive queries, or dropping down from SQLiteData for performance.

    231 GitHub stars~719 tokensUpdated 8 mo ago
    DatabasesAuto-check passed
  • Revops

    AvdLee/RocketSimApp

    When the user wants help with revenue operations, lead lifecycle management, or marketing-to-sales handoff processes.

    804 GitHub starsUsed in 6 repos~3.7k tokens
    Sales & SupportAuto-check passed
  • Forensics Osquery

    AgentSecOps/SecOpsAgentKit

    SQL-powered forensic investigation and system interrogation using osquery to query operating systems as relational databases.

    220 GitHub starsUsed in 1 repo~4.9k tokens
    SecurityAuto-check: notes
  • Evolving The Data Model

    TriliumNext/Trilium

    A skill your agent uses when adding a DB migration or a new column/field to a Becca entity in Trilium ("add a migration", "new column on notes/attributes", "ALTER TABLE", "add a field to…

    38k GitHub stars~2.1k tokensUpdated today
    DatabasesAuto-check passed
  • Safe SQL Execution

    supabase/supabase

    Official

    A skill your agent uses whenever code will build, return, fetch, or execute SQL that runs against a user's real Postgres database — even when the request reads like an ordinary feature or bug fix…

    111k GitHub stars~4.2k tokensUpdated today
    DatabasesAuto-check passed
  • Citus Backport

    citusdata/citus

    Backport one or more merged citusdata/citus main commits/PRs onto the active release branches.

    13k GitHub stars~3.2k tokensUpdated yesterday
    DatabasesAuto-check passed

More from tsale/awesome-dfir-skills

  • Malware Analysis

    tsale/awesome-dfir-skills

    Professional malware analysis workflow for PE executables and suspicious files.

    323 GitHub stars~2.5k tokensUpdated 4 mo ago
    Auto-check passed
  • Admiralty System

    tsale/awesome-dfir-skills

    Apply the NATO Admiralty System (AJP-2.1) to assess source reliability and information credibility in cyber threat intelligence, OSINT, and breach analysis.

    323 GitHub stars~3.4k tokensUpdated 4 mo ago
    Auto-check passed
  • Analysing Attack

    tsale/awesome-dfir-skills

    Analyse Mitre ATT&CK tactics, techniques and sub-techniques.

    323 GitHub stars~1.4k tokensUpdated 4 mo ago
    Auto-check passed
  • Threat Actor Profiling

    tsale/awesome-dfir-skills

    Build structured threat actor profiles using the 5W1H framework and the Diamond Model.

    323 GitHub stars~2.8k tokensUpdated 4 mo ago
    Auto-check passed

Works with

Categories

Questions about Osquery Query Helper

What does Osquery Query Helper do?

Help users write, validate, and troubleshoot osquery SQL queries using provided osquery table schemas as the authoritative source. Osquery Query Helper is an agent skill from tsale/awesome-dfir-skills. Help users write, validate, and troubleshoot osquery SQL queries using provided osquery table schemas as the authoritative source.

When should I use Osquery Query Helper?

Osquery Query Helper fits situations like: tasks that involve SQL.

How do I install Osquery Query Helper in Claude Code?

Run `npx skills add tsale/awesome-dfir-skills --skill osquery-query-helper -a claude-code`. Or copy the skill folder (skills/hunting/osquery-helper in tsale/awesome-dfir-skills) into .claude/skills/osquery-query-helper in your project. Claude Code loads it when a task matches its description.

How do I install Osquery Query Helper in Codex?

Run `npx skills add tsale/awesome-dfir-skills --skill osquery-query-helper -a codex`. Or copy the skill folder (skills/hunting/osquery-helper in tsale/awesome-dfir-skills) into .agents/skills/osquery-query-helper in your project. Codex loads it when a task matches its description.

Can I use Osquery Query Helper in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add tsale/awesome-dfir-skills --skill osquery-query-helper -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/osquery-query-helper, .gemini/skills/osquery-query-helper, .github/skills/osquery-query-helper and .opencode/skills/osquery-query-helper in your project.

What does Osquery Query Helper need to run?

Going by SKILL.md and its folder, Osquery Query Helper needs a shell for the scripts in its folder and the command-line tools its instructions call (bash). Our summary lists: A Bash shell.

Does Osquery Query Helper access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Osquery Query Helper safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Osquery Query Helper use?

Osquery Query Helper is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Osquery Query Helper use?

About 1.5k tokens (SKILL.md is roughly 6k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Osquery Query Helper?

Skills that share tags, products or a category with Osquery Query Helper: Grdb (johnrogers/claude-swift-engineering, 231 stars), Revops (AvdLee/RocketSimApp, 804 stars), Forensics Osquery (AgentSecOps/SecOpsAgentKit, 220 stars) and Evolving The Data Model (TriliumNext/Trilium, 38k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Osquery Query Helper?

tsale (a GitHub user) maintains it in tsale/awesome-dfir-skills, which has 323 GitHub stars. The repository holds 5 skills in this directory. The repository was last updated on May 14, 2026.

Source: tsale/awesome-dfir-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.