GitAuto Logo
  1. Home
  2. Pricing
  3. Docs
  4. Dashboard
  5. Blog
  6. Contact
  1. Home
  2. How It Works
  3. Use Cases
  4. Pricing
  5. Docs
  6. Dashboard
  7. FAQ
  8. Blog
  9. Contact

Line Numbers

GitAuto formats every file it reads with right-aligned line numbers inside code fences. Each line is prefixed with its number using the format {line_num:>width}:{line}, producing output like:

  1:import React from 'react'
  2:
  3:export const App = () => (
  4:  <div>Hello</div>
  5:)

Why This Exists

Without explicit line numbers, the model describes changes like "replace the import statement" instead of "replace line 1." When a file has multiple similar-looking lines - duplicate imports, repeated patterns, or common variable names - the model frequently targets the wrong location, producing broken diffs. Pre-computed line numbers give the model an unambiguous coordinate system so it never has to count. Diffs become precise: "at line 47, replace this with that." The right-alignment ensures consistent formatting regardless of file length - a 9-line file and a 999-line file both produce clean, readable output.

Why Models Can't Count Lines

Models don't see text line-by-line - they process chunks of tokens, where a single token might span part of a line or multiple short lines. Counting to "line 47" in a 200-line file requires tracking position across dozens of tokens, and the error rate grows with file length. Tokenization turns source code into subword pieces that have no alignment with newline characters, so the concept of "line number" doesn't exist natively in how the model represents text. The model has to count from the top of the file to figure out where it is - and it routinely miscounts, especially in longer files where the accumulated error compounds with each line.

How It Works

When GitAuto reads a file from the repository, it calculates the width needed for the largest line number, then pads every line number to that width. A 50-line file uses 2-character padding; a 500-line file uses 3. The colon separator between the number and the content makes it unambiguous where the line number ends and the code begins.

This formatting is applied before the file content enters the model's context window, so the model always sees numbered lines and can reference them in its tool calls for creating or modifying files.

Related Features

  • Full File Reads - ensures entire files are loaded so line numbers cover all content
  • Diff Hunk Repair - fixes diffs when line references are slightly off

Need Help?

Have questions or suggestions? We're here to help you get the most out of GitAuto.

Contact us with your questions or feedback!

Full File Reads

Getting Started

  • Installation
  • Setup

Triggers

  • Overview
  • Schedule Trigger
  • Test Failure Trigger
  • Review Comment Trigger
  • Dashboard Trigger

Coverage Dashboard

  • Overview
  • Python Testing
  • JavaScript Testing
  • Java Testing
  • Go Testing
  • PHP Testing
  • Ruby Testing
  • Flutter Testing
  • Multi-Language
  • Coverage Charts

Customization

  • Repository Rules
  • Output Language
  • GITAUTO.md

Integrations

  • CircleCI Integration
  • npm Integration

How It Works

Context Enrichment

  • Line Numbers
  • Full File Reads
  • Test File Preloading
  • Test Naming Detection
  • Error Baselines
  • CI Log Cleaning
  • Trigger-Specific Prompts
  • Coding Standards

Output Auto-Correction

  • Diff Hunk Repair
  • Diff Prefix Repair
  • Tool Name Correction
  • Tool Argument Correction
  • Import Sorting
  • Trailing Space Removal
  • Final Newline
  • Line Ending Preservation
  • Sanitize Tool Arguments
  • Lint Disable Headers

Quality Verification

  • Formatting
  • Linting
  • Type Checking
  • Test Execution
  • Coverage Enforcement
  • phpcs / phpstan Support
  • PHPUnit Support
  • pytest Support
  • Snapshot Auto-Update
  • Untestable Detection
  • Should-Skip Detection
  • Dead Code Removal
  • Quality Check Scoring
  • Quality Checklist

Safety Guardrails

  • File Edit Restrictions
  • Temperature Zero
  • PR/Branch Checks
  • Race Condition Prevention
  • Bot Loop Prevention
  • Webhook Deduplication
  • Duplicate Error Hashing
  • Infrastructure Failure Detection
  • Strict Tool Schemas
  • No-Change Detection

Token/Cost Management

  • Token Trimming
  • Outdated Diff Removal
  • Stale File Replacement
  • Skip CI Intermediate
  • CI Log Deduplication
  • Web Fetch Summarization
  • Context Forgetting
  • File Query Routing
  • On-Demand Diff

Resilience & Recovery

  • Model Fallback
  • Overload Retry
  • Forced Verification
  • Error Files Editable

Hallucination Prevention

  • Web Search
  • URL Fetching
  • Anti-Hallucination Prompts
  • GITAUTO.md Restrictions
  • Review Response Guardrails

Ready to improve your test coverage?

Go from 0% to 90% test coverage with GitAuto. Start for free, no credit card required.

Install FreeContact Sales

Product

  • Home
  • Why GitAuto
  • What GitAuto Does
  • How It Works
  • Use Cases
  • How to Get Started
  • Solution
  • Pricing
  • Pricing Details
  • ROI Calculator
  • ROI Methodology
  • FAQ
  • Blog
  • Contact

Dashboard

  • Dashboard
  • Coverage Trends
  • File Coverage
  • Credits
  • Open PRs
  • Usage
  • Triggers
  • Actions
  • References
  • Rules
  • CircleCI Integration
  • npm Integration

Documentation

  • Docs
  • Getting Started
  • Setup
  • Triggers
  • Coverage Setup
  • Customization
  • How It Works
  • Auto Merge
  • CircleCI
  • npm

Legal

  • Privacy Policy
  • Terms of Service

Connect

  • GitHub
  • LinkedIn
  • Twitter
  • YouTube
GitAuto Logo© 2026 GitAuto, Inc. All Rights Reserved