AI, Claude, Nutshell Series

Claude Exam (CCAR-F) Quick Revision 7: Session State & Resumption

Resume vs Fork

  • –resume <session-name> → Continue an existing session.
  • fork_session → Create an independent branch from shared prior context.

Memory: Resume = continue | Fork = diverge.

When to Resume

  • Previous analysis is still valid.
  • Files have not changed significantly.
  • You are continuing the same investigation.

When to Start Fresh

  • Old tool results are stale.
  • Code changed substantially.
  • Previous context may mislead Claude.

Best pattern: New session + structured summary.

Changed Files

When resuming after code changes, tell Claude exactly which files changed.

This enables targeted re-analysis instead of repeating the whole investigation.

Crash Recovery

Agent structured exports
↓
Manifest / checkpoint
↓
Coordinator reloads state
↓
Relevant state injected into agents

Fast Revision

  • Resume → continue valid context.
  • Fork → explore alternative.
  • Stale context → fresh session + summary.
  • Crash recovery → structured state + manifest.
AI, Claude, Nutshell Series

Claude Exam (CCAR-F) Quick Revision 6: Tools, Configuration & Rules

Built-In Tools

  • Read: Read a known file.
  • Edit: Targeted replacement inside an existing file.
  • Write: Create or overwrite an entire file.
  • Glob: Find files by filename/path pattern.
  • Grep: Search text inside files.
  • Bash: Run shell commands.
  • Agent: Delegate work to a separate-context subagent.

Memory: Glob finds files. Grep finds text.

Configuration Scopes

  • User: ~/.claude/ → me across projects.
  • Project: repository configuration → team/repository.
  • Local: personal settings for one repository.
  • Managed: organization-enforced configuration.

Important Files

  • CLAUDE.md: Instructions and project guidance.
  • settings.json: Claude Code configuration.
  • settings.local.json: Personal project overrides.
  • .claude/rules/*.md: Modular/path-specific instructions.
  • .mcp.json: Shared MCP configuration.
  • SKILL.md: Reusable skill definition.
  • .claude/agents/: Custom subagents.

Path-Specific Rules

---
paths:
  - "**/*.tf"
---

Use path-scoped rules when standards should apply only to particular files.

Global standards → CLAUDE.md
File-specific standards → .claude/rules/

Important Principle

CLAUDE.md provides instructions but does not provide deterministic security enforcement.

AI, Claude, Nutshell Series

Claude Exam (CCAR-F) Quick Revision 5: Multi-Agent Workflow Patterns

Prompt Chaining

Use when the sequence is predictable and known in advance.

Example: Extract → Validate → Transform → Publish.

Dynamic Adaptive Decomposition

Use when intermediate discoveries determine the next step.

Example: Debug issue → inspect logs → discover database problem → inspect queries.

Routing

Classify the input and send it to the appropriate specialist or workflow.

Parallel Sectioning

Run different independent subtasks simultaneously.

Example: Security review + performance review + maintainability review.

Parallel Voting

Run the same task multiple times and aggregate results for greater confidence.

Orchestrator-Workers

A coordinator dynamically creates and delegates subtasks to specialized workers.

Evaluator-Optimizer

Generate → critique → improve → repeat.

Context Efficiency

Let subagents perform verbose exploration and return concise synthesized findings to the coordinator.

Memory:
Chain = fixed path.
Route = choose path.
Parallel = many paths.
Orchestrator = create paths dynamically.
Agent = decide next step dynamically.

AI, Claude, Nutshell Series

Claude Exam (CCAR-F) Quick Revision 4: Hooks, Enforcement & Escalation

PreToolUse

Runs before a tool executes.

Best for:

  • Blocking unauthorized transactions.
  • Enforcing refund limits.
  • Checking prerequisites.
  • Preventing policy violations.

Example: Refund > $500 → block and escalate before process_refund executes.

PostToolUse

Runs after a tool returns.

Best for:

  • Trimming verbose results.
  • Normalizing MCP outputs.
  • Keeping only fields needed by the agent.

Example: Tool returns 40 fields → retain status, shipping date and tracking number.

Escalation: Good Triggers

  • Explicit request for a human.
  • Policy gap.
  • Permission boundary.
  • High-risk operation.
  • Deterministic hook blocks an action.

