ワンクリックで
claude-code
Use the Claude Code CLI for complex refactors, multi-file changes, and sustained codebase exploration
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Use the Claude Code CLI for complex refactors, multi-file changes, and sustained codebase exploration
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
Feishu/Lark platform interaction via MCP - documents, tasks, calendar, Bitable, messaging
Use the OpenAI Codex CLI for quick fixes, targeted edits, and non-interactive automation
Use external coding tools (Claude Code, Codex, Cursor) via invoke_coding_tool and coding_tool_apply to implement, debug, and refactor code
Use the Cursor CLI agent mode for IDE-integrated coding with project rules and repo-aware edits
Learn from experience — capture insights, organize knowledge, share reusable practices as skills, and refine your role over time
Design and create AI agent packages — manifest format, directory structure, file writing workflow
| name | claude-code |
| description | Use the Claude Code CLI for complex refactors, multi-file changes, and sustained codebase exploration |
Claude Code (claude binary) is Anthropic's agentic coding CLI. Markus invokes it via invoke_coding_tool({ tool: "claude-code", ... }). Use it for complex, multi-turn coding tasks where deep reasoning and broad file exploration are needed.
npm install -g @anthropic-ai/claude-code
claude --version
Verify with markus doctor. Requires authentication via one of: ANTHROPIC_API_KEY env var, ANTHROPIC_BASE_URL for custom endpoints, or interactive claude login.
Markus runs Claude Code in non-interactive print mode with structured streaming output:
claude --print --output-format stream-json --verbose --max-turns 50 --permission-mode bypassPermissions "<prompt>"
| Flag | Purpose |
|---|---|
--print | Non-interactive mode — runs to completion without user input |
--output-format stream-json | Emits structured JSON events for progress parsing |
--verbose | Detailed progress output |
--max-turns 50 | Allows up to 50 agent turns for complex tasks |
--permission-mode bypassPermissions | Auto-approves all file edits and commands — required because --print mode has no interactive stdin for approval prompts |
Additional args can be configured per-deployment via CodingToolConfig.defaultArgs.
Each stdout line is a JSON event. Key event types:
| Event type | Meaning |
|---|---|
assistant with text content | Progress message / reasoning summary |
assistant with tool_use | File edit, shell command, or other tool invocation |
result | Final outcome with cost and token data |
The result event includes:
result — Final summary textinput_tokens, output_tokens — Token usagecache_read_tokens, cache_write_tokens — Prompt cache statscost_usd — Estimated cost in USDMarkus parses these into progress events (file_edit, progress, completed) and extracts cost reports automatically.
When you pass task_id to invoke_coding_tool, Markus writes a CLAUDE.md file in the repository root before invoking Claude Code. This file contains:
Claude Code reads CLAUDE.md automatically as project context. Do not delete or overwrite it during a session — it is regenerated each invocation.
If the repo already has a permanent CLAUDE.md, Markus overwrites it for the session. Consider restoring project-level content after the task if needed.
invoke_coding_tool({
tool: "claude-code",
prompt: "Refactor the auth module to use dependency injection. Move AuthService to src/services/, update all imports, keep existing test behavior. Run the test suite when done.",
workdir: "/path/to/repo",
task_id: "task-123"
})
invoke_coding_tool({
tool: "claude-code",
prompt: "Tests in packages/core/test/auth.test.ts are failing with 'token expired'. Find the root cause in src/auth/ and fix without changing the public API. Show which tests pass after the fix.",
workdir: "/path/to/repo",
task_id: "task-123"
})
For unfamiliar codebases, ask Claude Code to explore first:
"Read the codebase structure under src/coding-tools/. Then implement the feature described in the task context. Start by listing the files you plan to modify."
Claude Code supports up to 50 turns, but long tasks can still stall or partially complete.
Re-invoke with explicit remaining scope:
"Previous session modified src/foo.ts and src/bar.ts but did not update tests. Complete the test coverage for the changes in src/foo.ts. Do not re-modify files that are already correct."
git status in workdir for partial changescoding_tool_apply or discard with git checkout -- .Add constraints to the prompt:
"Modify ONLY files under src/handlers/. Do not touch tests, config, or unrelated packages."
Switch to codex for a targeted fix, or edit directly with file_edit.
Claude Code supports per-invocation model and effort overrides:
invoke_coding_tool({
tool: "claude-code",
prompt: "...",
model: "sonnet", // default: tool's own default (usually sonnet)
effort: "medium", // low | medium | high | xhigh | max
})
| Model | Best for | Cost note |
|---|---|---|
haiku | Simple subagent tasks, quick checks | Cheapest option |
sonnet | Most coding work — default choice | Good balance of cost and capability |
opus | Complex architecture, multi-file refactors, unfamiliar codebases | ~15x more expensive per token than Sonnet |
fable | Creative or documentation tasks | Specialized |
Strategy: Start with sonnet (or the user's defaultModel). Only use opus when:
Warning: Opus is approximately 15x more expensive than Sonnet per token. A task that costs $0.30 with Sonnet could cost $4.50 with Opus. Voluntarily call request_user_approval before using Opus for any task expected to run more than a few turns.
low — Simple edits, typo fixes, config changesmedium — Standard development tasks (default)high — Complex reasoning, multi-step problem solvingIf the user has set maxBudgetPerSessionUsd, Markus passes it as --max-budget-usd to Claude Code. This is a hard limit enforced by Claude Code — the session terminates if the budget is reached. Claude Code is the only tool with this enforced budget mechanism.
When working under a budget cap:
sonnet over opus to stay within budgetcost.estimatedCostUsd in results to gauge remaining budget capacityClaude Code is the most capable but potentially most expensive coding tool. It provides the best cost visibility — every result includes token counts and USD estimates:
{
"cost": {
"estimatedCostUsd": 0.45,
"inputTokens": 85000,
"outputTokens": 12000,
"cacheReadTokens": 40000,
"source": "tool_output"
}
}
Cost-saving practices:
codex for trivial fixes instead of Claude Codecost.estimatedCostUsd before chaining multiple invocationseffort: "low" for simple edits, effort: "high" only for complex reasoningsonnet — only escalate to opus when justifiedReport unusually high costs (> $1 per invocation) in a task note for visibility.
task_id so CLAUDE.md carries full task contextfile_edit events to track what's changingresult.testResult before calling coding_tool_applycost.estimatedCostUsd after each invocation and factor it into your next decisionFor complex tasks, chain Claude Code invocations:
invoke_coding_tool({ tool: "claude-code", mode: "plan", prompt: "Analyze and plan..." })invoke_coding_tool({ tool: "claude-code", prompt: "Implement the plan..." })result.testResult. If failures exist, re-invoke with: "Fix these test failures: "coding_tool_apply({ session_id, commit_message })Never apply changes from a session where tests failed.
cost.estimatedCostUsd after each invocation and note it in task progress.sonnet and only escalate to opus when neededopus for long taskscodex or direct edit insteadopus by default — its cost can surprise users