Skip to main content

Module instructions

Module instructions 

Source
Expand description

Agent instruction file management (upsert, skill install, hooks). Agent instruction file management for seshat init.

Writes and maintains Seshat usage instructions in AI agent config files (AGENTS.md, CLAUDE.md), installs the Seshat skill file, and registers Claude Code hooks — all idempotently using HTML comment markers.

Enums§

HooksResult
Outcome of install_hooks_claude_code.
SkillResult
Outcome of install_skill.
UpsertResult
Outcome of an upsert_instructions call.

Constants§

AGENTS_MD_CONTENT
Compact instructions for AGENTS.md / CLAUDE.md. Contains idempotency markers <!-- seshat:start --> / <!-- seshat:end -->.
HOOK_PRE_TOOL
Soft PreToolUse hook — one nudge per session before Grep/Glob/Read (exit 0).
HOOK_SESSION_START
Soft SessionStart hook — prints a reminder at session start (exit 0).
SKILL_MD_CONTENT
Full reference skill for on-demand loading by Claude Code / OpenCode.

Functions§

claude_home
Resolve the Claude home directory (~/.claude).
install_hooks_claude_code
Install Seshat hooks for Claude Code and register them in settings.json.
install_skill
Install the Seshat skill file into an agent’s skills directory.
opencode_config_dir
Resolve the OpenCode global config directory.
upsert_instructions
Write or update the Seshat instruction section in an agent instruction file.
write_backup_for_settings
Write a timestamped backup of settings.json for hook installation.