How the i-have-adhd Skill Maintains Context and State Across Multi-Turn Conversations

The i-have-adhd skill maintains context across multi-turn conversations by marking itself as permanently active in the front-matter, re-injecting its full definition on every request, and instructing the model to restate the current state each turn without relying on external storage.

The i-have-adhd skill in the ayghri/i-have-adhd repository demonstrates a stateless approach to maintaining context and state across multi-turn conversations through strategic prompt engineering and harness-level persistence. Rather than storing data in external databases or memory stores, this static skill definition leverages the agent harness's conversation history and specific activation rules to ensure continuity. Understanding how this skill achieves persistence reveals key patterns for building robust, stateless AI agent behaviors that maintain coherence across extended interactions.

How Context Persistence Works in i-have-adhd

Permanent Activation via Front-Matter

The skill achieves persistent activation through a critical front-matter directive in skills/i-have-adhd/SKILL.md. The file contains disable-model-invocation: true, which prevents the language model from turning the skill off autonomously. Once invoked with the slash command /i-have-adhd, the harness keeps the skill active for the entire session until the user explicitly issues the command "stop adhd mode". This rule, labeled Persistence in the skill definition, ensures that the behavioral modifications remain constant across all turns without requiring the user to reactivate them.

Per-Turn Skill Injection

The harness re-injects the complete skill definition on every request, ensuring the model always operates with the full context. In scripts/run_evals.py, the helper function _condition_prompt (lines 171-182) implements this injection by reading the skill file and wrapping the user task with the skill instructions. This function prefixes every prompt with the complete skill text, guaranteeing that rules like state restatement are available to the model on each turn. The injection uses XML-style tags to separate the response style from the task:

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>"
    )

State Restatement Without External Storage

Rule 5 of the skill, titled "Restate state every turn", instructs the model to explicitly repeat the current progress at the beginning of each response. Because the model receives the identical skill text on every request through the conditioning pipeline, it can obey this directive by echoing information from the conversation history provided by the harness. For example, the model generates responses like "Step 3 of 5 done: schema updated. Next: backfill the column." This self-referential restatement creates the illusion of persistent state without any external storage mechanism.

Multi-Turn Conversation Flow

The following exchange demonstrates how the skill maintains continuity across turns without external state management:

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.

In this interaction, the assistant repeats the step number and completed work, satisfying Rule 5's requirement for state restatement. The harness stores the conversation transcript, and the model retrieves the previous state from this history on the subsequent turn.

Key Files and Components

  • skills/i-have-adhd/SKILL.md: Contains the complete skill definition, including the disable-model-invocation directive and the state restatement rules that enable context persistence.

  • scripts/run_evals.py: Implements the conditioning pipeline through the _condition_prompt function, which injects the skill definition into every turn when invoked with the --condition-skill argument.

  • hooks/always-on.sh: Example hook script that automatically loads the skill for every session, demonstrating how harnesses can enforce persistent activation.

  • Plugin manifests (.claude-plugin/plugin.json, .codex-plugin/plugin.json, etc.): Declare the skill folder for various agent harnesses including Claude Code, Codex, Antigravity, and Gemini.

Summary

  • The skill uses disable-model-invocation: true in its front-matter to prevent the model from deactivating it, ensuring permanent activation throughout the session.

  • The _condition_prompt function in scripts/run_evals.py re-injects the complete skill definition on every request using XML-style tags to wrap the task.

  • Rule 5 requires the model to restate the current state each turn, creating continuity by echoing information from the harness's conversation history.

  • The harness maintains the full conversation transcript, allowing the skill to remain stateless while the model references prior turns to reconstruct context.

  • Users deactivate the skill by saying "stop adhd mode", which signals the harness to disable the skill and return to default model behavior.

Frequently Asked Questions

Does the i-have-adhd skill store data in external memory?

No, the skill itself does not store any data in external databases, memory stores, or session caches. All persistence is achieved through the harness's conversation history and the model's obligation to restate state each turn according to Rule 5 in SKILL.md. The skill is a static definition that relies entirely on re-injection and history replay.

How do I disable the skill once activated?

You can disable the skill by explicitly stating "stop adhd mode" in your message. According to the Persistence rule in the skill definition, the harness detects this specific phrase and disables the skill for the remainder of the session, returning the model to its default response style. The disable-model-invocation setting prevents the model from turning it off any other way.

Which agent harnesses support this persistence model?

The skill works with any agent harness that supports the Agent-Skills spec, including Claude Code, Codex, Antigravity, and Gemini. Each harness implements the skill loading through plugin manifests (such as .claude-plugin/plugin.json or .codex-plugin/plugin.json), and all maintain the conversation transcript necessary for the state restatement strategy to function.

Why does the model need to restate state every turn?

The restatement requirement compensates for the skill's stateless nature. Because the skill definition contains no variables or memory slots, the model must explicitly echo the current progress in its output to ensure the next turn has accessible context. This pattern, enforced by Rule 5, allows the model to pick up where it left off by reading its own previous summary from the harness-provided conversation history.

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:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →