
Autonomous
- 593 installs
- 1 repo stars
- Updated May 26, 2026
- camacho/ai-skills
autonomous is a Claude Code agent skill that switches a session between full autonomous execution and stricter copilot-style checkpoints using persisted session-state modes for developers who need controlled agent autono
About
autonomous is a Claude Code skill that wraps Bash helpers around camacho/ai-skills session-state utilities so developers can flip between autonomous execution and copilot-strict checkpoints without restarting a session. The skill sources scripts/lib/session-state.sh and exposes atomic_write, get_mode, set_mode, is_copilot, and is_copilot_strict helpers through mode.sh wrappers. Developers reach for autonomous when an agent should run multi-step shell and filesystem work end-to-end, then tighten checkpoints before risky edits or production changes. The persisted mode survives within the session directory and can expire when stale, keeping autonomy settings predictable across long Claude Code runs.
- Bash wrappers around shared `session-state` helpers for atomic writes and mode reads
- Explicit `autonomous` vs `copilot` setter with usage validation and exit codes
- Blocks copilot mode when `CLAUDE_CODE_REMOTE` is set
- Session-directory resolution with graceful handling when autonomous mode has no active session dir
- Exports `is_copilot`, `is_copilot_strict`, and `expire_if_stale` for hooks and aliases
Autonomous by the numbers
- 593 all-time installs (skills.sh)
- Ranked #1,598 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Security screen: MEDIUM risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/camacho/ai-skills --skill autonomousAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 593 |
|---|---|
| repo stars | ★ 1 |
| Security audit | 2 / 3 scanners passed |
| Last updated | May 26, 2026 |
| Repository | camacho/ai-skills ↗ |
How do you toggle Claude Code autonomous execution modes?
Switch a Claude Code session between full autonomous execution and stricter copilot-style checkpoints using persisted session-state modes.
Who is it for?
Developers running long Claude Code sessions who need a fast switch between hands-off autonomous runs and checkpoint-gated copilot control.
Skip if: Developers who only use Cursor or Codex without Claude Code session-state scripts should skip autonomous because it depends on camacho/ai-skills session-state helpers.
When should I use this skill?
Trigger when the user asks to enable autonomous agent execution, enforce copilot-strict checkpoints, or persist Claude Code session mode settings.
What you get
Persisted session-state mode files, copilot-strict flags, and reusable Bash mode.sh wrapper commands.
- mode.sh wrapper commands
- persisted session mode state
By the numbers
- Exposes 6 session-state wrapper functions including get_mode, set_mode, and is_copilot_strict
Files
Return to Autonomous Mode
Claude Code enforcement only — Codex and Cursor default to autonomous unless a future adapter uses this shared controller.
Shared mode controller: .agents/skills/autonomous/scripts/.Shared Controller
Mode is a setting with explicit values: autonomous and copilot.
For now, this skill owns the shared mode controller because autonomous is the default and safe fallback value. /copilot is an alias that sets mode=copilot; it should not own separate mode logic.
.agents/skills/autonomous/scripts/mode.shis the sourceable mode facade for all agents and hooks..agents/skills/autonomous/scripts/set-mode.shsetsmode=autonomousormode=copilot.scripts/lib/session-state.shremains project infrastructure because status, detection, bootstrap, and hook code all use it.
Activate
REPO_ROOT="$(git rev-parse --show-toplevel)"
"$REPO_ROOT/.agents/skills/autonomous/scripts/set-mode.sh" autonomousIf the script does not exist, tell the user: "This project doesn't have mode switching scripts. You are already in autonomous mode by default."
Confirmation
After activation, print:
Mode: autonomous
Worktree enforcement active. Full workflow pipeline.Behavior
Follow autonomous mode rules in .claude/rules/operating-mode.md. Agents and hooks that need live mode state should source the shared helper or call scripts/session-state get mode; do not read raw mode-state files directly.
#!/usr/bin/env bash
# mode.sh — Skill-owned wrappers around session-state mode helpers.
_mode_script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
_mode_repo_root="$(cd "$_mode_script_dir/../../../.." && pwd -P)"
# shellcheck source=../../../../scripts/lib/session-state.sh
source "$_mode_repo_root/scripts/lib/session-state.sh"
atomic_write() { session_state_atomic_write "$@"; }
_resolve_session_dir() { session_state_resolve_session_dir "$@"; }
expire_if_stale() { session_state_expire_mode_if_stale "$@"; }
get_mode() { session_state_get_mode "$@"; }
set_mode() { session_state_set_mode "$@"; }
is_copilot_strict() { session_state_is_copilot_strict "$@"; }
is_copilot() { [ "$(get_mode)" = "copilot" ]; }
#!/usr/bin/env bash
# set-mode.sh — Shared mode setter for autonomous/copilot aliases and hooks.
set -euo pipefail
requested_mode="${1:-}"
if [ "$#" -ne 1 ] || { [ "$requested_mode" != "autonomous" ] && [ "$requested_mode" != "copilot" ]; }; then
echo "Usage: $0 <autonomous|copilot>" >&2
exit 2
fi
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
# shellcheck source=mode.sh
. "$script_dir/mode.sh"
if [ "$requested_mode" = "copilot" ] && [ -n "${CLAUDE_CODE_REMOTE:-}" ]; then
echo "Cannot enter copilot mode in a remote session." >&2
exit 1
fi
session_dir=$(_resolve_session_dir 2>/dev/null || true)
if [ -z "$session_dir" ] || [ ! -d "$session_dir" ]; then
if [ "$requested_mode" = "autonomous" ]; then
echo "Session dir not found; autonomous mode is assumed by default." >&2
else
echo "Session dir not found — bootstrap may not have run. Restart Claude Code." >&2
exit 1
fi
else
now=$(date +%s)
if [ "$requested_mode" = "copilot" ]; then
set_mode copilot "$((now + 14400))" "$((now + 43200))"
else
set_mode autonomous
fi
fi
# Audit log — .claude/.state/ is gitignored; ensure it exists before append
# so fresh checkouts (e.g., CI) don't fail the redirect under set -e.
repo_root="$(cd "$script_dir/../../../.." && pwd -P)"
main_worktree="$(git -C "$repo_root" worktree list --porcelain 2>/dev/null | head -1 | sed 's/^worktree //')"
if [ -n "$main_worktree" ]; then
mkdir -p "$main_worktree/.claude/.state" 2>/dev/null || true
if [ "$requested_mode" = "copilot" ]; then
echo "$(date -u +%Y-%m-%dT%H:%M:%SZ) copilot activated [pid: $PPID]" >> "$main_worktree/.claude/.state/mode-log" 2>/dev/null || true
else
echo "$(date -u +%Y-%m-%dT%H:%M:%SZ) autonomous restored [pid: $PPID]" >> "$main_worktree/.claude/.state/mode-log" 2>/dev/null || true
fi
fi
echo "$requested_mode"
Related skills
How it compares
Pick autonomous over generic agent prompts when you need persisted, script-backed toggles between autonomous and checkpoint-gated Claude Code execution.
FAQ
What does the autonomous skill control in Claude Code?
The autonomous skill controls whether a Claude Code session runs in full autonomous execution or copilot-strict checkpoint mode by reading and writing persisted session-state through Bash wrappers around session-state.sh helpers.
How does autonomous persist execution mode?
autonomous resolves the Claude Code session directory, writes mode with atomic_write, and can expire stale modes via expire_if_stale so autonomous and copilot-strict settings stay consistent across long sessions.
Is Autonomous safe to install?
skills.sh reports 2 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.