Skip to content
OpenSmartRoute
Skillv1.0.0

interactive-claude-to-file-based-fallback

Switch from tmux/interactive Claude Code to file-based claude -p execution when interactive runs fail with upstream errors or analysis-only stalls, then verify landing from git/GitHub state.

by vamseeachanta(0) 0 installs
Free
Sign in to install

Free account. Installing gives you the manifest plus copy-paste snippets.

See reviews

About

Imported from vamseeachanta/workspace-hub (.claude/skills/workspace-hub/interactive-claude-to-file-based-fallback/SKILL.md). Install upstream with npx skills add vamseeachanta/workspace-hub --skill interactive-claude-to-file-based-fallback. Copyright stays with the author (MIT).

Interactive Claude to File-Based Fallback

When to use

Use this when:

  • the user prefers tmux + interactive Claude Code first
  • you are executing a plan-approved GitHub issue in workspace-hub or a similar repo
  • interactive Claude repeatedly fails to make write-phase progress
  • the repo or parent checkout may already be dirty, so you need worktree-safe verification after the run

Why this exists

A recurring failure mode is that interactive Claude works well for planning and approval-safe prep, but can fail during implementation in two different ways:

  • immediate upstream errors such as API Error: 500 / Internal server error
  • long context-gathering sessions that never transition into file writes, even after narrower retry prompts

In those cases, continuing to retry interactive mode wastes time. The productive move is to switch to file-based claude -p execution with a self-contained prompt, then verify success from actual git/GitHub state.

Default decision ladder

  1. Honor the user's preferred interactive tmux flow first.
  2. If the run fails immediately, retry once with a narrower scope or alternate model if appropriate.
  3. If the run stalls in analysis mode or fails again, switch to file-based execution.
  4. Verify landed state using commit/issue/remote checks instead of trusting runner narration.

Stall indicators that justify switching

Treat these as evidence that interactive mode is not productive for the current issue:

  • prompt accepted, context loaded, but no file writes after extended monitoring
  • repeated retries with tests-only or single-file prompts still do not create files
  • multiple runs show the same pattern of long analysis with no commit activity
  • the issue is implementation-ready, but only planning/read-only artifacts get produced reliably

File-based execution pattern

Create a self-contained prompt file with:

  • issue number
  • approved plan path
  • review artifact paths
  • owned paths
  • forbidden paths
  • exact validation commands
  • closeout instructions

Run non-interactively:

cd /mnt/local-analysis/workspace-hub
PROMPT=$(< docs/reports/<issue>-execution-prompt.md)
claude -p --permission-mode acceptEdits --no-session-persistence --output-format text "$PROMPT" </dev/null | tee /tmp/<issue>-run.log

For approval-safe planning/read-only work:

claude -p --permission-mode plan --no-session-persistence --output-format text "$PROMPT" </dev/null | tee /tmp/<issue>-plan.log

Verification checklist after file-based execution

Always verify all three surfaces:

  1. GitHub issue state
  • gh issue view <issue> --json state,comments,labels
  1. Commit reality
  • git show --stat --name-only <commit>
  • ensure the claimed owned files are actually in the commit
  1. Remote vs parent-checkout state
  • git fetch origin
  • confirm whether the commit landed on origin/main
  • separately inspect the user's parent checkout with:
    • git status --short
    • git rev-list --left-right --count HEAD...origin/main

Important rule:

  • remote landed state and parent-checkout sync state are different truths
  • if the remote landed but the parent checkout is dirty and behind, report that explicitly and do not claim the local repo is fully synced

Worktree recommendation

If the parent checkout is dirty:

  • execute from a clean issue worktree when possible
  • do not auto-sync or pull the dirty parent checkout unless the user asks for reconciliation
  • if needed, inspect/validate the landed commit from the clean worktree or a fresh detached worktree based on origin/main

Reusable example outcome

Observed successful pattern:

  • user preferred interactive tmux + claude --dangerously-skip-permissions
  • interactive runs repeatedly stalled or failed with upstream errors during implementation
  • switched to file-based execution for the same approved issue
  • verified the landed implementation through targeted tests, scheduler validation, generated sample artifacts, and GitHub issue closure
  • reported separately that origin/main had the landed commit while the local parent checkout remained dirty/behind

Pitfalls

  • burning multiple extra interactive retries after the same no-write stall pattern is clear
  • assuming an issue is incomplete just because the parent checkout is behind; first verify remote landing
  • claiming the local repo is synced when only the side worktree or remote branch is updated
  • trusting the runner summary without checking the actual commit and issue state

Use it

Copy one of these into your project. Installing also returns the manifest and these snippets.

yaml
targets:
  - https://api.opensmartroute.ai/api/v1/registry/vamseeachanta-workspace-hub-interactive-claude-to-file-b-f654b9/manifest   # or paste the manifest below

Manifest

An Open Capability Manifest: the router reads it to know what this does, what it costs and when to pick it.

vamseeachanta-workspace-hub-interactive-claude-to-file-b-f654b9.ocm.jsonjson
{
  "ocm": "1",
  "id": "vamseeachanta-workspace-hub-interactive-claude-to-file-b-f654b9",
  "kind": "skill",
  "name": "interactive-claude-to-file-based-fallback",
  "description": "Switch from tmux/interactive Claude Code to file-based claude -p execution when interactive runs fail with upstream errors or analysis-only stalls, then verify landing from git/GitHub state.",
  "publisher": "vamseeachanta",
  "version": "1.0.0",
  "capabilities": {
    "domains": [
      "coding"
    ],
    "tags": [
      "skill-md",
      "claude-code",
      "workspace-hub",
      "worktree",
      "issue-execution",
      "fallback",
      "verification",
      "github"
    ],
    "languages": [
      "en"
    ]
  },
  "quality_prior": 0.6,
  "examples": [
    "Switch from tmux/interactive Claude Code to file-based claude -p execution when interactive runs fail with upstream errors or analysis-only stalls, then verify landing from git/GitHub state."
  ],
  "primary": false,
  "metadata": {
    "source": {
      "provider": "github",
      "repository": "https://github.com/vamseeachanta/workspace-hub",
      "path": ".claude/skills/workspace-hub/interactive-claude-to-file-based-fallback/SKILL.md",
      "ref": "9f24dfff6047b63d4597d2a4ed359f29d969576e",
      "url": "https://github.com/vamseeachanta/workspace-hub/blob/9f24dfff6047b63d4597d2a4ed359f29d969576e/.claude/skills/workspace-hub/interactive-claude-to-file-based-fallback/SKILL.md",
      "key": "vamseeachanta/workspace-hub/.claude/skills/workspace-hub/interactive-claude-to-file-based-fallback/SKILL.md"
    },
    "license": "MIT"
  },
  "instructions": "# Interactive Claude to File-Based Fallback\n\n## When to use\n\nUse this when:\n- the user prefers tmux + interactive Claude Code first\n- you are executing a plan-approved GitHub issue in `workspace-hub` or a similar repo\n- interactive Claude repeatedly fails to make write-phase progress\n- the repo or parent checkout may already be dirty, so you need worktree-safe verification after the run\n\n## Why this exists\n\nA recurring failure mode is that interactive Claude works well for planning and approval-safe prep, but can fail during implementation in two different ways:\n- immediate upstream errors suc",
  "cost": {
    "context_tokens": 1125
  }
}

Fetch it by URL: GET /api/v1/registry/vamseeachanta-workspace-hub-interactive-claude-to-file-b-f654b9/manifest?version=1.0.0

Reviews

Star ratings from people who tried it. One review per account; edit yours any time.

No reviews yet. Install it, try it, and be the first to rate it.