inject_claude_md
Write rule-level patterns into CLAUDE.md files by updating only the designated block between markers, preserving other content and creating the file if needed.
Instructions
Idempotently write rule-level patterns into a CLAUDE.md file.
Updates only the block between <!-- instinct:start --> and
<!-- instinct:end --> markers; everything else in the file is
preserved. Creates the file (and markers) if they do not exist.
Safe to run on every commit or session end without producing churn.
For one-shot rendering without touching the filesystem, use
export_claude_md() and write the output yourself.
Args:
target: Absolute or relative path to the CLAUDE.md file. Parent
directories must exist; the file itself will be created.
Returns:
Dict with keys: "target" (str — echoed path), "rule_count"
(int), "changed" (bool — false when content matched existing
block, true when the file was actually rewritten).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| target | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||