Skip to main content

setup-agent-config

Token-efficient AI agent hooks -- env vars, test flag optimization, output truncation, NODE_OPTIONS. Use when optimizing Claude Code for fewer tokens or reducing context waste.

来源信息

仓库
redpanda-data/ui-harness
最近来源活动
2026年5月8日 11:21
检测到的 SKILL.md 语言
英语
星标
34
分支
4

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
5 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
setup-agent-config
description
Token-efficient AI agent hooks -- env vars, test flag optimization, output truncation, NODE_OPTIONS. Use when optimizing Claude Code for fewer tokens or reducing context waste.
# Setup LLM Optimization ## What This Sets Up - **SessionStart**: `AI_AGENT=1`, `CLAUDECODE=1`, `NODE_OPTIONS=--max-old-space-size=8192` - **UserPromptSubmit**: inject project state (git branch, dirty files, scripts, violations, config) -> Claude know state, no tool calls - **PreToolUse (Bash)**: optimize vitest commands -- strip `--verbose`, suggest `--pool=forks`, `--bail=1`, `--teardownTimeout=5000`. Also handle jest/bun test (back-compat) - **PostToolUse (Bash)**: truncate verbose output, cut context bloat ## Steps 1. Copy `scripts/llm-env.sh`, `scripts/llm-test-flags.sh`, `scripts/llm-truncate.sh` -> `.claude/hooks/`. `chmod +x`. 2. Configure in `.claude/settings.json`: - SessionStart: `llm-env.sh` - PreToolUse (Bash): `llm-test-flags.sh` - PostToolUse (Bash): `llm-truncate.sh` ## Verify - [ ] `AI_AGENT`/`CLAUDECODE` set after session start - [ ] `vitest --verbose` rewrite to `vitest` - [ ] Long output truncated See [REFERENCE.md](REFERENCE.md) for vitest config optimizations.
在 GitHub 查看