How to Configure Intent Extraction Threshold and Slack_Days in no-mistakes

Set intent.threshold (float between 0 and 1) and intent.slack_days (non-negative integer) in either ~/.no-mistakes/config.yaml for global defaults or .no-mistakes.yaml in your repository root for project-specific overrides.

The no-mistakes CLI extracts the user’s intent from native agent transcripts by analyzing file overlap between changes and historical records. Fine-tuning the intent extraction threshold and slack_days parameters allows you to control matching strictness and the temporal search window. These settings are defined in the Intent configuration block and consumed by the intent extraction engine according to the logic in kunchenguid/no-mistakes.

Understanding the Intent Configuration Parameters

Two primary knobs control how aggressively no-mistakes matches agent transcripts to changes:

threshold (float64, range 0–1, default 0.2) : The minimum raw file-overlap score a candidate transcript must achieve before qualifying as a match. Raising this value tightens matching criteria and reduces false positives, while lowering it permits more permissive matching.

slack_days (int, ≥ 0, default 3) : Extends the discovery window backwards from the base commit when filtering transcripts. A value of 3 includes transcripts up to three days older than the base commit. Increasing this value widens the search window; setting it to 0 disables the slack entirely.

Configuration File Locations

You can define these settings at two scopes, with repository-specific files overriding global values.

Global Configuration

Create or edit ~/.no-mistakes/config.yaml to apply defaults across all repositories:


# ~/.no-mistakes/config.yaml

intent:
  enabled: true
  threshold: 0.4
  slack_days: 5

Repository-Specific Overrides

Add a .no-mistakes.yaml file at the repository root to override global settings for that project only:


# .no-mistakes.yaml

intent:
  threshold: 0.1
  slack_days: 2

Implementation in the Source Code

According to the no-mistakes source code, the configuration logic resides in internal/config/config.go, where the Intent struct defines the YAML schema and default values:

// From internal/config/config.go
type Intent struct {
    Enabled    bool    `yaml:"enabled"`
    Threshold  float64 `yaml:"threshold"`
    SlackDays  int     `yaml:"slack_days"`
}

The default values are embedded in the defaultConfigYAML constant within the same file, setting threshold to 0.2 and slack_days to 3.

The internal/intent/intent.go file consumes these values during extraction. It constructs the time window using SlackDays and passes the Threshold to the matcher:

// Conceptual usage from internal/intent/intent.go
params := ExtractParams{
    Threshold:  config.Intent.Threshold,
    SlackDays:  config.Intent.SlackDays,
    // ... other parameters
}

Validation and Testing

Unit tests in internal/config/config_intent_test.go verify that YAML unmarshalling correctly overrides the embedded defaults. When testing programmatically, you can assert that custom values propagate through the configuration:

func TestIntentConfiguration(t *testing.T) {
    cfg := &config.Config{
        Intent: config.Intent{
            Enabled:   true,
            Threshold: 0.35,
            SlackDays: 4,
        },
    }
    // Verify cfg.Intent.Threshold equals 0.35
    // Verify cfg.Intent.SlackDays equals 4
}

Summary

  • Threshold (0.0–1.0) controls the minimum file-overlap score required for transcript matching; default is 0.2.
  • Slack_Days (integer ≥ 0) defines how many days before the base commit to search for transcripts; default is 3.
  • Define these in ~/.no-mistakes/config.yaml for global settings or .no-mistakes.yaml for repository-specific overrides.
  • The underlying implementation resides in internal/config/config.go (struct definitions) and internal/intent/intent.go (runtime application).
  • Changes take effect immediately on the next CLI execution.

Frequently Asked Questions

What is the default threshold value in no-mistakes?

The default threshold is 0.2, defined in the defaultConfigYAML constant within internal/config/config.go. This value represents a 20% minimum file-overlap score required before a transcript is considered a potential match.

How does slack_days affect transcript matching?

The slack_days setting extends the search window backwards from your base commit. For example, a value of 3 means the matcher considers transcripts created up to three days prior to the commit date, widening the pool of potential intent matches.

Can I disable the slack period entirely?

Yes. Set slack_days: 0 in your configuration file. This restricts the matcher to transcripts created on or after the base commit date, eliminating any backward-looking temporal buffer.

Where are the Intent configuration structs defined?

The Intent struct and its default values are defined in internal/config/config.go (lines 58–66 in the current source). This file handles YAML unmarshalling and provides the embedded defaults that populate the configuration when specific values are not provided.

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 →