How the Relevance-Weighted CV Cutting Algorithm Works: Smart Trimming for Job Applications

The relevance-weighted CV cutting algorithm intelligently shrinks oversized CVs by scoring each line on relevance to the job posting, uniqueness within the document, and narrative load on the cover letter, then iteratively removing the lowest-scoring content until the document fits within the two-page budget.

The MadsLorentzen/ai-job-search repository implements a sophisticated document optimization system that goes beyond simple truncation to preserve high-value content. Unlike chronological deletion methods that simply remove older entries, this relevance-weighted approach ensures that hard-won achievements matching target job keywords survive the cut, even when they appear in older roles.

The Three Scoring Criteria

Every bullet point in the CV receives a composite score derived from three distinct dimensions. These criteria are defined in .claude/skills/job-application-assistant/05-cv-templates.md and implemented in the core cutting logic.

Relevance to Job Posting

Relevance measures how well a specific line aligns with the target job posting's extracted keywords and responsibilities. The compute_relevance() function compares the line text against the posting's keyword set, increasing the score for each match identified. A line containing multiple high-priority technical skills or domain-specific terminology from the job description receives a significantly higher relevance score than generic responsibilities.

Content Uniqueness

Uniqueness evaluates whether the information appears elsewhere in the CV. Duplicate content receives a lower uniqueness score, while unique statements that provide distinct value are favoured. The algorithm calculates this using a formula similar to 1 / (1 + duplicate_count), penalizing repetitive phrasing or recycled achievement bullets while protecting singular accomplishments that demonstrate breadth of experience.

Narrative Load

Narrative load determines whether removing a line would force a rewrite of the cover letter. If a CV bullet is referenced by or supports a specific paragraph in the cover letter, it is considered "load-bearing" and receives a substantial bonus score via compute_narrative_load(). This synchronization ensures that the CV and cover letter remain coherent documents that reference consistent achievements rather than isolated claims.

The Iterative Cutting Process

According to the project README at line 256 and the apply.md command reference, the algorithm executes through four distinct phases:

  1. Score every line — Each bullet receives a total score combining relevance, uniqueness, and narrative load (higher scores indicate higher preservation priority).

  2. Select the lowest-scoring line — The line with the smallest composite score (least relevant, most duplicate, and not required by the cover letter) is marked for removal.

  3. Iterate — After deleting a line, scores are recomputed because relevance distributions and narrative dependencies may shift, then the process repeats until the CV fits within the page budget.

  4. Apply structural fallback cuts — If all individual lines have been exhausted before reaching the page limit, the algorithm applies broader reductions such as trimming the oldest education entry, limiting older roles to two bullets, or collapsing certifications into a single line.

Implementation Details

The core logic resides in Python functions that process the CV line-by-line. Here is the conceptual implementation as structured in the repository:

def relevance_weighted_cut(cv_lines, posting_keywords, cover_letter_refs):
    """
    Reduce cv_lines to fit within the page budget using relevance-weighted cutting.
    """
    while exceeds_page_budget(cv_lines):
        # 1. Score each line

        scores = []
        for i, line in enumerate(cv_lines):
            rel = compute_relevance(line, posting_keywords)
            uniq = compute_uniqueness(line, cv_lines)
            load = compute_narrative_load(line, cover_letter_refs)
            total = rel + uniq + load      # higher is better

            scores.append((total, i))

        # 2. Identify the lowest-scoring line

        scores.sort(key=lambda x: x[0])   # ascending → lowest first

        _, idx_to_remove = scores[0]

        # 3. Remove it and continue

        del cv_lines[idx_to_remove]

    return cv_lines

The helper functions perform the following calculations:

  • compute_relevance(line, posting_keywords) counts keyword matches between the CV line and the job posting's extracted terms.
  • compute_uniqueness(line, cv_lines) identifies duplicates across the document and applies a penalty to redundant content.
  • compute_narrative_load(line, cover_letter_refs) checks cross-references; if the line supports the cover letter, it returns a large bonus value that effectively protects the content from removal.

Application to Cover Letters

The same relevance-weighted logic applies when the cover letter exceeds its single-page limit. In this context, the algorithm prioritizes sentences that are redundant or unrelated to the posting, ensuring that critical opening hooks and role-specific arguments remain intact while removing generic pleasantries or repetitive closing statements.

Summary

  • The relevance-weighted CV cutting algorithm uses three criteria—relevance to the job posting, uniqueness within the document, and narrative load on the cover letter—to determine content value.
  • It iteratively removes the lowest-scoring lines first, recomputing scores after each deletion to account for shifting dependencies.
  • Fallback structural cuts handle edge cases where line-level trimming proves insufficient, targeting education entries and older role descriptions.
  • The system maintains document coherence by protecting content that the cover letter references, ensuring the application package remains internally consistent.
  • Implementation spans README.md, .claude/skills/job-application-assistant/05-cv-templates.md, and the apply.md command file.

Frequently Asked Questions

How does the algorithm decide which CV line to remove first?

The algorithm calculates a composite score for every line using relevance (keyword matches to the job posting), uniqueness (absence of duplicates), and narrative load (cover letter dependencies). The line with the lowest total score—indicating it is generic, repetitive, and unsupported by the cover letter—is selected for removal first.

What happens when individual line trimming is not enough to fit the page limit?

When all individual bullets have been exhausted and the CV still exceeds the budget, the algorithm applies structural fallback cuts as documented in 05-cv-templates.md at line 325. These include removing the oldest education entry entirely, condensing older professional roles to two bullet points maximum, or collapsing multiple certifications into a single summary line.

Can this algorithm handle cover letter overflow as well?

Yes, the same relevance-weighted cutting logic applies to cover letters when they exceed the single-page constraint. The system targets sentences that are redundant or unrelated to the posting for removal, ensuring that critical opening statements and role-specific arguments receive priority preservation.

Where is the relevance-weighted cutting algorithm documented?

The high-level description appears in the project's README.md at line 256, with detailed cutting rules specified in .claude/skills/job-application-assistant/05-cv-templates.md at line 325. The apply.md command file at line 251 references this algorithm when triggering the CV trimming workflow during the application process.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →