How to Make i-have-adhd Always On in Claude Codex: Enable SessionStart Hook
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. This script integrates with Claude Codex through the hook registration file hooks/hooks.json.
When Claude initializes a new session, the following occurs:
- Hook invocation –
hooks/hooks.jsonregistersalways-on.shas a SessionStart hook - Flag detection – The script checks for
.i-have-adhd-alwaysin your Claude config directory (~/.claudeby default) - Rule injection – If the flag exists, the hook strips YAML front-matter from
skills/i-have-adhd/SKILL.mdand outputs the ruleset with an activation banner - 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:
# 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:
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 script demonstrates clean shell patterns for conditional rule injection. Here's the core logic adapted from the source:
#!/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 contains metadata headers.
Key Source Files in i-have-adhd
| File | Purpose |
|---|---|
hooks/always-on.sh |
SessionStart hook performing conditional rule injection |
hooks/hooks.json |
Hook registration manifest for Claude Codex integration |
skills/i-have-adhd/SKILL.md |
Source ruleset containing ADHD-mode instructions |
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-alwaysto enable always-on mode permanently - Remove the flag file to disable across all future sessions
- Type
stop adhd modeto pause injection for the current session only - The
hooks/always-on.shscript 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 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 is missing, the script exits silently without injecting rules, keeping your Claude sessions stable.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →