# How to Enable Always-On Mode for i-have-adhd in Claude Code Using the SessionStart Hook

> Enable always on mode for i-have-adhd in Claude Code. Learn how to use the SessionStart hook to automatically inject ADHD friendly rulesets for every session.

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

---

**Create a file named `.i-have-adhd-always` in your Claude configuration directory (`~/.claude` or `$CLAUDE_CONFIG_DIR`) to automatically inject the ADHD-friendly ruleset at the beginning of every Claude Code session.**

The `ayghri/i-have-adhd` repository provides a Claude Code plugin that delivers ADHD-friendly response formatting through a custom SessionStart hook. When enabled, this always-on mode automatically loads the ruleset from [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) without requiring manual activation for each conversation.

## How the SessionStart Hook Works

The always-on functionality relies on two core components that work together at session initialization.

### Hook Registration in hooks.json

According to the `ayghri/i-have-adhd` source code, the repository defines the entry point in [`hooks/hooks.json`](https://github.com/ayghri/i-have-adhd/blob/main/hooks/hooks.json), which registers a `SessionStart` hook that executes a Node command. This command runs the `hooks/always-on.mjs` script every time Claude Code initializes a new session.

### Opt-In Logic in always-on.mjs

The `hooks/always-on.mjs` script implements a safety-first opt-in mechanism. It checks for the existence of a flag file named `.i-have-adhd-always` inside the Claude configuration directory (resolved via `$CLAUDE_CONFIG_DIR` or defaulting to `~/.claude`). When present, the script reads the contents of [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md), strips the YAML front-matter, and writes the formatted rules to stdout, which Claude Code renders as the active system prompt.

## Enabling Always-On Mode

To activate the always-on behavior, you must create the opt-in flag file in your Claude configuration directory.

For Unix and macOS systems:

```bash
export CLAUDE_CONFIG_DIR="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
mkdir -p "$CLAUDE_CONFIG_DIR"
touch "$CLAUDE_CONFIG_DIR/.i-have-adhd-always"

```

For Windows PowerShell:

```powershell
$claudeDir = $env:CLAUDE_CONFIG_DIR ?? (Join-Path $HOME ".claude")
New-Item -Path "$claudeDir\.i-have-adhd-always" -ItemType File -Force

```

After creating the file, restart Claude Code or start a new session to trigger the SessionStart hook. The hook will automatically inject the ADHD-friendly ruleset from [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) into your conversation context.

## Disabling the Mode

You can disable always-on mode using one of two methods. Delete the flag file to prevent future sessions from loading the ruleset automatically:

```bash

# Unix/macOS

rm "$CLAUDE_CONFIG_DIR/.i-have-adhd-always"

# Windows PowerShell

Remove-Item "$claudeDir\.i-have-adhd-always"

```

Alternatively, type **"stop adhd mode"** during any active session to disable the ruleset for that specific conversation without removing the flag file.

## Summary

- The [`hooks/hooks.json`](https://github.com/ayghri/i-have-adhd/blob/main/hooks/hooks.json) file registers the SessionStart hook that triggers at every Claude Code initialization.
- The `hooks/always-on.mjs` script checks for the `.i-have-adhd-always` flag file in your Claude config directory before injecting rules.
- Creating this flag file opts you in to automatically loading the rules from [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) at the start of every session.
- Remove the flag file or use the "stop adhd mode" command to disable the functionality.

## Frequently Asked Questions

### Where does the i-have-adhd plugin look for the always-on flag file?

The plugin checks the Claude configuration directory, which defaults to `~/.claude` on Unix systems or `%USERPROFILE%\.claude` on Windows. You can override this location by setting the `CLAUDE_CONFIG_DIR` environment variable before running Claude Code.

### What happens if I create the flag file while Claude Code is already running?

The SessionStart hook only executes when a new session begins. You must restart Claude Code or start a new session for the always-on mode to take effect after creating the `.i-have-adhd-always` file.

### Does enabling always-on mode modify my existing Claude Code configuration?

No. The hook operates as a read-only injection mechanism. It reads from [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) and outputs the rules to stdout without altering any configuration files in your Claude directory, except for reading the presence of the opt-in flag file you created.

### Can I temporarily disable the rules without deleting the flag file?

Yes. Typing **"stop adhd mode"** during an active session disables the ADHD-friendly formatting for that specific conversation. However, the next new session will automatically reinject the rules unless you delete the `.i-have-adhd-always` flag file.