Expand description
The three things semlith setup writes for an agent beyond its MCP
registration: the Agent Skill, the steering hook, and the rule block.
Registering the server tells a client that semlith exists. None of these does anything a registration does — they are what makes an agent use it. The skill teaches; the hook catches the moment it forgets; the rule block is for clients that read prose and have no skill directory.
Every path here comes from an annotated fence in docs/clients.md, except
the cross-client skill directory below, which belongs to no client. Nothing
in this file is a path retyped into Rust.
§What this writes, and what it leaves alone
Every file semlith does not own is backed up beside itself before its first write, and every write is reversible:
- The skill is a link into a canonical copy under the store home. Removing the canonical directory removes all of them.
- The hook is one entry in a client’s
PreToolUsearray. It is found again by the command it runs, sosetup --no-hookstakes out exactly the entry semlith put there and leaves every other hook in place. - The rule block sits between two markers. A second run replaces what is between them; nothing outside them is read or written.
Enums§
- State
- Whether a thing semlith writes is there, absent, or there but out of date.
Constants§
- SKILL_
NAME - The skill’s name, which is its directory’s name everywhere it is linked.
Functions§
- canonical_
skill_ dir - The canonical copy every link points at.
- explorer_
installed - Whether the semlith-explorer agent is written and current.
- hook_
clients - Every client that documents a
PreToolUsehook, with the file it goes in. - hook_
state - Where the hook is, per client, for one mode.
- install_
explorer - Write the semlith-explorer agent for Claude Code, when Claude Code is on
this machine (its
~/.claudeexists).Nonewhen there was nothing to do. - install_
hooks - Merge the hook into every client that documents one.
- install_
rules - Write the rule block into every rules file semlith knows a path for.
- install_
skill - Write the canonical skill and link it into every documented directory.
- installed_
mode - The mode a settings file’s semlith hook runs in, if it has one.
- remove_
explorer - Take the agent out again. Only a file that is semlith’s: one naming
itself
semlith-explorerin its frontmatter. - remove_
hooks - Take semlith’s hook back out, leaving every other hook in the file.
- remove_
skill - Remove the canonical skill and every link into it.
- rules_
state - Every client whose rules file semlith knows, and every one it does not.
- set_
always_ load - Set
"alwaysLoad": trueon Claude Code’s user-scope semlith entry (4.1). - skill_
dirs - Every user-level skill directory to link into: the cross-client one, then each one a client documents.
- skill_
state - Where the skill is, per directory.