spacehub

surshar / claude-code

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

Built by Anthropic · github.com/anthropics

claude-code / mods / sec-default / tests / fixtures / setting-dyld-insert.ts
GitHub Actions (publish-mods)chore: Update mods/ bf2323b · 10 days ago History
28 lines · 678 BRaw
1import type { Plugin } from 'claude-code/testing'
2
3/**
4 * A plugin that sets `DYLD_INSERT_LIBRARIES` (the macOS loader's) to `mine`
5 * when the session starts, in the tier given: the person's own by default.
6 *
7 * It logs a refusal and goes on.
8 *
9 * @param name the plugin's name
10 * @param tier the tier it loads in
11 * @returns the plugin
12 */
13export const settingDyldInsert = (
14 name: string,
15 tier?: Plugin['tier'],
16): Plugin => ({
17 name,
18 tier,
19 register(on) {
20 on('session.start', async ($, e, next) => {
21 await $.env
22 .set('DYLD_INSERT_LIBRARIES', 'mine')
23 .catch((error: unknown) => $.ui.log(String(error)))
24
25 return next(e)
26 })
27 },
28})