Configuration

One file, every knob.

Everything behaviornudge decides is set in behaviornudge.toml: where your activity comes from, what counts as drift, how activity is labeled, which models predict, and when each nudge fires and how it sounds. Copy behaviornudge.example.toml to get started. Below is that file, section by section, with its real defaults.

top level

Basics

Your timezone (used for quiet hours, daily budgets and the weekly evaluation) and where local data lives. API keys never go in this file: they stay in your environment or a git-ignored .env.

timezone = "America/New_York"
data_dir = "data"

[sources]

Where activity comes from

Paths to the local databases behaviornudge reads, always read-only. Both Retraces are optional; use either or both. retrace_repo and retrace_api are for the launchd agent that keeps Retrace running. sunsama_timer = "mcp" reads your running Sunsama timer through Sunsama's official MCP server. More on the capture sources →

[sources]
retrace_jhammant_db = "~/.retrace/retrace.db"
retrace_to_db = "~/Library/Application Support/Retrace/retrace.db"
retrace_calendar_helper = "~/.retrace/bin/retrace-calendar"
# jhammant Retrace checkout and API, for `behaviornudge retrace agent` (launchd supervision)
retrace_repo = "~/Documents/code/retrace"
retrace_api = "http://127.0.0.1:8765"
context_log = "data/context-log.jsonl"
sunsama_timer = "mcp"     # live timer via https://api.sunsama.com/mcp; run `behaviornudge sunsama-timer --login` once

[sessions]

How records become sessions

Records of the same activity less than 30 s apart merge into one session. Anything shorter than 3 s is treated as passing through, not as doing something.

[sessions]
merge_gap_s = 30        # same-key records closer than this merge into one session
transition_max_s = 3    # shorter activity is a transition, not a session

[intent]

What you were supposed to be doing

Intent comes from your Sunsama timer, then a Sunsama timebox, then a calendar event, then your most recent creative work. Timers you forget to stop are capped at 45 min. Only the calendars you list here are read.

[intent]
recent_creative_window_min = 30
timer_cap_min = 45                       # forgotten-timer cap
calendar_allowlist = ["Your Name (your-calendar)"]   # exact calendar names as Apple Calendar shows them

[drift]

What counts as drift

A drift episode starts with a purposeful visit to one of these sites. It counts as drift when at least 3 min of off-task scrolling follow within 15 min, before you get back to work for at least 60 s. These settings drive the backtest.

[drift]
prone_sites = ["linkedin.com", "x.com", "instagram.com"]
window_min = 15
threshold_min = 3
return_min_s = 60        # a return to work must last this long; shorter glances are ignored
nudge_budget_per_day = 5

[labeling]

Creative, reactive or consuming

Rules label most activity. TypeSafe Jev labels the unclear rest, pinned to one model version so backtests are repeatable. Answers with a probability of at least 0.9 are accepted; ones below 0.5 go to your review queue. channel_only = true means task titles are never sent, only their channel.

[labeling]
classifier_model = "jev-1.14.0"          # pinned; never an alias for a backtest
accept_probability = 0.9                 # probability of the chosen mode (not `confidence`)
review_probability = 0.5
fits_min = 0.3
channel_only = false                     # true = never send task titles, only channels

[labeling.modes]

Define the modes in your own words

These definitions are what Jev reads when it decides. Change them, and the labels follow.

[labeling.modes]
creative = "Writing, building, or making something: coding, drafting, designing, composing."
reactive = "Replying, communicating, or looking something up for a specific reason: messages, email, a profile lookup."
consuming = "Scrolling feeds and browsing for novelty or shiny objects, without a specific goal."

[projects]

Repos to Sunsama channels

Maps a code repository's name to the Sunsama channel it belongs to, so work in a repo matches the task you planned.

[projects]
# repository name -> Sunsama channel (unmapped repos resolve to their repo name)
"my-repo" = "My Project"

[predictors]

Which models predict drift

Every predictor implements one interface, so you can switch them on and off here. BehaviorGPT gets your last 50 sessions and returns its top 20 likely next activities.

[predictors]
enabled = ["baseline", "behaviorgpt"]
behaviorgpt_market = "us"
behaviorgpt_top_k = 20
behaviorgpt_history_sessions = 50
behaviorgpt_order_min = 10

[nudge]

When nudges fire

Every timing, the daily budget, cooldowns, snooze length and quiet hours. too_soon_factor is how much longer a nudge waits after you click Too soon (up to 4×). call_allowlist lists the apps whose microphone use counts as being in a call. The messaging_* settings catch inbox-browsing: hopping through 4 or more conversations, or lingering 5 minutes, in Slack, Discord, WhatsApp, Signal, Messages or Telegram during a task. Set messaging_apps = [] to turn it off.

[nudge]
enabled = true
daily_budget = 8
cooldown_min = 15                 # per nudge type and site
snooze_min = 30
quiet_hours = []                  # e.g. [["21:30", "07:00"]] in local time
arrival_delay_s = 20
feed_arrival_delay_s = 45         # landing straight on a LinkedIn/X/Instagram feed during a task
purpose_done_delay_s = 30
off_task_threshold_min = 8
in_call_delay_s = 30
agent_delay_min = 2
too_soon_factor = 1.5
too_soon_cap = 4.0
call_end_grace_s = 45
calls_silence_others = true       # during calls only the silent in-call nudge fires; false = others too (silently)
live_jev = true                   # background Jev labels for unknown live activities
# messaging drift: hopping through conversations or lingering in messaging apps during a task
messaging_apps = ["slack", "discord", "whatsapp", "signal", "messages", "telegram",
                  "app.slack.com", "discord.com", "web.whatsapp.com", "web.telegram.org"]
messaging_dwell_min = 5           # lingering: one messaging stretch this long
messaging_hop_conversations = 4   # hopping: this many different conversations in one stretch...
messaging_hop_min_s = 60          # ...after at least this long
call_allowlist = ["us.zoom.xos", "com.microsoft.teams", "com.tinyspeck.slackmacgap", "com.apple.FaceTime",
                  "com.apple.avconferenced", "net.whatsapp.WhatsApp", "com.webex", "com.cisco.webexmeetings",
                  "com.hnc.Discord", "com.google.Chrome", "company.thebrowser.Browser", "com.brave.Browser",
                  "com.apple.Safari", "com.apple.WebKit", "com.microsoft.edgemac"]

[nudge.sounds]

A sound for each nudge

Any macOS system sound name, the path to a sound file, or "none". The in-call nudge is silent so nobody on the call hears it; the messaging nudge uses a gentle Purr.

[nudge.sounds]                    # macOS system sound name, a sound file path, or "none"
arrival = "Tink"
purpose_done = "Glass"
off_task = "Sosumi"
agent_working = "Pop"
in_call = "none"                  # silent so call participants don't hear it
messaging = "Purr"                # gentle

Example: a two-minute demo

To show nudges live on stage, shrink the waits from minutes to seconds and lift the daily budget. Change these lines, restart behaviornudge nudge run, and change them back afterwards.

[nudge]
daily_budget = 50
cooldown_min = 1
arrival_delay_s = 8
feed_arrival_delay_s = 10
purpose_done_delay_s = 8
off_task_threshold_min = 0.5
in_call_delay_s = 10
agent_delay_min = 0.5
calls_silence_others = false
settingdefaultdemo
daily_budget850
cooldown_min151
arrival_delay_s208
feed_arrival_delay_s4510
purpose_done_delay_s308
off_task_threshold_min80.5
in_call_delay_s3010
agent_delay_min20.5
calls_silence_otherstruefalse