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