Escalation: Bad Triggers

  • Negative sentiment alone.
  • Profanity alone.
  • Self-reported model confidence alone.

Memory: Prompts guide. Hooks enforce.

AI, Claude, Nutshell Series

Claude Exam (CCAR-F) Quick Revision 3: Agentic Loops & Tool Calling

Agentic Loop

Flow:

Claude → tool_use → execute tool → tool_result → Claude → next action → end_turn

When Should the Loop Stop?

  • stop_reason = tool_use: Execute tool and continue.
  • stop_reason = end_turn: Claude has finished the turn.

Do not: Parse phrases such as “task complete” or “I am done.”

A maximum-turn limit is useful as a safety guard, but it is not the primary completion signal.

Returning Tool Results

  • Return the result in a user-role message.
  • Use a tool_result block.
  • Match the original tool_use_id.
  • The result does not have to be JSON-only.

Multi-Turn Tool Calling

Each tool result can influence Claude’s next decision.

Example: Search → Read → Analyse → Call API → Final answer.

Memory: tool_use = continue. end_turn = finish.

AI, Claude, Nutshell Series

Claude Exam (CCAR-F) Quick Revision 2: Context & Session Management

Important Commands

  • /compact: Summarise conversation and reclaim context.
  • /clear: Start with an empty conversation context.
  • /resume: Continue a previous session.
  • /context: Inspect context-window usage.
  • /branch: Explore an alternative path from the current conversation.
  • –fork-session: Inherit context but create an independent session.
  • /rewind: Return to an earlier checkpoint.

Preserving Critical Information

  • Immutable facts: Account ID, agreed price, transaction ID.
  • Mutable facts: Status, progress, next action.
  • Derived facts: Conclusions based on evidence.
  • Unverified facts: Claims still requiring confirmation.

Do not repeatedly summarise critical transactional facts. Keep them in a structured case-facts block or external state.

Long-Running Tasks

Persist important discoveries to external scratchpad/state files so they survive compaction, context resets and session boundaries.

Resuming Multi-Agent Work

Best pattern: each agent persists structured output, while a coordinator maintains a manifest/checkpoint and restores only relevant state.

Memory: Compact history. Persist facts. Rehydrate only what is needed.

AI, Claude, Nutshell Series

Claude Exam (CCAR-F) Quick Revision 1: Prompt Engineering & Few-Shot Prompting

Core rule: Precise instructions beat vague instructions.

Prompting Types

  • Zero-shot: Instruction only, no examples.
  • One-shot: One example demonstrates expected behaviour.
  • Few-shot: A small number of examples guide difficult decisions.
  • Negative examples: Show what Claude should NOT identify.
  • Contrastive examples: Show why one similar case is correct and another is not.

When to Use Few-Shot Prompting

  • Ambiguous classification.
  • Sarcasm or mixed sentiment.
  • Subjective boundaries.
  • Important edge cases.

Good pattern: Use 2–4 diverse examples including at least one difficult edge case.

Reducing False Positives

Use explicit and measurable criteria instead of instructions such as “flag anything suspicious.”

Example: “Flag functions longer than 50 lines” is better than “flag overly complex functions.”

Exam Traps

  • Temperature 0 improves consistency, not correctness.
  • Few-shot examples guide behaviour but do not guarantee enforcement.
  • Critical business rules should be implemented programmatically.

Memory: Ambiguity → examples. Hard rule → code.

AI, ML, Security

The Rise of AI Operating Systems and Machine Learning: A Look at Responsible AI and Security

Artificial Intelligence (AI) and Machine Learning (ML) are reshaping how we interact with technology. As AI models grow more sophisticated, there is an increasing interest in AI operating systems (AI OS)—a new breed of platforms designed to manage and optimize AI resources efficiently. With the proliferation of AI-driven applications, the importance of responsible AI and security has also come to the forefront. In this blog, we’ll dive into AI OS, the role of ML, and the critical concepts of responsible AI and security.

Understanding AI Operating Systems

An AI Operating System is a specialized software platform that facilitates the efficient execution, management, and optimization of AI workloads. Unlike traditional operating systems designed to manage conventional computing resources, AI OS caters specifically to the unique needs of AI models, such as rapid training, real-time inferencing, and dynamic data handling.

