# How to Make i-have-adhd Always On in Claude Codex: Enable SessionStart Hook

> Make i-have-adhd always on in Claude Codex by creating the session start hook file. Enjoy ADHD mode rules in every response automatically. Learn how now.

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

---

**Create the flag file `~/.claude/.i-have-adhd-always` to automatically inject ADHD-mode rules into every Claude Codex response without typing commands each time.**

The `i-have-adhd` repository provides an opt-in **always-on mode** that prepends the full ADHD ruleset to every Claude interaction. This hands-free approach uses a SessionStart hook that checks for a flag file before injecting rules, giving you complete control over when the behavior activates.

---

## How the Always-On Hook Works

The always-on functionality relies on a **modular hook system** built into the repository under [`hooks/always-on.sh`](https://github.com/ayghri/i-have-adhd/blob/main/hooks/always-on.sh). This script integrates with Claude Codex through the hook registration file [`hooks/hooks.json`](https://github.com/ayghri/i-have-adhd/blob/main/hooks/hooks.json).

When Claude initializes a new session, the following occurs:

1. **Hook invocation** – [`hooks/hooks.json`](https://github.com/ayghri/i-have-adhd/blob/main/hooks/hooks.json) registers [`always-on.sh`](https://github.com/ayghri/i-have-adhd/blob/main/always-on.sh) as a SessionStart hook
2. **Flag detection** – The script checks for `.i-have-adhd-always` in your Claude config directory (`~/.claude` by default)
3. **Rule injection** – If the flag exists, the hook strips YAML front-matter 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 ruleset with an activation banner
4. **Silent exit** – If no flag exists, the hook exits immediately without affecting your session

---

## Enabling Always-On Mode

To activate the persistent behavior, create the flag file once:

```bash

# Create the flag file in the default Claude config directory

mkdir -p "$HOME/.claude"
touch "$HOME/.claude/.i-have-adhd-always"

```

This single file enables automatic rule injection for **all future Claude Codex sessions** on this machine.

---

## Disabling Always-On Mode

You have two options for turning off the behavior depending on your needs.

### Permanent Disable

Remove the flag file to stop automatic injection across all sessions:

```bash
rm -f "$HOME/.claude/.i-have-adhd-always"

```

### Temporary Disable (Current Session Only)

Send this command in any active Claude session:

```

stop adhd mode

```

The hook respects this instruction and ceases rule injection for the remainder of that session without deleting your flag file.

---

## Internal Hook Implementation

The [`hooks/always-on.sh`](https://github.com/ayghri/i-have-adhd/blob/main/hooks/always-on.sh) script demonstrates clean shell patterns for conditional rule injection. Here's the core logic adapted from the source:

```sh
#!/usr/bin/env sh
claude_dir="${CLAUDE_CONFIG_DIR:-$HOME/.claude}"
flag_path="$claude_dir/.i-have-adhd-always"

# Only run if flag exists

[ -f "$flag_path" ] || exit 0

script_dir=$(dirname -- "$0")
skill_path="$script_dir/../skills/i-have-adhd/SKILL.md"

[ -f "$skill_path" ] || exit 0

# Strip YAML front-matter and output the ruleset

body=$(awk '
  NR == 1 && $0 ~ /^---[[:space:]]*$/ { in_fm = 1; next }
  in_fm && $0 ~ /^---[[:space:]]*$/   { in_fm = 0; next }
  !in_fm                              { print }
' "$skill_path")

printf 'ADHD MODE ACTIVE (always-on). …\n\n%s\n' "$body"

```

The **AWK front-matter stripper** ensures clean rule output even if [`SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/SKILL.md) contains metadata headers.

---

## Key Source Files in i-have-adhd

| File | Purpose |
|------|---------|
| [`hooks/always-on.sh`](https://github.com/ayghri/i-have-adhd/blob/main/hooks/always-on.sh) | SessionStart hook performing conditional rule injection |
| [`hooks/hooks.json`](https://github.com/ayghri/i-have-adhd/blob/main/hooks/hooks.json) | Hook registration manifest for Claude Codex integration |
| [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) | Source ruleset containing ADHD-mode instructions |
| [`README.md`](https://github.com/ayghri/i-have-adhd/blob/main/README.md) | Repository documentation and usage patterns |

All paths are relative to the repository root at `github.com/ayghri/i-have-adhd`.

---

## Summary

- **Create** `~/.claude/.i-have-adhd-always` to enable always-on mode permanently
- **Remove** the flag file to disable across all future sessions
- **Type** `stop adhd mode` to pause injection for the current session only
- The [`hooks/always-on.sh`](https://github.com/ayghri/i-have-adhd/blob/main/hooks/always-on.sh) script implements opt-in behavior through explicit flag-file checking, preserving user control

---

## Frequently Asked Questions

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

The hook checks `${CLAUDE_CONFIG_DIR:-$HOME/.claude}/.i-have-adhd-always`. You can override the default location by setting the `CLAUDE_CONFIG_DIR` environment variable before launching Claude Codex.

### Does always-on mode affect Claude's API rate limits or token usage?

The always-on mode prepends ruleset text to every response context, which marginally increases token consumption per interaction. The impact depends on [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) file size—typically under 1,000 tokens.

### Can I use i-have-adhd without the always-on feature?

Yes. The repository functions normally without the flag file. You can manually invoke ADHD-mode behaviors through standard Claude prompts when needed, or enable always-on temporarily by creating the flag file and removing it later.

### What happens if I delete the SKILL.md file after enabling always-on?

The hook includes defensive checks: `[ -f "$skill_path" ] || exit 0`. If [`skills/i-have-adhd/SKILL.md`](https://github.com/ayghri/i-have-adhd/blob/main/skills/i-have-adhd/SKILL.md) is missing, the script exits silently without injecting rules, keeping your Claude sessions stable.