# How to Configure search-queries.md for Targeting Specific Roles and Locations

> Learn how to configure search-queries.md to target specific roles and locations. This guide explains mapping job titles and preferences to CLI commands for each job board.

- Repository: [Mads Lorentzen/ai-job-search](https://github.com/MadsLorentzen/ai-job-search)
- Tags: how-to-guide
- Published: 2026-07-14

---

**The [`search-queries.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/search-queries.md) file acts as the central configuration hub that maps your desired job titles and geographic preferences into portal-specific CLI commands, using priority categories to organize role-based queries alongside location flags for each job board.**

The `ai-job-search` repository by MadsLorentzen uses a declarative configuration approach to automate job discovery across multiple platforms. The [`.claude/skills/job-scraper/search-queries.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/skills/job-scraper/search-queries.md) file serves as the single source of truth for defining which combinations of roles and locations the scraper targets, translating generic search criteria into platform-specific command-line arguments.

## Where search-queries.md Lives and Its Core Function

Located at [`.claude/skills/job-scraper/search-queries.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/skills/job-scraper/search-queries.md), this markdown file stores the **priority categories** and **portal mappings** that drive the job scraper. Unlike hardcoded search strings, this configuration separates your target roles (such as "AI Engineer" or "Data Scientist") from the specific syntax each job portal requires.

## How Role Targeting Works via Priority Categories

The file organizes searches into **numbered priority categories** (for example, `1️⃣ Data Science`, `2️⃣ AI Engineering`). Each category contains **portal-specific query strings** that define the role keywords.

When you run `/setup --section search`, Claude Code interviews you about desired positions and populates these categories. The scraper uses a **"top-3 priority"** logic: it runs the three highest-weighted categories during broad searches, or focuses on a specific category when you narrow the scope.

## How Location Targeting Maps to Portal-Specific Flags

Locations are configured through **portal-specific CLI flags** rather than generic strings. Each portal block in [`search-queries.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/search-queries.md) combines role keywords with location parameters using the exact syntax required by that platform's CLI tool:

- **Jobindex**: Uses `--region` codes (such as `cph` for Copenhagen)
- **LinkedIn**: Uses `-l` for location strings (such as `"Remote"` or `"Copenhagen, Denmark"`)
- **Jobnet**: Uses `--key` for regional identifiers
- **Freehire**: Uses `--query` with location modifiers

## The Configuration Syntax

Each entry follows YAML-like syntax within the markdown structure. Here are concrete examples from the configuration:

For targeting AI Engineer roles in Copenhagen on Jobindex:

```yaml

# 1️⃣ AI Engineer – Copenhagen

jobindex-search:
  --search-string: "AI Engineer"
  --region: "cph"

```

For targeting the same role remotely on LinkedIn:

```yaml

# 1️⃣ AI Engineer – Remote

linkedin-search:
  --search-string: "AI Engineer"
  -l: "Remote"

```

## How the Interactive Setup Generates the Configuration

When you execute `/setup --section search`, the system:

1. Captures your target roles through interview prompts
2. Records your preferred locations (cities, regions, or remote)
3. Translates these inputs into the proper CLI flag syntax for each supported portal
4. Writes the resulting YAML blocks into [`.claude/skills/job-scraper/search-queries.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/skills/job-scraper/search-queries.md) under the appropriate priority categories

This generation process ensures that manual editing is not required to add new role-location combinations, though you can manually edit the file to refine queries without re-running the setup.

## How the Scraper Consumes the Configuration

The scraper logic, defined in [`.claude/skills/job-scraper/SKILL.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/skills/job-scraper/SKILL.md), reads [`search-queries.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/search-queries.md) and constructs executable commands. For each active priority category, it:

1. Parses the portal identifier (e.g., `jobindex-search`, `linkedin-search`)
2. Extracts the `--search-string` value for the role
3. Appends the location flag (such as `--region` or `-l`)
4. Executes the corresponding CLI tool (for example, `bun run jobindex-search --search-string "AI Engineer" --region cph`)

This abstraction allows the same "AI Engineer in Copenhagen" intent to trigger different CLI syntax for each portal automatically.

## Summary

- The [`.claude/skills/job-scraper/search-queries.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/skills/job-scraper/search-queries.md) file stores **priority categories** that organize your target roles numerically
- **Portal-specific query strings** combine role keywords with location flags using each platform's required CLI syntax
- The `/setup --section search` command generates this configuration by interviewing you about desired roles and locations
- **Jobindex** uses `--region` codes, **LinkedIn** uses `-l` flags, and other portals use their respective `--key` or `--query` parameters
- The scraper reads these entries to build executable commands like `bun run jobindex-search --search-string "AI Engineer" --region cph`

## Frequently Asked Questions

### How do I add a new city to my existing search queries?

Edit [`.claude/skills/job-scraper/search-queries.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/skills/job-scraper/search-queries.md) and locate the portal block for your target job board. Add the location-specific flag (such as `--region` for Jobindex or `-l` for LinkedIn) with the appropriate city code or name. Save the file—the scraper will use the new location parameters on the next run without requiring a restart.

### Can I target multiple roles in the same search without running the setup again?

Yes. Open [`search-queries.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/search-queries.md) and add additional entries under the same priority category number. For example, place "Data Scientist" and "ML Engineer" entries under the `1️⃣` category. The scraper will execute both queries when that priority level is active. Alternatively, create separate priority categories if you want to rank certain roles higher than others.

### What happens if I specify a location that a job portal does not support?

The scraper will pass your location flag to the underlying CLI tool, which typically returns zero results or an error depending on the portal's validation. Each portal in the `ai-job-search` repository uses its own SKILL.md file (located in `.agents/skills/`) that documents supported location formats. Refer to these files to ensure you use valid region codes or location strings for each specific platform.

### How does the priority system determine which queries run first?

The scraper reads the numeric prefixes (such as `1️⃣`, `2️⃣`, `3️⃣`) in [`search-queries.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/search-queries.md) to establish execution order. When you request a broad search, it automatically selects the **top-3 priority categories**. When you specify a focus area (such as "data science"), it runs only the matching category. Lower-numbered categories execute first, allowing you to prioritize your most desired roles.