PTENES
Skip to content
MODULE 3.2

💉 Injecting into the Model (and With No Data of Your Own)

The playbook only works if it ENTERS the context. Here: the hook SessionStart, turn into a skill, the CLAUDE.md, the plan B with open traces on Hugging Face for those without their own data, what transfers and what DOESN'T, and the ethics of closing the loop.

6
Topics
30
Minutes
Applied
Level
Practice
Type
playbook.md the source SessionStart hook fable-mindset skill CLAUDE.md additionalContext session start
1

🪝 SessionStart Hook

The "always on, no thinking required" approach: the script inject-playbook.sh injects the playbook as additionalContext each session. You point it to the event SessionStart of the settings.json. E é fail-open: if the playbook file doesn't exist, the session continues normally — nothing breaks.

// ~/.claude/settings.json
{
  "hooks": {
    "SessionStart": [
      {
        "matcher": "startup",
        "hooks": [
          { "type": "command",
            "command": "bash ~/projetos/fablelite/hooks/inject-playbook.sh" }
        ]
      }
    ]
  }
}

✓ What the hook does

  • ✓Reads the .md and return via additionalContext.
  • ✓Fires in the startup of each session.
  • ✓Points to another file via FABLE_PLAYBOOK=.

🔎 Fail-open in practice

If the playbook doesn’t exist, the script prints {"continue":true} and exits with code 0 — the session starts normally. Injection is a bonus, never a failure point.

2

🧩 Turn it into a skill

You don't always want the playbook in EVERY session. The skill fable-mindset loads the playbook on demand and includes the scripts (debloat, extract, compare, make_playbook). This is the channel to use when you prefer to invoke it explicitly instead of always injecting it.

›

On demand

The model consults the playbook for coding tasks—not in every conversation. You control when.

›

Included scripts

The skill includes the entire pipeline: you can remeasure and regenerate the playbook from the invocation itself.

💡 Practical tip

The skill fable-mindset lives in ~/.claude/skills/fable-mindset/. Use it when you want the playbook AND the tools at hand, without leaving it active all the time.

3

📄 CLAUDE.md — the simplest path

The minimum-effort option: paste the playbook contents (or a link to it) into the CLAUDE.md — global or project-level. It’s already auto-injected in every session, versioned with the repo, with no hook configuration. Three channels, three trade-offs — choose based on what you need:

Channel When active Choose whether…
🪝 Hook always active (every SessionStart) wants no thinking in every session
🧩 Skill on demand + the scripts wants to invoke explicitly
📄 CLAUDE.md auto-injected, versioned wants minimal effort

📊 Decision summary

  • Always active, without thinking → hook SessionStart.
  • On demand + the scripts together → skill.
  • Minimum effort → CLAUDE.md.
4

🤗 No Fable data? The open traces

What if you barely had time to talk with Fable and don't have any sessions to mine? People opened their own sessions on Hugging Face: Glint-Research/Fable-5-traces. O import_hf_traces.py downloads the dataset and runs the SAME behavioral exercise about third-party data — same reading of tools/turns, reasoning, and work order.

pip install datasets

# Glint-Research/Fable-5-traces (default):
python import_hf_traces.py
# inspeciona o schema do dataset:
python import_hf_traces.py --peek
# escreve stats.json num corpus:
python import_hf_traces.py --out corpus_fable_hf

💡 Practical tip

The importer is defensive: tries to map common formats (chat, embedded JSONL, raw transcript). If the count looks odd, open a record with --peek and adjust record_to_events(). Then, make_playbook.py --from-json becomes a playbook (side a = this data).

Dataset

Fable-5-traces (HF)

Requirement

pip install datasets

Script

import_hf_traces.py

Result

same exercise

5

🎚️ What transfers and what does NOT

The honest expectation: you imitate the PACE (think before, read before editing, close the loop), don’t clone the model. Fable’s power lies in the weights — and the playbook can’t transfer those. What it does is improve the execution of the target model; it doesn't become Fable.

✓ TRANSFERS (the rhythm)

  • ✓Think before acting on non-trivial tasks.
  • ✓Read before editing; use tools with purpose.
  • ✓Close the loop with a test/build.

✗ Does NOT transfer

  • ✗The model weights—where the power resides.
  • ✗Become Fable: the identity doesn’t change.
  • ✗The contents of the reasoning (encrypted in the logs).

🔎 The honest reading

The playbook is a process improvement, not a capability transplant. It gives the target model the good pace measured in Fable—a real gain, without the magical promise of "turning Opus into Fable".

6

⚖️ Ethics and generalization

To close the loop responsibly: run it on YOUR history; treat the corpus as sensitive — it has your code and your data. The method isn’t exclusive to the Fable/Opus pair: it applies to Opus, Codex, and open-source models. And keep the playbook up to date: iterate with new data as you accumulate sessions.

logs measured delta playbook injected into the model new logs feed back in — iterate on the playbook

⚠️ The corpus is sensitive

Your logs contain code, paths, and possibly secrets. Treat them as personal data: redact them before sharing, and don’t expose them. The gold is the rhythm, not the data—and you can publish the rhythm, but not the data.

Run on

your history

Corpus

treat as sensitive

Apply the

Opus/Codex/open-source

Keep

iterating with new data

💉 Module Summary

✓
Hook SessionStart — inject as additionalContext, fail-open.
✓
Skill fable-mindset — on demand, with the scripts together.
✓
CLAUDE.md — auto-injected, minimal effort.
✓
No data? import_hf_traces.py — Glint-Research/Fable-5-traces in HF.
✓
You imitate the RHYTHM, not clone the model — the power is in the weights.
✓
Sensitive corpus; iterate with new data — the loop closes and starts again.

End of the learning path:

From the log to the injected playbook—the method is yours. Run it on your history and iterate.