Formatting Matter-of-Fact Error Messages with i-have-adhd

The i-have-adhd extension enforces concise, direct error messages by injecting a strict rule set into Pi Coding Agent sessions, automatically stripping fluff like "Hope this helps!" from all model outputs.

The i-have-adhd skill is a Pi Coding Agent extension designed to eliminate conversational padding and enforce disciplined communication patterns. When activated, it loads behavioral rules from skills/i-have-adhd/SKILL.md and injects them into every model response, ensuring that error messages and explanations remain strictly matter-of-fact.

How the i-have-adhd Extension Works

The extension operates as a persistent session modifier that synchronizes context rules with the model's state. Located in extensions/i-have-adhd.ts, the system manages rule injection through custom message types and maintains state across session rebuilds.

Architecture and Rule Injection

On session start, the extension calls syncContext to restore saved states or apply default flags. When enabled, it dispatches a custom message of type i-have-adhd-rules containing the full rule header and list to the model. Disabling the mode sends an i-have-adhd-disabled message that removes the constraint set.

The UI provides immediate visual feedback: the status bar displays ADHD ON in green when the mode is active and remains blank when disabled.

The Matter-of-Fact Error Rule

Rule 9 in skills/i-have-adhd/SKILL.md explicitly mandates "Matter-of-fact errors." This constraint requires the model to produce error text that is concise, direct, and free of empathetic filler or extraneous commentary. Instead of apologetic or verbose error explanations, the model outputs stripped-down, actionable diagnostics.

Enabling and Disabling ADHD Mode

Users can activate the extension through multiple interfaces depending on workflow requirements.

Session Commands and Launch Flags

Toggle the mode interactively using the slash command:

// Toggle current state
await pi.sendCommand('i-have-adhd');

// Explicitly enable
await pi.sendCommand('i-have-adhd on');

// Explicitly disable
await pi.sendCommand('i-have-adhd off');

For persistent activation across restarts, create a sentinel file in the agent directory:

touch $(pi get-agent-dir)/.i-have-adhd-always

Alternatively, launch Pi with the adhd flag to enable the mode immediately on startup.

Stop Phrases for Immediate Deactivation

The extension monitors conversation content for specific disable triggers. Saying "stop adhd mode" or "normal mode" automatically intercepts the message and disables the rule set, causing the model to revert to its default conversational style without requiring a slash command.

Controlling Error Message Formatting Programmatically

Developers can inspect the injected rule set to verify that matter-of-fact error constraints are active, particularly useful when debugging unexpected model tone shifts.

Inspecting Active Rules

Access the current rule configuration through the session manager's context entries:

// Retrieve injected ADHD rules from session context
const adhdRules = ctx.sessionManager.buildContextEntries()
  .filter(e => e.customType === 'i-have-adhd-rules')
  .map(e => e.content);

console.log(adhdRules);

This returns the raw rule text from skills/i-have-adhd/SKILL.md, including the matter-of-fact error directive that suppresses verbose error formatting.

Summary

  • The i-have-adhd extension enforces strict communication rules by injecting constraints from skills/i-have-adhd/SKILL.md into Pi Coding Agent sessions.
  • Rule 9 specifically mandates matter-of-fact error messages, eliminating fluff and empathetic padding from diagnostic outputs.
  • Activation occurs via the /i-have-adhd command, the adhd launch flag, or the .i-have-adhd-always sentinel file.
  • Deactivation happens through explicit commands, stop phrases ("stop adhd mode"), or the i-have-adhd-disabled custom message type.
  • The system architecture uses syncContext for state management and custom message types (i-have-adhd-rules, i-have-adhd-disabled) to toggle constraints.

Frequently Asked Questions

How does i-have-adhd change error message formatting?

The extension injects Rule 9 from skills/i-have-adhd/SKILL.md, which requires all error messages to be concise and direct. When active, the model omits apologetic language, empathetic filler, and closing pleasantries like "Hope this helps!" from error outputs.

Can I disable matter-of-fact mode without using a command?

Yes. Typing "stop adhd mode" or "normal mode" in the chat automatically triggers the deactivation logic. The extension intercepts these stop phrases and sends an i-have-adhd-disabled message to remove the rule constraints immediately.

Where are the formatting rules defined?

The behavioral constraints reside in skills/i-have-adhd/SKILL.md within the repository. The extension loads this file at runtime and injects its contents as a custom message of type i-have-adhd-rules whenever the mode is enabled via extensions/i-have-adhd.ts.

Will the mode persist across Pi Coding Agent restarts?

Only if you create the .i-have-adhd-always file in the agent directory or launch with the adhd flag. Without these persistent indicators, the extension relies on syncContext to restore session state, which may reset to default if the session tree is fully rebuilt.

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 →