How the i-have-adhd Skill Persists Across Conversation Turns
The i-have-adhd skill persists across conversation turns by declaring disable-model-invocation: true in its front-matter, ensuring the agent harness re-injects the skill definition on every request while relying on conversation history for state restatement.
The i-have-adhd skill is a static response-style skill defined in SKILL.md that helps agents maintain focus across complex, multi-step tasks. Unlike dynamic tools that store state externally, this skill achieves persistence through a combination of front-matter declarations and harness-level conversation management. According to the ayghri/i-have-adhd source code, the implementation leverages specific architectural patterns to ensure continuity without external databases or session storage.
Skill Activation and Persistence Mechanism
The skill is activated through a slash command and remains locked for the entire session unless explicitly disabled by the user.
Invoking the Skill
Users activate the mode by issuing the /i-have-adhd command in the chat interface. Once triggered, the skill enters an active state that persists across all subsequent turns until the user explicitly states "stop adhd mode".
Front-Matter Protection
The SKILL.md file contains a critical front-matter declaration: disable-model-invocation: true. This flag prevents the language model from disabling the skill autonomously, ensuring the harness maintains the skill's active status for the entire conversation duration. The Persistence rule in the skill definition explicitly states that only the user's "stop adhd mode" command can terminate the session.
Per-Turn Skill Injection Architecture
Persistence relies on the harness re-injecting the complete skill definition with every API request, ensuring the model always operates within the specified behavioral constraints.
The _condition_prompt Implementation
In scripts/run_evals.py, the helper function _condition_prompt (lines 171-182) handles the injection logic. When the --condition-skill argument points to the i-have-adhd skill file, the function reads the skill text and wraps every task with the response-style instructions:
def _condition_prompt(task: str, condition: str, skill_path: Path | None) -> str:
if condition == "baseline":
return task
if skill_path is None:
raise ValueError(f"--condition-skill is required for the {condition} condition")
instructions = skill_path.read_text(encoding="utf-8")
return (
"Follow the response-style skill below while completing the task. "
"Do not discuss or quote the skill.\n\n"
f"<response_style>\n{instructions}\n</response_style>\n\n"
f"<task>\n{task}\n</task>"
)
XML Wrapping Structure
Each conversation turn receives the skill content wrapped in <response_style> tags, followed by the user's actual task in <task> tags. This ensures the model processes the ADHD-specific formatting rules—such as step enumeration and concise summaries—before generating a response.
State Management Without External Storage
The skill achieves state persistence without databases or external caches by combining harness-level conversation history with explicit state restatement rules.
Rule 5: Restate State Every Turn
The fifth rule in skills/i-have-adhd/SKILL.md mandates that the model restate the current progress at the beginning of each response. For example, the model must output structured updates like "Step 3 of 5 done: schema updated. Next: backfill the column." This self-referential approach allows the state to persist within the conversation transcript itself.
Harness Conversation Transcript
The agent harness (whether Claude Code, Codex, Antigravity, or Gemini) maintains the complete conversation history. When the model receives a new request, it has access to all previous turns, including its own state restatements. This enables the model to continue complex workflows without external session storage, as demonstrated in this multi-turn exchange:
User: /i-have-adhd
Assistant: (skill becomes active)
User: We are on step 3 of 5 in a database migration. The schema change is done; the next task is backfilling the new column. Give the next update.
Assistant: Step 3 of 5 done: schema updated. Next: backfill the new column. Run `npm run backfill` now.
Disabling the Skill
Persistence terminates only when the harness detects the specific deactivation phrase. When the user inputs "stop adhd mode", the harness removes the skill from subsequent requests, returning the model to its default response style. This explicit termination prevents accidental deactivation while giving users complete control over session duration.
Summary
- Front-matter protection: The
disable-model-invocation: trueflag inSKILL.mdprevents the LLM from disabling the skill mid-conversation. - Per-turn injection: The
_condition_promptfunction inscripts/run_evals.pywraps every request with the skill definition using--condition-skill. - State restatement: Rule 5 requires the model to echo progress in each response, eliminating the need for external storage.
- Harness dependency: The agent harness maintains conversation history and handles the "stop adhd mode" termination command.
Frequently Asked Questions
What prevents the i-have-adhd skill from being disabled mid-conversation?
The disable-model-invocation: true declaration in the skill's front-matter blocks the language model from turning off the skill autonomously. Only an explicit user command ("stop adhd mode") processed by the harness can deactivate the skill, ensuring continuous application across all conversation turns.
How does the skill maintain state without a database?
State persistence relies on Rule 5 (Restate state every turn), which requires the model to repeat the current progress and next steps in every response. Since the harness provides the full conversation history with each API call, the model references its previous state restatements to maintain continuity without external storage mechanisms.
What role does the agent harness play in skill persistence?
The harness serves two critical functions: it maintains the complete conversation transcript (supplying historical context to the model), and it manages the skill lifecycle by injecting the SKILL.md content via the _condition_prompt logic on every request. The harness also monitors for the "stop adhd mode" termination phrase.
Where is the skill injection logic implemented?
The injection logic resides in scripts/run_evals.py within the _condition_prompt function (lines 171-182). This function reads the skill file specified by --condition-skill and prefixes every task with the skill instructions wrapped in <response_style> XML tags, ensuring the model receives the behavioral constraints on every turn.
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 →