克劳德代码套件

lean-claude-code-harness

by aznikline

Use when building, auditing, or simplifying an AI coding-agent harness, especially when the current runtime has unclear config precedence, weak tool permissions, hidden product-only behavior, or poor transcriptability.

4.2kAI 与智能体未扫描2026年4月6日

安装

claude skill add --url https://github.com/openclaw/skills

文档

Lean Claude Code Harness

Distill the durable parts of Claude Code into a smaller, auditable harness. The goal is not feature parity. The goal is a runtime another engineer can understand, extend, and verify without reverse-engineering hidden behavior.

When to Use

Use this skill when a coding-agent runtime shows any of these symptoms:

  • config values are hard to trace
  • tool permissions are implicit or inconsistent
  • the tool surface keeps growing without clear ownership
  • session history disappears after a run
  • the main loop is hard to sketch from memory
  • product-only logic is mixed into the harness core

Keep These Primitives

  • layered configuration
  • permission-aware tool execution
  • a small explicit tool registry
  • markdown skill discovery
  • transcript persistence
  • a visible query loop

Remove These By Default

  • telemetry
  • remote-managed settings
  • hidden kill-switches
  • private feature flags
  • branding-specific branches
  • heavyweight UI layers

Only add them back when the user explicitly asks for them and can explain the operational need.

Quick Audit

If you need a fast harness review, answer these six questions first:

  1. Can you explain config precedence without reading three files?
  2. Are tool permissions checked before execution?
  3. Can you list the built-in tools in one screen?
  4. Are skills discovered from visible files instead of hidden registration?
  5. Does every run persist a transcript?
  6. Can you trace the query loop from prompt to final response?

If two or more answers are "no", the harness is already too opaque.

Apply This Order

1. Freeze the Runtime Boundary

Keep the entrypoint thin. It should only:

  • parse commands
  • load merged config
  • wire services
  • print results

Do not hide business logic in the CLI layer.

2. Make Config Precedence Explicit

Use a predictable merge order:

  1. defaults
  2. user config
  3. project config
  4. local config
  5. environment overrides

If a runtime value cannot be traced back to one of these sources, the harness is already drifting into opacity.

3. Gate Tools Before Execution

Define permission policy before the query loop runs tools.

Minimum pattern:

  • default and plan expose read-only tools
  • write or shell tools require a stronger mode
  • bypassPermissions should be explicit and rare

Permission checks belong before tool execution, not after damage is already possible.

4. Start with a Tiny Tool Surface

Default tool set should be boring and legible:

  • list_files
  • read_file
  • grep
  • bash

Do not add tools because the upstream product has them. Add tools only when they expand capability without making the harness harder to reason about.

5. Keep Skills File-Backed

Discover skills from SKILL.md files with frontmatter metadata. Avoid hidden registration layers, magic imports, or remote skill switches.

The discovery rule should be explainable in one sentence: scan configured directories, parse frontmatter, expose name, description, and path.

6. Persist Every Session

Save transcripts to disk. Each transcript should include:

  • session id
  • timestamp
  • prompt
  • tool steps
  • final response

If an agent run cannot be inspected afterward, debugging and trust both degrade.

7. Keep the Query Loop Visible

The harness should make this loop easy to trace:

  1. receive prompt
  2. ask provider for next action
  3. validate tool request
  4. execute tool
  5. append tool result to state
  6. repeat until final response
  7. persist transcript

If you cannot sketch the loop from memory, the runtime is already too opaque.

Anti-Patterns

  • cloning upstream complexity without upstream context
  • mixing config loading, permission logic, and tool execution in one file
  • treating remote flags as architecture instead of distribution policy
  • adding analytics before the harness can explain itself locally
  • claiming a harness is complete without transcript and permission tests

Minimal Verification

Before calling the harness usable, verify:

  • config precedence behaves as documented
  • permission modes actually filter tools
  • skill discovery finds real SKILL.md files
  • session persistence writes and reloads transcripts
  • the full query loop works with a deterministic provider

The verification standard is simple: no claims about the harness until the config, permission, skills, session, and loop seams are each exercised once.

Use This Skill To

  • design a fresh coding-agent harness
  • simplify a bloated Claude Code-style runtime
  • review an existing agent runtime for opacity and unnecessary layers
  • extract reusable harness patterns from a larger codebase

Do Not Use This Skill To

  • recreate the full Claude Code product surface
  • justify hidden behavior with “that is how the upstream does it”
  • add cloud control planes, telemetry, or feature flags without a concrete requirement

Output Standard

When applying this skill, produce:

  • the minimal harness shape
  • the layers kept vs removed
  • the exact config precedence
  • the permission model
  • the smallest verification plan that proves the harness is real

相关 Skills

Claude接口

by anthropics

Universal
热门

面向接入 Claude API、Anthropic SDK 或 Agent SDK 的开发场景,自动识别项目语言并给出对应示例与默认配置,快速搭建 LLM 应用。

想把Claude能力接进应用或智能体,用claude-api上手快、兼容Anthropic与Agent SDK,集成路径清晰又省心

AI 与智能体
未扫描121.2k

智能体流程设计

by alirezarezvani

Universal
热门

面向生产级多 Agent 编排,梳理顺序、并行、分层、事件驱动、共识五种工作流设计,覆盖 handoff、状态管理、容错重试、上下文预算与成本优化,适合搭建复杂 AI 协作系统。

帮你把多智能体流程设计、编排和自动化统一起来,复杂工作流也能更稳地落地,适合追求强控制力的团队。

AI 与智能体
未扫描12.1k

提示工程专家

by alirezarezvani

Universal
热门

覆盖Prompt优化、Few-shot设计、结构化输出、RAG评测与Agent工作流编排,适合分析token成本、评估LLM输出质量,并搭建可落地的AI智能体系统。

把提示优化、LLM评测到RAG与智能体设计串成一套方法,适合想系统提升AI开发效率的人。

AI 与智能体
未扫描12.1k

相关 MCP 服务

知识图谱记忆

编辑精选

by Anthropic

热门

Memory 是一个基于本地知识图谱的持久化记忆系统,让 AI 记住长期上下文。

帮 AI 和智能体补上“记不住”的短板,用本地知识图谱沉淀长期上下文,连续对话更聪明,数据也更可控。

AI 与智能体
84.2k

顺序思维

编辑精选

by Anthropic

热门

Sequential Thinking 是让 AI 通过动态思维链解决复杂问题的参考服务器。

这个服务器展示了如何让 Claude 像人类一样逐步推理,适合开发者学习 MCP 的思维链实现。但注意它只是个参考示例,别指望直接用在生产环境里。

AI 与智能体
84.2k

PraisonAI

编辑精选

by mervinpraison

热门

PraisonAI 是一个支持自反思和多 LLM 的低代码 AI 智能体框架。

如果你需要快速搭建一个能 24/7 运行的 AI 智能体团队来处理复杂任务(比如自动研究或代码生成),PraisonAI 的低代码设计和多平台集成(如 Telegram)让它上手极快。但作为非官方项目,它的生态成熟度可能不如 LangChain 等主流框架,适合愿意尝鲜的开发者。

AI 与智能体
7.0k

评论