You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
askcc action prompts in askcc/definitions.py (and their user-overridable templates under ~/.askcc/templates/) are plain prompt strings. They lack the structural controls that Claude Code's native subagent format provides — no per-action tool allowlist, no model selection, no effort/thinking overrides, no permission mode, no maxTurns.
This means every action runs with the same tool surface, same model, and same effort level regardless of what it actually needs. That is suboptimal on three axes:
Security / blast radius — issue-review, validate, explore, and diagnose are analysis-only, yet they currently inherit full Edit/Write/Bash(*) capability from the invoking claude subprocess. A misbehaving run could mutate the tree.
Cost — read-only analysis actions (issue-review, explore, diagnose) do not need Opus-tier reasoning; develop and plan do. Today there is no way to declare this per-action.
Focus / prompt quality — Claude Code's official subagent best-practice is a tight frontmatter contract (narrow description, explicit tools, explicit model). askcc's prompts declare none of this at the definition layer.
askcc/definitions.py — AgentConfig captures action_name, description, system_prompt, user_prompt_template, template filenames, and required_variables. No tool/model/effort/permission fields.
~/.askcc/templates/*_SYSTEM_PROMPT.md — plain markdown, no frontmatter parsed.
askcc/cli.py — --effort, --max-thinking-tokens, --disable-thinking are global CLI flags applied uniformly to every action (cli.py:108-136).
askcc/runners/ — runners receive effort/thinking as a single value, no per-action override path.
Proposal
Adopt a Claude Code subagent-style frontmatter on each *_SYSTEM_PROMPT.md template file. load_agent_config parses it; the runner translates declared fields into claude CLI flags when spawning the subprocess.
Frontmatter schema (per-action, all optional except description)
---
name: developdescription: Implements a planned GitHub issue end-to-end; opens a PR linked to the issue.tools: Read, Write, Edit, Bash, Grep, Glob, WebFetchmodel: opus # or sonnet | haiku | inheriteffort: max # low | medium | high | xhigh | maxmax_thinking_tokens: 32000permission_mode: acceptEdits # default | acceptEdits | plan | bypassPermissionsmax_turns: 200
---
You are an expert software developer operating inside Claude Code...
Proposed per-action defaults
Action
tools (allowlist)
model
effort
permission_mode
Rationale
prepare
Read, Grep, Glob, Bash(gh:*)
sonnet
medium
default
Analysis + gh comment/edit; no file mutation
plan
Read, Grep, Glob, Bash(gh:*)
opus
high
default
Heavy reasoning, no file mutation
develop
Read, Write, Edit, Bash, Grep, Glob
opus
max
acceptEdits
Full implementation authority
issue-review
Read, Grep, Glob, Bash(gh:*)
sonnet
medium
default
Read-only + gh comment
pr-review
Read, Grep, Glob, Bash(gh:,git:)
opus
high
default
Reads branch, posts review — no repo mutation
explore
Read, Grep, Glob, Bash(gh:*)
sonnet
high
default
Investigation only
diagnose
Read, Grep, Glob, Bash(gh:,git:)
sonnet
high
default
Root-cause analysis, no fixes
fix-ci
Read, Write, Edit, Bash, Grep, Glob
sonnet
high
acceptEdits
Narrow-scope code changes
Values are defaults — existing global CLI flags (--effort, --max-thinking-tokens, etc.) and env vars continue to work and take precedence when explicitly set, preserving backwards compatibility.
Cost-appropriate model per action — heavy reasoning actions (plan, develop, pr-review) on Opus; analysis actions on Sonnet.
Alignment with Claude Code conventions — users who read https://code.claude.com/docs/en/subagents.md will recognize the format. Templates become portable — a user can drop an askcc template into .claude/agents/ with minimal changes.
Structural validation at load time — a typo in model: opuz fails fast at load_agent_config, not mid-run.
Discoverability — askcc --help and README can surface per-action defaults; users know what each action will and won't do.
load_agent_config parses YAML frontmatter from *_SYSTEM_PROMPT.md template files when present; falls back to the existing plain-prompt behaviour when no frontmatter is found (backwards compatible)
Built-in *_AGENT_PROMPT constants in askcc/definitions.py are updated to emit frontmatter-bearing defaults matching the table above
Runner(s) translate declared frontmatter fields into claude CLI flags (--model, --allowedTools, --disallowedTools, --permission-mode, --max-turns, effort/thinking)
CLI flags and env vars (--effort, --model, ASKCC_CLAUDE_EFFORT_LEVEL, etc.) continue to override per-action frontmatter when explicitly set
Invalid frontmatter values raise a clear error at load time with the field name and allowed values
Existing user templates without frontmatter continue to work unchanged (back-compat)
bootstrap_templates writes new defaults with frontmatter on first run; existing ~/.askcc/templates/ files are not overwritten
README documents the frontmatter schema, per-action defaults table, and override precedence
Related: Add contextual SOP/skill loading #64 (contextual SOP/skill loading) — complementary; skills could be declared alongside the frontmatter via a skills: list
Does not migrate askcc to invoke .claude/agents/-resolved subagents; it only borrows the frontmatter convention for askcc's own template files
Does not remove the global CLI flags — they remain as per-run overrides
Notes / Open Questions
Tool syntax: Claude Code allows Bash(gh:*) style scoping. Decide whether askcc's defaults use coarse Bash or scoped forms — the table above proposes scoped where practical.
Frontmatter parser: prefer a stdlib-only approach (yaml is not stdlib). Options: tomllib + TOML frontmatter, or add pyyaml as a dep. Recommend pyyaml to match the Claude Code ecosystem convention.
Problem Statement
askccaction prompts inaskcc/definitions.py(and their user-overridable templates under~/.askcc/templates/) are plain prompt strings. They lack the structural controls that Claude Code's native subagent format provides — no per-action tool allowlist, no model selection, no effort/thinking overrides, no permission mode, no maxTurns.This means every action runs with the same tool surface, same model, and same effort level regardless of what it actually needs. That is suboptimal on three axes:
issue-review,validate,explore, anddiagnoseare analysis-only, yet they currently inherit fullEdit/Write/Bash(*)capability from the invokingclaudesubprocess. A misbehaving run could mutate the tree.issue-review,explore,diagnose) do not need Opus-tier reasoning;developandplando. Today there is no way to declare this per-action.Reference: https://code.claude.com/docs/en/subagents.md
Current State
askcc/definitions.py—AgentConfigcapturesaction_name,description,system_prompt,user_prompt_template, template filenames, andrequired_variables. No tool/model/effort/permission fields.~/.askcc/templates/*_SYSTEM_PROMPT.md— plain markdown, no frontmatter parsed.askcc/cli.py—--effort,--max-thinking-tokens,--disable-thinkingare global CLI flags applied uniformly to every action (cli.py:108-136).askcc/runners/— runners receive effort/thinking as a single value, no per-action override path.Proposal
Adopt a Claude Code subagent-style frontmatter on each
*_SYSTEM_PROMPT.mdtemplate file.load_agent_configparses it; the runner translates declared fields intoclaudeCLI flags when spawning the subprocess.Frontmatter schema (per-action, all optional except
description)Proposed per-action defaults
prepareplandevelopissue-reviewpr-reviewexplorediagnosefix-ciValues are defaults — existing global CLI flags (
--effort,--max-thinking-tokens, etc.) and env vars continue to work and take precedence when explicitly set, preserving backwards compatibility.Benefits
issue-reviewcannot accidentallyEditfiles;validate/diagnosestay read-only.plan,develop,pr-review) on Opus; analysis actions on Sonnet..claude/agents/with minimal changes.model: opuzfails fast atload_agent_config, not mid-run.askcc --helpand README can surface per-action defaults; users know what each action will and won't do.Acceptance Criteria
AgentConfiggains optional fields:tools,disallowed_tools,model,effort,max_thinking_tokens,permission_mode,max_turnsload_agent_configparses YAML frontmatter from*_SYSTEM_PROMPT.mdtemplate files when present; falls back to the existing plain-prompt behaviour when no frontmatter is found (backwards compatible)*_AGENT_PROMPTconstants inaskcc/definitions.pyare updated to emit frontmatter-bearing defaults matching the table aboveclaudeCLI flags (--model,--allowedTools,--disallowedTools,--permission-mode,--max-turns, effort/thinking)--effort,--model,ASKCC_CLAUDE_EFFORT_LEVEL, etc.) continue to override per-action frontmatter when explicitly setbootstrap_templateswrites new defaults with frontmatter on first run; existing~/.askcc/templates/files are not overwrittenDependencies
skills:listNon-Goals
.claude/agents/-resolved subagents; it only borrows the frontmatter convention for askcc's own template filesNotes / Open Questions
Bash(gh:*)style scoping. Decide whether askcc's defaults use coarseBashor scoped forms — the table above proposes scoped where practical.yamlis not stdlib). Options:tomllib+ TOML frontmatter, or addpyyamlas a dep. Recommendpyyamlto match the Claude Code ecosystem convention.