retrace AGENTS.md

retrace AGENTS.md is an instructions file for Codex, OpenCode from haseab/retrace. It costs 5,567 tokens per session, scanned C, original, MIT.

An AGENTS.md guide for Retrace, a macOS app that records screens, reads text from them with OCR, and makes the recordings searchable locally. AGENTS.md is a standard file containing instructions for coding agents.

In plain words
What is it for?
Understanding Retrace’s current features and project structure, finding the right build and test instructions, and preparing or reporting bug fixes.
Why use it?
It gives agents shared project context, module-specific rules, and safety guidance before they change the code.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/haseab/retrace/agents-md
Clone the repo
git clone --depth 1 https://github.com/haseab/retrace

Made for: Codex, OpenCode.

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 retrace AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/haseab/retrace/agents-md.svg)](https://agentmods.dev/instructions/haseab/retrace/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/haseab/retrace/agents-md"><img src="https://agentmods.dev/badge/instructions/haseab/retrace/agents-md.svg" alt="Measured on agentmods" height="20"></a>
Per session 5,567 This file is loaded in full into every session.
When invoked 5,567 The same file — it is already loaded in full.
Security scan C 1 finding. Scan, not verified.
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 $0.05567 $0.05567
Opus 5 $0.02783 $0.02783
Sonnet 5 $0.01113 $0.01113
Haiku 4.5 $0.00557 $0.00557

Measured 3d ago against content hash 8750a1c90aed, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade C, and why

retrace AGENTS.md scanned grade C with 1 finding 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 3d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf .build/
AGENTS.md · 490 lines

How it starts

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

Retrace - Agent Guide

Standard: This file follows the AGENTS.md specification - a vendor-agnostic standard for AI agent guidance. For human-readable project information, see README.md.

Retrace is a local-first screen recording and search application for macOS, inspired by Rewind AI. It captures screens, extracts text via OCR, and makes everything searchable—all locally on-device.

Status: Core screen capture (CGWindowListCapture), OCR (Vision), full-text search (FTS5), HEVC encoding, and Rewind import are working. Audio transcription and vector search are planned for future releases.


Quick Reference

  • Module-Specific Instructions: Each module has its own AGENTS.md file in its directory
  • Human Documentation: README.md, CONTRIBUTING.md, and AI_ISSUE_TEMPLATE.md
  • Issue Reporting: Use AI_ISSUE_TEMPLATE.md and gh issue create --body-file ... for AI-authored GitHub issues
  • Bug Fixes by Non-Owners: If the user is fixing a bug/crash and does not appear to be the repo owner, encourage them to create or link a GitHub issue before making code changes
  • Technical Audit Docs: local/docs/ (includes deep-dive implementation and performance audit notes)

Project Commands

Build & Test

# Build all targets
swift build

# Run all tests
swift test

# Run specific module tests
swift test --filter DatabaseTests

# Run specific test
swift test --filter testSpecificMethod

# Clean build artifacts
rm -rf .build/

Project Structure

retrace/
├── AGENTS.md                    # This file - main agent coordination
├── .env.example                 # Template for local release credentials (copy to .env)
├── .github/                     # GitHub configuration
│   ├── CODEOWNERS
│   ├── FUNDING.yml
│   └── ISSUE_TEMPLATE/
│       └── bug_report.yml       # GitHub bug report form aligned with AI issue template
├── AI_ISSUE_TEMPLATE.md         # Canonical markdown template for AI-authored bug reports
├── README.md                    # Human-readable project overview
├── CONTRIBUTING.md              # Contribution guidelines
├── Package.swift                # Swift Package Manager configuration
├── scripts/                     # Build/release/validation scripts
│   ├── release.sh               # End-to-end release automation
│   ├── create-release.sh        # Release build + packaging helper
│   ├── check_no_nanoseconds_sleep.sh # Guardrail for Task.sleep(nanoseconds:)
│   ├── validate_sleep_wake_stability.sh # Sleep/wake soak validation workflow
│   └── validate_darkwake_watchdog.sh # Automated darkwake watchdog regression validation
│
├── Shared/                      # CRITICAL: Shared types and protocols
│   ├── Logging.swift            # Central log utility (Log.debug/info/warning/error)
│   ├── AppPaths.swift           # Application path configuration
│   ├── BGRAImageUtilities.swift # Shared BGRA conversion + patch extraction helpers
│   ├── MasterKeyManager.swift   # Keychain-backed master key creation + recovery phrase export
│   ├── ReversibleOCRScrambler.swift # Deterministic reversible OCR patch scrambling + text protection
│   ├── Models/                  # Data types used across modules
│   │   ├── Frame.swift          # FrameID, CapturedFrame, VideoSegment
│   │   ├── Text.swift           # ExtractedText, OCRTextRegion
│   │   ├── TextRegion.swift     # OCR text region types
│   │   ├── Search.swift         # SearchQuery, SearchResult
│   │   ├── Segment.swift        # Segment data model
│   │   ├── Config.swift         # Configuration types
│   │   ├── Errors.swift         # Error types
│   │   ├── Audio.swift          # Audio model types (Release 2)
│   │   ├── FilterCriteria.swift # Timeline/search filter criteria
│   │   ├── Source.swift         # Data source enum (native, rewind, etc.)
│   │   ├── Tag.swift            # Tag model types
│   │   └── Comment.swift        # Segment comment and attachment models
│   └── Protocols/               # Module interfaces
│       ├── DatabaseProtocol.swift
│       ├── StorageProtocol.swift
│       ├── CaptureProtocol.swift
│       ├── ProcessingProtocol.swift
│       ├── SearchProtocol.swift
│       └── MigrationProtocol.swift
│
├── Database/                    # SQLite + FTS5 storage
│   ├── AGENTS.md                # Module-specific agent instructions
│   ├── DatabaseManager.swift    # Main database coordinator
│   ├── DatabaseConnection.swift # SQLite connection management
│   ├── DatabaseConfig.swift     # Database configuration
│   ├── FTSManager.swift         # Full-text search management
│   ├── IDMappingService.swift   # ID mapping between sources
│   ├── Schema.swift             # Current schema definition
│   ├── Migrations/              # Schema migration scripts
│   ├── Queries/                 # Query implementations
│   └── Tests/
│
├── Storage/                     # File I/O, HEVC encoding
│   ├── AGENTS.md
│   ├── StorageManager.swift
│   ├── ImageExtractor.swift     # Extract frames from video files
│   ├── IncrementalSegmentWriter.swift
│   ├── SegmentWriterImpl.swift
│   ├── FileManager/             # File system utilities
│   ├── VideoEncoder/            # HEVC video encoding
│   ├── WAL/                     # Write-Ahead Log (WALManager, RecoveryManager)
│   └── Tests/
│
├── Capture/                     # CGWindowListCapture integration
│   ├── AGENTS.md
│   ├── CaptureManager.swift
│   ├── ScreenCapture/           # Screen capture implementation
│   ├── Deduplication/           # Perceptual hash deduplication
│   ├── Metadata/                # AppInfoProvider, BrowserURLExtractor
│   └── Tests/
│
├── Processing/                  # OCR and text extraction
│   ├── AGENTS.md
│   ├── ProcessingManager.swift
│   ├── FrameProcessingQueue.swift # Async frame processing queue
│   ├── URLExtractor.swift       # URL extraction from OCR text
│   ├── OCR/                     # Vision framework OCR
│   ├── Accessibility/           # Accessibility API integration
│   ├── TextMerger/              # Text merging utilities
│   └── Tests/
│
├── Search/                      # Full-text search
│   ├── AGENTS.md
│   ├── SearchManager.swift
│   ├── IngestionManager.swift   # Search index ingestion
│   ├── QueryParser/             # Query parsing (app:, date:, -exclude)
│   ├── Ranking/                 # Result ranking implementation
│   ├── VectorSearchTODO/        # Planned for Release 2 (excluded from build)
│   └── Tests/
│
├── Migration/                   # Import from other apps
│   ├── AGENTS.md
│   ├── MigrationManager.swift
│   └── Importers/               # Source-specific importers (Rewind)
│
├── App/                         # Main application coordinator
│   ├── AppCoordinator.swift     # Central coordinator (orchestrates all modules)
│   ├── DataAdapter.swift        # Data layer adapter (DB queries, transformations)
│   ├── FeedbackRecentMetricSupport.swift # Shared feedback-export metric models and sanitization helpers
│   ├── ServiceContainer.swift   # Dependency injection container
│   ├── AppLifecycle.swift       # App lifecycle management
│   ├── ModelManager.swift       # Model management
│   ├── OnboardingManager.swift  # First-run onboarding flow
│   ├── RetentionManager.swift   # Data retention policies
│   └── Tests/
│       ├── FeedbackRecentMetricSupportTests.swift # Feedback-export metric sanitization coverage
│       ├── InPageURLCaptureRoutingTests.swift
│       ├── MasterKeyManagerTests.swift
│       ├── ServiceContainerRewindCutoffTests.swift # Rewind cutoff defaults and latest-frame probe coverage
│       ├── TestLogger.swift
│       ├── TimelineStillDiskWriterTests.swift
│       └── UnexpectedRecordingStopHeuristicTests.swift # Unexpected-stop watchdog heuristic coverage
│
└── UI/                          # SwiftUI interface
    ├── AGENTS.md
    ├── RetraceApp.swift         # App entry point
    ├── ContentView.swift        # Root content view
    ├── CrashRecoveryHelper/     # Bundled crash-recovery XPC helper executable
    ├── CrashRecoverySupport/    # Shared crash-recovery support code for app + helper targets
    ├── LaunchAgents/            # Embedded SMAppService launch-agent plists
    ├── Components/              # Reusable UI components (MenuBarManager, HotkeyManager, etc.)
    │   ├── MasterKeyRedactionFlowCoordinator.swift # Shared missing-master-key prompt/recovery coordinator
    │   ├── HoverLatchedScrollMonitor.swift # Shared nested-scroll latch helper for hover-routed inner scroll regions
    │   └── ProcessMonitorModels.swift # System Monitor snapshot/models + ranking helpers
    ├── ViewModels/              # View models (Dashboard, Search, Timeline, Feedback, Settings)
    │   └── Settings/            # Settings-specific view models and extracted helper logic
    ├── Views/
    │   ├── Dashboard/           # App usage analytics views
    │   ├── FullscreenTimeline/  # Timeline scrubbing & playback (10 views)
    │   ├── Search/              # Search UI (SearchView, ResultRow, FrameViewer)
    │   ├── Settings/            # Settings shell, support components, and extracted section/action files
    │   │   └── Sections/        # Concern-split settings sections, verification flows, and shared actions
    │   ├── Onboarding/          # Onboarding flow
    │   └── Feedback/            # Feedback form, diagnostics presentation, and submission/export helpers
    └── Tests/
        ├── Dashboard/           # Dashboard-specific XCTestCase files
        ├── MenuBar/             # Menu bar XCTestCase files
        ├── Search/              # Search/deeplink XCTestCase files
        ├── Settings/            # Settings XCTestCase files
        ├── Support/             # Shared XCTest helpers and support-only tests
        ├── SystemMonitor/       # System monitor XCTestCase files
        └── Timeline/            # Timeline XCTestCase files

Read the full file on GitHub · 490 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. 3d ago First seen · 490 lines · 5,567 tokens per session scan C 8750a1c90aed

Subscribe to this mod's changes

retrace AGENTS.md is an instructions file published in the GitHub repository haseab/retrace (158 stars, last pushed 3mo ago), licensed MIT. It adds 5,567 tokens to every session, about $0.0278 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens