ai-job-search: Command for Claude Code

.claude/commands/gmail-sync.md

gmail-sync is a command for Claude Code from MadsLorentzen/ai-job-search. It costs 0 tokens per session (3,915 once invoked), scanned A, original, MIT.

A command that reviews Gmail for messages about tracked job applications, such as interview invitations, assessments, offers, and rejections.

In plain words
What is it for?
Use it to propose status updates backed by source emails, then approve a batch of changes to the job tracker and application outcome files.
Why use it?
It helps keep application records current without asking you to inspect every relevant email manually, while requiring approval before changing records.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution.

This is MadsLorentzen/ai-job-search's own configuration. It tells Claude Code how to work on ai-job-search itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ai-job-search configures →

About the project

AI Job Search is a Claude Code-based framework that runs on a user's machine to organize an AI-assisted job application process. It evaluates job postings, adapts CVs, writes cover letters, and helps prepare for interviews. The catalogue entries define commands, skills, instructions, an agent, and a setting for this workflow.

MadsLorentzen/ai-job-search · 47,502 stars · on GitHub

Reuse

Borrowing it

Nothing to install: this file belongs to MadsLorentzen/ai-job-search. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/MadsLorentzen/ai-job-search/master/.claude/commands/gmail-sync.md
Clone the repo
git clone --depth 1 https://github.com/MadsLorentzen/ai-job-search

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gmail-sync

README.md
[![agentmods](https://agentmods.dev/badge/commands/madslorentzen/ai-job-search/gmail-sync/github.svg)](https://agentmods.dev/commands/madslorentzen/ai-job-search/gmail-sync)
Your own site
<a href="https://agentmods.dev/commands/madslorentzen/ai-job-search/gmail-sync"><img src="https://agentmods.dev/badge/commands/madslorentzen/ai-job-search/gmail-sync/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gmail-sync

Your own site · 80×15
<a href="https://agentmods.dev/commands/madslorentzen/ai-job-search/gmail-sync"><img src="https://agentmods.dev/badge/commands/madslorentzen/ai-job-search/gmail-sync.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,915 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.03915
Opus 5.5 $0.00000 $0.01566
Sonnet 5.5 $0.00000 $0.00783
Haiku 4.5 $0.00000 $0.00392

Measured 29d ago against content hash 3ca178b77672, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

gmail-sync scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 29d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

Copies of this mod

2 near-identical copies found in the catalogue:

.claude/commands/gmail-sync.md · 195 lines

How it starts

The opening of the file, as written. The whole thing — 195 lines — stays where its author put it; the contents beside it link to each section on GitHub.

/gmail-sync - Sync Application Status from Gmail

You are scanning the user's Gmail for status signals on tracked job applications (interview invites, assessment links, offers, rejections) and, once approved, writing the detected changes into job_search_tracker.csv and documents/applications/<company>_<role>/outcome.md - the same two places /outcome writes to, in the same schema.

Unlike /outcome (which asks the user what happened), /gmail-sync classifies real emails on its own - but it never writes on its own. Every classified change is presented as a batch before anything touches the tracker or outcome.md, and only proceeds once the user approves it (approving the whole batch at once is fine; writing first and flagging it after is not). Because a wrong write silently corrupts application history that /setup later calibrates from, every proposed change must cite its source email and every uncertain case must be surfaced instead of guessed. Never treat this command's job as "notice something in an inbox" - it is "propose a correct, sourced line for a permanent record, and write it only once the user says yes."

Follow these steps in order.


Step 0: Prerequisites

Confirm the Gmail MCP tools (mcp__claude_ai_Gmail__*) are available. If not, tell the user to connect the Gmail integration (claude.ai Settings → Connectors → Gmail) and stop - do not attempt this via Bash, IMAP, or any other channel.


Step 1: Parse Input

$ARGUMENTS may contain:

  • Nothing → default lookback (see Step 3)
  • A company name, e.g. /gmail-sync acme → scope the search to that one tracked application
  • since <YYYY-MM-DD> → override the lookback start date for this run only (does not change the persisted state file)

Step 2: Load State

  1. Read job_search_tracker.csv. If it does not exist, tell the user there is nothing to sync against yet (suggest /outcome or /apply first) and stop. Do not create it here - /gmail-sync never originates new applications, only updates existing ones.
  2. Read gmail_sync/state.json (create if missing: {"last_sync": null, "processed_message_ids": []}).
  3. Build the set of open applications: tracker rows whose status is not Final (per the Tracker status vocabulary in /outcome). For each, derive its archive folder documents/applications/<company>_<role>/ by the Subfolder naming rule in documents/README.md and check whether outcome.md exists there. Reuse this exact derived path for any write in Step 7a.

Read the full file on GitHub · 195 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 29d ago Changed · +2 lines 3ca178b77672
  2. 1mo ago First seen · 193 lines · 0 tokens per session scan A 613f9817df69

Subscribe to this mod's changes

gmail-sync is a command published in the GitHub repository MadsLorentzen/ai-job-search (47,502 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 3,915 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.