# How to Enable the AlwaysOn Flag Globally for the i-have-adhd Skill

> Learn how to enable the alwaysOn flag globally for the i-have-adhd skill. This feature automatically adds ADHD-friendly rules to every response without manual commands.

- Repository: [Ayoub Ghriss/i-have-adhd](https://github.com/ayghri/i-have-adhd)
- Tags: how-to-guide
- Published: 2026-08-20

---

**The alwaysOn flag is an opt-in mechanism that automatically prepends the full ADHD-friendly ruleset to every model response without requiring manual activation commands.**

The **i-have-adhd** repository provides a simple file-based toggle that makes ADHD accommodations persistent across all sessions. When enabled, the skill injects its structured communication guidelines into the system prompt on every request—eliminating the need to type `/i-have-adhd` or `stop adhd mode` repeatedly.

## What the AlwaysOn Flag Does

The alwaysOn flag serves one purpose: **automatic ruleset injection**.

When the flag file exists, runtime-specific hooks detect it during session initialization. These hooks—found in [`hooks/always-on.sh`](https://github.com/ayghri/i-have-adhd/blob/main/hooks/always-on.sh) and `hooks/always-on.mjs`—read [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md), strip any YAML front-matter, and prepend the cleaned rules to the system prompt. The user sees a confirmation banner:

```

ADHD MODE ACTIVE (always-on). The ruleset below applies to every response.

```

This behavior persists until the flag file is removed. Each major AI coding runtime (Claude Code, OpenCode, Pi) checks its own designated path, so configuration is isolated per tool.

## How to Enable AlwaysOn for Each Runtime

The flag is simply an **empty file** at a runtime-specific location. Create it once with `touch`, and the behavior applies to all future sessions.

### Claude Code

Claude Code uses the POSIX shell hook at [`hooks/always-on.sh`](https://github.com/ayghri/i-have-adhd/blob/main/hooks/always-on.sh), registered via [`hooks/hooks.json`](https://github.com/ayghri/i-have-adhd/blob/main/hooks/hooks.json).

```bash
touch ~/.claude/.i-have-adhd-always

```

To disable:

```bash
rm ~/.claude/.i-have-adhd-always

```

### OpenCode

OpenCode loads the plugin from `.opencode/plugins/i-have-adhd.mjs`, which checks the flag path before registering commands.

```bash
touch ~/.config/opencode/.i-have-adhd-always

```

To disable:

```bash
rm ~/.config/opencode/.i-have-adhd-always

```

### Pi and OMP (Oh My Pi)

Pi and its OMP variant use the TypeScript extension in [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts). This extension reads the flag from the agent directory.

```bash
touch ~/.pi/agent/.i-have-adhd-always

```

If you use a custom agent directory:

```bash
touch $PI_CODING_AGENT_DIR/.i-have-adhd-always

```

To disable:

```bash
rm ~/.pi/agent/.i-have-adhd-always

```

### Other Agents (Cursor, Gemini, Codex)

For agents without dedicated hook support, copy the ruleset directly into the agent's persistent rules file. The [`INSTALL.md`](https://github.com/ayghri/i-have-adhd/blob/main/INSTALL.md) file in the repository contains the exact markdown snippet to paste into locations like `~/.cursor/rules/AGENTS.md`.

## Key Implementation Files

| File | Purpose |
|------|---------|
| [`hooks/always-on.sh`](https://github.com/ayghri/i-have-adhd/blob/main/hooks/always-on.sh) | POSIX shell hook for Claude Code; prints the activation banner and outputs stripped [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) content |
| `hooks/always-on.mjs` | Node.js equivalent used in some Claude Code configurations |
| [`extensions/i-have-adhd.ts`](https://github.com/ayghri/i-have-adhd/blob/main/extensions/i-have-adhd.ts) | Pi/OMP extension that checks `.i-have-adhd-always` and manages command registration |
| `.opencode/plugins/i-have-adhd.mjs` | OpenCode plugin implementing the `/i-have-adhd` command and alwaysOn detection |
| [`hooks/hooks.json`](https://github.com/ayghri/i-have-adhd/blob/main/hooks/hooks.json) | Declares which script Claude Code executes for the `SessionStart` hook |
| [`INSTALL.md`](https://github.com/ayghri/i-have-adhd/blob/main/INSTALL.md) | Documents alwaysOn setup with copy-paste snippets for unsupported agents |

## Temporarily Overriding AlwaysOn

Even with the flag enabled, you can disable ADHD mode for a single session using the standard deactivation commands: `stop adhd mode` or `normal mode`. This creates a per-session override without deleting the global flag file.

## Summary

- **AlwaysOn purpose**: Automatically injects the ADHD-friendly ruleset into every system prompt via runtime-specific hooks
- **Enable method**: Create an empty flag file with `touch` at the runtime's designated path
- **Disable method**: `rm` the flag file to stop global injection, or use `stop adhd mode` for temporary session-level override
- **File locations**: `~/.claude/.i-have-adhd-always`, `~/.config/opencode/.i-have-adhd-always`, `~/.pi/agent/.i-have-adhd-always`

## Frequently Asked Questions

### What happens if I create multiple flag files across different runtimes?

Each runtime checks only its own path. Having flags for Claude Code, OpenCode, and Pi simultaneously will enable alwaysOn behavior independently in each tool. They do not conflict or interfere with one another.

### Does the alwaysOn flag affect existing sessions?

No. The flag is evaluated during session initialization by the `SessionStart` hook (Claude Code) or extension activation (OpenCode/Pi). You must start a new session or reload the agent for the change to take effect.

### Can I customize which rules are injected when alwaysOn is active?

The hooks read the full [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) file after stripping YAML front-matter. To customize, edit [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) directly—the same content is used for both manual `/i-have-adhd` activation and alwaysOn mode. There is no separate ruleset for alwaysOn behavior.

### Why does the flag need to be an empty file rather than a configuration setting?

The empty file approach requires no parser, no schema validation, and no dependency on the runtime's configuration system. It works across shell scripts, Node.js plugins, and TypeScript extensions with identical logic: `if [ -f "$FLAG_PATH" ]` or `fs.existsSync(flagPath)`. This maximizes portability across the diverse runtime environments supported by the i-have-adhd repository.