Some key components of an AI OS include:

  • Resource Optimization: AI OS efficiently allocates CPU, GPU, and memory resources, ensuring smooth execution of AI algorithms while minimizing latency.
  • ML Model Management: AI OS platforms typically come with built-in tools for managing machine learning models, from deployment to monitoring and updates.
  • Scalability: Scalability is crucial, and AI OS can adapt to handle vast amounts of data as AI-driven applications evolve.
  • Interoperability: AI OS often comes with support for multiple AI frameworks such as TensorFlow, PyTorch, and ONNX, allowing developers the flexibility to choose their preferred tools.

AI OS solutions, like Microsoft Azure AI, Google’s Vertex AI, and NVIDIA’s AI Enterprise, are leading the way by providing platforms that cater to both developers and businesses aiming to streamline their AI projects.

Machine Learning: A Core Pillar of AI OS

Machine Learning forms the backbone of any AI OS. ML algorithms help automate processes, derive insights, and make decisions without human intervention. In an AI OS, machine learning can be leveraged in several ways:

  • Data Processing and Analysis: ML models process and analyze large datasets in real-time, providing the necessary insights for making informed decisions.
  • Model Training and Optimization: AI OS automates model training, optimizing hyperparameters, and ensuring efficient use of resources.
  • Personalization: AI OS platforms use ML to personalize user interactions based on preferences and behaviors, creating a better user experience.

The Importance of Responsible AI

While AI has the potential to transform industries, it also comes with challenges that must be addressed to ensure its responsible use. Responsible AI is a framework for ensuring that AI technologies are developed and used in ways that are fair, ethical, and safe.

Key principles of responsible AI include:

  • Fairness: AI systems should be free from bias and discrimination. It’s essential to ensure that the data used to train AI models is representative and does not introduce biases that could result in unfair outcomes.
  • Transparency: AI models should be transparent and explainable. Users should have the ability to understand how an AI system makes its decisions, especially in high-stakes scenarios like finance, healthcare, or law.
  • Accountability: Organizations should be accountable for the outcomes of their AI models. Clear lines of responsibility must be drawn to ensure any errors or harms can be addressed appropriately.
  • Privacy: AI OS should handle data in a way that respects user privacy, complying with regulations such as GDPR. Data anonymization and secure storage are critical elements of responsible AI.

Security in AI OS and ML

With the rise of AI-driven technologies, securing AI systems has become increasingly important. AI OS and ML models can be vulnerable to several types of attacks, including:

  • Data Poisoning: Data poisoning occurs when attackers introduce malicious data into the training set, leading the model to produce incorrect predictions. Ensuring the integrity of training datasets is critical to prevent such attacks.
  • Model Inversion Attacks: In model inversion attacks, adversaries can reconstruct sensitive information from a model’s predictions. To mitigate this, AI OS platforms should employ techniques like differential privacy to safeguard user data.
  • Adversarial Attacks: These are attempts to manipulate input data in a way that misleads the model into making incorrect decisions. Using robust ML techniques and adversarial training can help make models more resilient.
  • Access Control and Authentication: AI OS must ensure that access to sensitive data and models is restricted to authorized personnel only. Strong authentication and role-based access control (RBAC) mechanisms are key to ensuring security.

A secure AI environment also involves continuous monitoring, regular security audits, and updating ML models as new vulnerabilities are discovered.

The Future of AI OS: Balancing Innovation, Responsibility, and Security

AI Operating Systems are opening new doors for innovation, making AI more accessible and efficient. The future of AI OS will likely involve deeper integrations between machine learning models and AI-driven applications, helping businesses optimize their workflows and make data-driven decisions faster.

However, as AI technology becomes more pervasive, the need for responsible AI and stringent security protocols will continue to grow. Developers, organizations, and governments must work together to establish frameworks, guidelines, and best practices that ensure AI benefits everyone while minimizing its risks.

AI OS and machine learning represent the cutting edge of technology. By emphasizing responsible AI and security, we can ensure that these advancements contribute positively to society and are adopted in ways that are ethical, safe, and beneficial to all.