# How the AI Job Search Framework Uses Claude Code for Agent-Based Job Application Automation

> Discover how the AI Job Search framework leverages Claude Code for automated job applications. Explore agent-based workflows that scrape listings, assess fit, and create custom resumes.

- Repository: [Mads Lorentzen/ai-job-search](https://github.com/MadsLorentzen/ai-job-search)
- Tags: deep-dive
- Published: 2026-08-29

---

**The AI Job Search repository uses Claude Code as its central runtime, executing Markdown-based command scripts in the `.claude/commands/` directory to orchestrate multi-agent workflows that scrape listings, evaluate fit, and generate tailored application documents.**

The AI Job Search framework transforms Anthropic's Claude Code CLI into an autonomous job application engine. By leveraging Claude Code's ability to execute external commands, maintain persistent context, and spawn isolated agent instances, the repository automates end-to-end job applications through a structured, permission-controlled environment.

## Architecture Overview

The framework treats Claude Code as the **reference runtime** for all automation tasks. Every high-level operation is defined as a command script that Claude Code parses and executes:

- **Claude Code runtime** executes agent scripts, provides sandboxed file access, and enforces permission scopes via [`.claude/settings.json`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/settings.json).
- **`.claude/commands/`** contains plain-text Markdown files (e.g., [`setup.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/setup.md), [`apply.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/apply.md), [`scrape.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/scrape.md)) that define interactive commands. Claude Code reads these files to present prompts and execute associated logic.
- **`.claude/skills/job-application-assistant/`** stores the knowledge base, including candidate profiles ([`01-candidate-profile.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/01-candidate-profile.md)), evaluation criteria ([`04-job-evaluation.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/04-job-evaluation.md)), and LaTeX template definitions ([`05-cv-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/05-cv-templates.md), [`06-cover-letter-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/06-cover-letter-templates.md)).
- **Job-portal CLI tools** are Bun-based utilities (located in `.agents/skills/jobindex-search/cli/`) that scrape listings and return JSON results for Claude Code to consume.
- **[`.claude/settings.json`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/settings.json)** acts as a permission manifest, enumerating which external commands (e.g., `Bun`, `Python`, `curl`) Claude Code may invoke during the workflow.

## The Agent-Based Workflow: Inside the `/apply` Command

When a user runs `/apply <url>`, Claude Code initiates a sophisticated multi-agent pipeline defined in [`.claude/commands/apply.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/commands/apply.md). This command orchestrates distinct Claude instances acting as specialized agents:

1. **Fetch**: Claude Code executes a portal-specific CLI tool from `.agents/skills/` to retrieve the raw job description.

2. **Evaluate**: Using the scoring rules defined in [`.claude/skills/job-application-assistant/04-job-evaluation.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/skills/job-application-assistant/04-job-evaluation.md), Claude compares the posting against the candidate profile stored in [`01-candidate-profile.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/01-candidate-profile.md).

3. **Draft**: A **drafter agent** (the primary Claude instance) composes tailored CV and cover letter content in LaTeX, respecting the templates defined in [`05-cv-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/05-cv-templates.md) and [`06-cover-letter-templates.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/06-cover-letter-templates.md).

4. **Review**: A **reviewer agent** (a second Claude instance spawned with fresh context) critiques the drafts for accuracy, tone, and alignment with the job requirements.

5. **Revise**: The drafter incorporates feedback and produces final PDF outputs.

6. **Output**: Claude Code saves the completed documents to `documents/applications/<company>_<role>/` and displays them to the user.

This **drafter-reviewer pattern** ensures quality control by separating content generation from critical evaluation, with each agent maintaining isolated context to prevent bias.

## Security and Permission Controls

Claude Code's [`settings.json`](https://github.com/MadsLorentzen/ai-job-search/blob/main/settings.json) file enforces strict operational boundaries. Located at [`.claude/settings.json`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/settings.json), this manifest explicitly lists vetted external commands—such as `bun`, `python3`, and `pdflatex`—that the agent may invoke. This permission model ensures that even when executing automated scrapers or compiling LaTeX documents, the framework remains constrained to predefined, safe operations.

## Practical Usage Examples

Interact with the framework through the Claude Code REPL:

```bash

# Launch the Claude Code environment

claude

```

Once inside the REPL, trigger the automation commands:

```bash

# Run interactive onboarding to populate candidate-profile.md

/setup

```

```bash

# Scrape all configured job portals (Jobindex, Jobnet, etc.)

/scrape

```

```bash

# Execute the full agent pipeline for a specific posting

/apply https://jobindex.dk/job/1234567

```

Internally, the `/apply` command reads [`.claude/commands/apply.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/commands/apply.md), which contains the orchestration logic:

```markdown

### /apply workflow

1. Fetch posting → run portal CLI from .agents/skills/
2. Score posting → apply rules from 04-job-evaluation.md
3. Draft materials → use 05-cv-templates.md & 06-cover-letter-templates.md
4. Spawn reviewer → critique drafts against candidate profile
5. Revise → compile final PDFs via LaTeX

```

## Extending the Framework

New functionality is added by dropping Markdown files into the appropriate directories. Claude Code automatically discovers new command scripts in `.claude/commands/` and new skill definitions in `.claude/skills/`. This **file-based architecture** eliminates configuration duplication—all metadata lives in version-controlled Markdown that Claude Code reads and writes directly.

## Summary

- **Claude Code serves as the execution engine**: Every command (`/setup`, `/apply`, `/scrape`) is a Markdown script parsed by Claude Code.
- **Multi-agent workflows ensure quality**: The drafter-reviewer pattern uses separate Claude instances to generate and critique application materials.
- **Security is permission-based**: [`.claude/settings.json`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/settings.json) strictly controls which external binaries the agent can execute.
- **Knowledge is centralized**: Candidate profiles, evaluation criteria, and templates live in `.claude/skills/job-application-assistant/` as plain Markdown.
- **Output is organized**: Generated PDFs are saved to `documents/applications/<company>_<role>/` for easy retrieval.

## Frequently Asked Questions

### What is the drafter-reviewer pattern in the AI Job Search framework?

The drafter-reviewer pattern is a multi-agent workflow where one Claude instance (the drafter) generates initial CV and cover letter drafts using templates from `.claude/skills/job-application-assistant/`, while a second, context-isolated Claude instance (the reviewer) critiques the output for accuracy and fit. This separation of concerns improves output quality by simulating an editorial review process before finalizing documents.

### How does Claude Code secure the automation workflow?

Security is enforced through [`.claude/settings.json`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/settings.json), which acts as an explicit permission manifest. This file enumerates exactly which external commands—such as `bun` for running scrapers or `pdflatex` for document compilation—Claude Code is allowed to invoke. The framework cannot execute arbitrary system commands outside this vetted list, preventing unauthorized operations during automated job applications.

### Where are the generated application documents stored?

Completed application materials are persisted to `documents/applications/<company>_<role>/` (e.g., `documents/applications/TechCorp_SeniorEngineer/`). This directory structure is created automatically by the `/apply` command script defined in [`.claude/commands/apply.md`](https://github.com/MadsLorentzen/ai-job-search/blob/main/.claude/commands/apply.md), organizing all PDF outputs and supporting files by employer and position for easy tracking.

### Can I add support for new job portals to the framework?

Yes. The framework uses modular CLI tools located in `.agents/skills/` (such as `.agents/skills/jobindex-search/cli/`). To add a new portal, create a Bun-based command-line utility that outputs job listings in the expected JSON format, then reference it in the relevant command script. Claude Code will automatically invoke your new scraper when executing the `/scrape` or `/apply` commands.